-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test per annevk's suggestion to navigate from CSP sandbox to CO…
…OP doc
- Loading branch information
Showing
4 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
html/cross-origin-opener-policy/coop-csp-sandbox-navigate.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!doctype html> | ||
<title>CSP sandbox popup navigate to Cross-Origin-Opener-Policy document should work</title> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<script src="/common/utils.js"></script> <!-- Use token() to allow running tests in parallel --> | ||
<div id=log> | ||
<script> | ||
[ | ||
"allow-popups allow-scripts allow-same-origin", | ||
"allow-popups allow-scripts", | ||
].forEach(sandboxValue => { | ||
async_test(t => { | ||
const channel = new BroadcastChannel(token()); | ||
channel.onmessage = t.step_func_done(); | ||
const navigateTo = `/html/cross-origin-opener-policy/resources/coop-coep.py?coop=same-origin&coep=&channel=${channel.name}`; | ||
const popup = window.open(`resources/csp-sandbox.py?coop=&coep=&sandbox=${sandboxValue}&channel=&navigate=${encodeURIComponent(navigateTo)}`); | ||
t.add_cleanup(() => { popup.close(); }); | ||
addEventListener('load', t.step_func(() => { | ||
t.step_timeout(() => { | ||
assert_unreached('Navigation from CSP sandbox to COOP document failed') | ||
}, 1500); | ||
})); | ||
}, `CSP: sandbox ${sandboxValue}; ${document.title}`); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters