Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 7 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is origin-keyed, subdomain child 1 is origin-keyed, same-subdomain child 2 is site-keyed</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script type="module">
import {
insertIframe,
testSameAgentCluster,
testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs";
promise_setup(async () => {
// Order of loading should not matter, but we make it sequential to ensure the
// tests are deterministic.
await insertIframe("{{hosts[][www]}}", "?1");
await insertIframe("{{hosts[][www]}}", "?1");
});
// Since they're different-origin, the parent's request is respected, as is
// child 1's request. child 2's request is redundant, since child 1 is in the
// same browsing context group.
//
// So, the parent ends up in the origin-keyed agent cluster, and both children
// ends up in a different origin-keyed agent cluster.
testDifferentAgentClusters([self, 0], "Parent to child1");
testDifferentAgentClusters([self, 1], "Parent to child2");
testSameAgentCluster([0, 1], "child1 to child2");
testSameAgentCluster([1, 0], "child2 to child1");
testGetter(self, true, "parent");
testGetter(0, true, "child1");
testGetter(1, true, "child2");
</script>