Skip to content

Commit

Permalink
[Partitioned Popins] The opener cannot open more than one popin
Browse files Browse the repository at this point in the history
Only one popin can be open at a time for a given tab.

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: I18ad78d6959497a5763c9d51bba17b586aa61479
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5823949
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1349396}
  • Loading branch information
arichiv authored and chromium-wpt-export-bot committed Aug 30, 2024
1 parent ab0edcc commit 9e39c30
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js

'use strict';

// Spec: https://explainers-by-googlers.github.io/partitioned-popins/
// Step 1 - Open a popin and succeed.
// Step 2 - Open a second popin and fail.
// Step 3 - Cleanup.

async_test(t => {
let message = "";

// Step 1
try {
let popin_1 = window.open("/partitioned-popins/resources/partitioned-popins.wait.html", '_blank', 'popin');
message += popin_1 ? "FirstPopinOpened-" : "";
} catch (_) {}

// Step 2
try {
let popin_2 = window.open("/partitioned-popins/resources/partitioned-popins.wait.html", '_blank', 'popin');
message += popin_2 ? "SecondPopinOpened-" : "";
} catch (_) {}

// Step 3
assert_equals(message, "FirstPopinOpened-");
t.done();
}, "Verify only one partitioned popin can be open at a time.");
9 changes: 9 additions & 0 deletions partitioned-popins/resources/partitioned-popins.wait.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<meta charset="utf-8">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>
(async function() {
test_driver.set_test_context(window.opener);
})();
</script>

0 comments on commit 9e39c30

Please sign in to comment.