summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html
blob: 45047f3ae150023df115ae4e7731356ec326e55f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is origin-keyed, subdomain child 1 is site-keyed, same-subdomain child 2 is origin-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 () => {
  // Must be sequential, not parallel: the non-isolaed frame must load first.
  await insertIframe("{{hosts[][www]}}");
  await insertIframe("{{hosts[][www]}}", "?1");
});


// Since they're different-origin, the parent's request is respected, as is
// child 1's non-request. child 2 requests origin-keying but 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 the site-keyed one.
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, false, "child1");
testGetter(1, false, "child2");
</script>