blob: 9b554c3cecfc9db497c2b0cc0fc567dda31e7443 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is isolated, navigate a frame from same-origin non-isolated to different-origin (different-port) isolated</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script type="module">
import {
insertIframe,
navigateIframe,
setBothDocumentDomains,
testSameAgentCluster,
testDifferentAgentClusters,
testOriginIsolationRestricted
} from "./resources/helpers.mjs";
let frame1;
promise_setup(async () => {
frame1 = await insertIframe("{{hosts[][]}}");
});
// Since the parent is isolated, the same-origin child's non-request is ignored,
// so it gets isolated too.
testSameAgentCluster([self, 0], "Before: parent to child");
testOriginIsolationRestricted(self, true, "before parent");
testOriginIsolationRestricted(0, true, "before child");
promise_test(async () => {
await navigateIframe(frame1, "{{hosts[][]}}:{{ports[https][1]}}");
await setBothDocumentDomains(frames[0]);
}, "Navigation");
// Since the new page is different-origin, its non-request should be respected.
testDifferentAgentClusters([self, 0], "After: parent to child");
testOriginIsolationRestricted(self, true, "after parent");
testOriginIsolationRestricted(0, false, "after child");
</script>