Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

  • This test has a WPT meta file that expects 6 subtest issues.
  • This WPT test may be referenced by the following Test IDs:
    • /html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is origin-keyed, navigate a frame from same-origin site-keyed to different-origin (subdomain) origin-keyed</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,
testGetter
} from "../resources/helpers.mjs";
let frame1;
promise_setup(async () => {
frame1 = await insertIframe("{{hosts[][]}}");
});
// Since the parent is origin-keyed, the same-origin child's non-request is
// ignored, so it gets origin-keyed too.
testSameAgentCluster([self, 0], "Before: parent to child");
testGetter(self, true, "before parent");
testGetter(0, true, "before child");
promise_test(async () => {
await navigateIframe(frame1, "{{hosts[][www]}}");
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");
testGetter(self, true, "after parent");
testGetter(0, false, "after child");
</script>