blob: 033fdd2827fddfcbf09411b9c6c1e9ab4bdaaca1 [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is isolated, subdomain child 1 is isolated, same-subdomain child 2 is not isolated</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script type="module">
import {
insertIframe,
testSameAgentCluster,
testDifferentAgentClusters,
testOriginIsolationRestricted
} from "./resources/helpers.mjs";
promise_setup(async () => {
// Must be sequential, not parallel: the isolated frame must load first.
await insertIframe("{{hosts[][www]}}", "?1");
await insertIframe("{{hosts[][www]}}");
});
// Since they're different-origin, the parent's isolation request is respected,
// as is child 1's request. child 2's non-request is ignored, 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");
testOriginIsolationRestricted(self, true, "parent");
testOriginIsolationRestricted(0, true, "child1");
testOriginIsolationRestricted(1, true, "child2");
</script>