Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 3bed2b3

Browse files
arichivmoz-wptsync-bot
authored andcommitted
Bug 1915759 [wpt PR 47879] - [Partitioned Popins] The popin cannot open popins, a=testonly
Automatic update from web-platform-tests [Partitioned Popins] The popin cannot open popins We disallow this in the renderer/browser as it would cause issues with the way modal popups work. Explainer: https://explainers-by-googlers.github.io/partitioned-popins/ I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/ApU_zUmpQ2g/ Bug: 340606651 Change-Id: Ib6bac72db4ff3c48038c0e92c7fecb9d3b624ea8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5816450 Commit-Queue: Ari Chivukula <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Reviewed-by: Philip Rogers <[email protected]> Auto-Submit: Ari Chivukula <[email protected]> Commit-Queue: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/main@{#1348976} -- wpt-commits: a97e8f7434c5c9a7ebb364ee557240c2f58d1837 wpt-pr: 47879
1 parent 0578eac commit 3bed2b3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// META: script=/resources/testdriver.js
2+
// META: script=/resources/testdriver-vendor.js
3+
4+
'use strict';
5+
6+
// Spec: https://explainers-by-googlers.github.io/partitioned-popins/
7+
// Step 1 (window) Set up listener to resolve messages as they come in.
8+
// Step 2 (window) Open popin.
9+
// Step 3 (popin) Try to open popin and report failure.
10+
// Step 4 (main-window) Cleanup.
11+
12+
async_test(t => {
13+
// Step 1
14+
window.addEventListener("message", t.step_func(e => {
15+
switch (e.data.type) {
16+
case 'popin':
17+
// Step 4
18+
assert_equals(e.data.message, "Could not open inner popin");
19+
t.done();
20+
break;
21+
}
22+
}));
23+
24+
// Step 2
25+
window.open("/partitioned-popins/resources/partitioned-popins.recursive.html", '_blank', 'popin');
26+
}, "Verify Partitioned Popins cannot open their own popin");
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<script src="/resources/testdriver.js"></script>
4+
<script src="/resources/testdriver-vendor.js"></script>
5+
<script>
6+
(async function() {
7+
test_driver.set_test_context(window.opener);
8+
9+
// Step 3 (partitioned-popins/partitioned-popins.recursive.tentative.sub.https.window.js)
10+
let message = "Could not open inner popin";
11+
try {
12+
window.open("/partitioned-popins/resources/partitioned-popins.close.html", '_blank', 'popin');
13+
message = "Did open inner popin";
14+
} catch (_) {}
15+
window.opener.postMessage({type: "popin", message: message}, "*");
16+
window.close();
17+
})();
18+
</script>

0 commit comments

Comments
 (0)