diff --git a/testing/web-platform/tests/origin-isolation/about-blank.https.sub.html b/testing/web-platform/tests/origin-isolation/about-blank.https.sub.html index ec24853a16056..50a07ff0c02e4 100644 --- a/testing/web-platform/tests/origin-isolation/about-blank.https.sub.html +++ b/testing/web-platform/tests/origin-isolation/about-blank.https.sub.html @@ -11,7 +11,8 @@ insertIframe, setBothDocumentDomains, testSameAgentCluster, - testDifferentAgentClusters + testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -25,6 +26,10 @@ testDifferentAgentClusters([0, 1], "about:blank to child2"); testDifferentAgentClusters([1, 0], "child2 to about:blank"); +testOriginIsolationRestricted(self, true, "parent"); +testOriginIsolationRestricted(0, true, "about:blank"); +testOriginIsolationRestricted(1, false, "child2"); + async function insertAboutBlankIframe() { const iframe = document.createElement("iframe"); document.body.append(iframe); diff --git a/testing/web-platform/tests/origin-isolation/getter-data-url.https.html b/testing/web-platform/tests/origin-isolation/getter-data-url.https.html new file mode 100644 index 0000000000000..da2c87b1270eb --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-data-url.https.html @@ -0,0 +1,38 @@ + + +window.originIsolationRestricted for a data: URL + + + +
+ + diff --git a/testing/web-platform/tests/origin-isolation/getter-data-url.https.html.headers b/testing/web-platform/tests/origin-isolation/getter-data-url.https.html.headers new file mode 100644 index 0000000000000..ea3f6b335c762 --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-data-url.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html b/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html new file mode 100644 index 0000000000000..a1373468e22fe --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html @@ -0,0 +1,27 @@ + + +window.crossOriginIsolated for a removed frame + + + +
+ + diff --git a/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html.headers b/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html.headers new file mode 100644 index 0000000000000..ea3f6b335c762 --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-removed-iframe.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html b/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html new file mode 100644 index 0000000000000..366fae6e5e959 --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html @@ -0,0 +1,30 @@ + + +window.originIsolationRestricted for a sandboxed frame + + + +
+ + diff --git a/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html.headers b/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html.headers new file mode 100644 index 0000000000000..ea3f6b335c762 --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/getter-sandboxed-iframe.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Isolation: ?1 diff --git a/testing/web-platform/tests/origin-isolation/insecure-http.sub.html b/testing/web-platform/tests/origin-isolation/insecure-http.sub.html index 1e78b13385727..83df16af45513 100644 --- a/testing/web-platform/tests/origin-isolation/insecure-http.sub.html +++ b/testing/web-platform/tests/origin-isolation/insecure-http.sub.html @@ -16,4 +16,9 @@ // All isolation requests are ignored, since this is over insecure HTTP. // So both end up in the site-keyed agent cluster. testSameAgentCluster([self, 0]); + +// Has to be promise_test because we used promise_setup(). +promise_test(async () => { + assert_false("originIsolationRestricted" in window); +}, "The getter must not exist"); diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child-bad-subdomain.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child-bad-subdomain.sub.https.html index ae55f5d83e10a..cfa39aaee034b 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child-bad-subdomain.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child-bad-subdomain.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-same.sub.https.html index 8e32649d3a2d2..ece3b9732a5ac 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-same.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-subdomain.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-subdomain.sub.https.html index 7f4a9413e3570..ab060e24f4976 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-subdomain.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-subdomain.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-with-params-subdomain.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-with-params-subdomain.sub.https.html index 0208ac3e14c66..e1459b9cc08a9 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child-yes-with-params-subdomain.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child-yes-with-params-subdomain.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-different.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-different.sub.https.html index c019ef2fe7dfd..17ee8a678a63a 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-different.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-different.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 1], "Parent to child2"); testDifferentAgentClusters([0, 1], "child1 to child2"); testDifferentAgentClusters([1, 0], "child2 to child1"); + +testOriginIsolationRestricted(self, false, "parent"); +testOriginIsolationRestricted(0, false, "child1"); +testOriginIsolationRestricted(1, true, "child2"); diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-same.sub.https.html index 9ca18f8941b37..17b82bc09df5c 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child1-no-child2-yes-children-same.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-no-child1-yes-child2-no-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-no-child1-yes-child2-no-children-same.sub.https.html index 2947e629bd51d..f6955c55c25a8 100644 --- a/testing/web-platform/tests/origin-isolation/parent-no-child1-yes-child2-no-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-no-child1-yes-child2-no-children-same.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 1], "Parent to child2"); testSameAgentCluster([0, 1], "child1 to child2"); testSameAgentCluster([1, 0], "child2 to child1"); + +testOriginIsolationRestricted(self, false, "parent"); +testOriginIsolationRestricted(0, true, "child1"); +testOriginIsolationRestricted(1, true, "child2"); diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child-no-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child-no-same.sub.https.html index aa1dd94682ea8..7edebe9bd88d9 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child-no-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child-no-same.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child-no-subdomain.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child-no-subdomain.sub.https.html index 5055d295d0371..f0cd3c481130c 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child-no-subdomain.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child-no-subdomain.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-same.sub.https.html index 3d99486a3cb51..c4917819617fc 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-same.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-subdomain.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-subdomain.sub.https.html index afc8f5b2acdf9..fc5b19843cbe4 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-subdomain.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child-yes-subdomain.sub.https.html @@ -7,7 +7,11 @@
diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-different.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-different.sub.https.html index 77a77d50a1c83..1635bd63848a4 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-different.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-different.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 1], "Parent to child2"); testSameAgentCluster([0, 1], "child1 to child2"); testSameAgentCluster([1, 0], "child2 to child1"); + +testOriginIsolationRestricted(self, true, "parent"); +testOriginIsolationRestricted(0, false, "child1"); +testOriginIsolationRestricted(1, false, "child2"); diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-same.sub.https.html index b3f18e8560f7f..0f2f29025e762 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-no-children-same.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 1], "Parent to child2"); testSameAgentCluster([0, 1], "child1 to child2"); testSameAgentCluster([1, 0], "child2 to child1"); + +testOriginIsolationRestricted(self, true, "parent"); +testOriginIsolationRestricted(0, false, "child1"); +testOriginIsolationRestricted(1, false, "child2"); diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-different.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-different.sub.https.html index 8e7b4d3ee5c4b..c830e1548c073 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-different.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-different.sub.https.html @@ -9,8 +9,8 @@ diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-same.sub.https.html index 260ac80d2ff4a..dc157a9eef912 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-no-child2-yes-children-same.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 1], "Parent to child2"); testSameAgentCluster([0, 1], "child1 to child2"); testSameAgentCluster([1, 0], "child2 to child1"); + +testOriginIsolationRestricted(self, true, "parent"); +testOriginIsolationRestricted(0, false, "child1"); +testOriginIsolationRestricted(1, false, "child2"); diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-no-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-no-children-same.sub.https.html index ae54fcd02ea8e..033fdd2827fdd 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-no-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-no-children-same.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -30,4 +31,8 @@ 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"); diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-different.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-different.sub.https.html index 775f753561b38..2c1f1341df518 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-different.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-different.sub.https.html @@ -9,8 +9,8 @@ diff --git a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-same.sub.https.html b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-same.sub.https.html index a3b0939862ce4..2de08307fcb79 100644 --- a/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-same.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/parent-yes-child1-yes-child2-yes-children-same.sub.https.html @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; promise_setup(async () => { @@ -31,4 +32,8 @@ 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"); diff --git a/testing/web-platform/tests/origin-isolation/removing-iframes.sub.https.html b/testing/web-platform/tests/origin-isolation/removing-iframes.sub.https.html index 2f01562b04cc8..3a6d91c447a97 100644 --- a/testing/web-platform/tests/origin-isolation/removing-iframes.sub.https.html +++ b/testing/web-platform/tests/origin-isolation/removing-iframes.sub.https.html @@ -1,6 +1,6 @@ -Parent is isolated, child1 is not isolated, child1 navigates to a different site, child2 gets inserted and is isolated, child1 navigates back +A non-isolated child at a given origin causes future children to also be non-isolated even after the iframe is removed @@ -11,6 +11,7 @@ insertIframe, testSameAgentCluster, testDifferentAgentClusters, + testOriginIsolationRestricted } from "./resources/helpers.mjs"; let frame1; @@ -22,6 +23,8 @@ // as is the child's non-request. So the parent ends up in the origin-keyed // agent cluster and the child ends up in the site-keyed one. testDifferentAgentClusters([self, 0], "Before"); +testOriginIsolationRestricted(self, true, "parent"); +testOriginIsolationRestricted(0, false, "child1"); promise_test(async () => { frame1.remove(); @@ -37,4 +40,7 @@ testDifferentAgentClusters([self, 1], "Parent to child3"); testSameAgentCluster([0, 1], "child2 to child3"); testSameAgentCluster([1, 0], "child3 to child2"); + +testOriginIsolationRestricted(0, false, "child2"); +testOriginIsolationRestricted(1, false, "child3"); diff --git a/testing/web-platform/tests/origin-isolation/resources/README.md b/testing/web-platform/tests/origin-isolation/resources/README.md new file mode 100644 index 0000000000000..dd5e192bcd506 --- /dev/null +++ b/testing/web-platform/tests/origin-isolation/resources/README.md @@ -0,0 +1,6 @@ +Why are there `.headers` files here for the `.mjs` scripts? + +Because `../getter-sandboxed-iframe.sub.https.html` is testing an opaque origin, +which is cross-origin with these scripts. Since `