blob: 64994cdfb76f18cb11c42cc8258209fcfd1091e3 [file] [log] [blame]
<!doctype html>
<title>Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="resources/common.js"></script>
<script>
[
{
"title": "popup with coop/coep",
"coop": "same-origin",
"coep": "require-corp",
"opener": true
},
{
"title": "popup with coop unsafe-inherit/coep",
"coop": "unsafe-inherit",
"coep": "require-corp",
"opener": true
},
{
"title": "popup with coop unsafe-inherit without coep",
"coop": "unsafe-inherit",
"coep": "",
"opener": false
},
{
"title": "popup without coep",
"coop": "same-origin",
"coep": "",
"opener": false
}
].forEach(variant => {
async_test(t => {
coop_coep_test(t, SAME_ORIGIN, variant.coop, variant.coep, variant.title.replace(/ /g,"-"), variant.opener);
}, `Same-origin ${variant.title}`);
// This seems useful to test, CROSS_SITE is probably too redundant though.
async_test(t => {
coop_coep_test(t, SAME_SITE, variant.coop, variant.coep, `same-site-${variant.title.replace(/ /g,"-")}`, false);
}, `Same-site ${variant.title}`);
});
test(() => {
assert_true(window.crossOriginIsolated);
}, "Bonus: window.crossOriginIsolated");
</script>