Commit 7c20bfa6 authored by Domenic Denicola's avatar Domenic Denicola Committed by Commit Bot

Origin isolation: expand getter test coverage

It appears these iframe tests weren't testing the getter value. Probably
they were written before the getter existed.

Bug: 1042415
Change-Id: I7b3fe224bb7bd998f4a8cb4a8a67b2c60738a5ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364168Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799701}
parent 8c9a4bca
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
<script type="module"> <script type="module">
import { import {
insertIframe, insertIframe,
testDifferentAgentClusters testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -19,6 +20,8 @@ promise_setup(async () => { ...@@ -19,6 +20,8 @@ promise_setup(async () => {
// Since they're different-origin, the child's isolation request is respected, // Since they're different-origin, the child's isolation request is respected,
// so the parent ends up in the site-keyed agent cluster and the child in the // so the parent ends up in the site-keyed agent cluster and the child in the
// origin-keyed one. // origin-keyed one.
testDifferentAgentClusters([self, 0]); testDifferentAgentClusters([self, 0]);
testGetter(self, false, "parent");
testGetter(0, true, "child");
</script> </script>
...@@ -20,6 +20,7 @@ promise_setup(async () => { ...@@ -20,6 +20,7 @@ promise_setup(async () => {
// Since they're same-origin, and the parent loaded without isolation, the // Since they're same-origin, and the parent loaded without isolation, the
// child's request for isolation gets ignored, and both end up site-keyed. // child's request for isolation gets ignored, and both end up site-keyed.
testSameAgentCluster([self, 0]); testSameAgentCluster([self, 0]);
testGetter(self, false, "parent"); testGetter(self, false, "parent");
testGetter(0, false, "child"); testGetter(0, false, "child");
</script> </script>
...@@ -21,6 +21,7 @@ promise_setup(async () => { ...@@ -21,6 +21,7 @@ promise_setup(async () => {
// so the parent ends up in the site-keyed agent cluster and the child in the // so the parent ends up in the site-keyed agent cluster and the child in the
// origin-keyed one. // origin-keyed one.
testDifferentAgentClusters([self, 0]); testDifferentAgentClusters([self, 0]);
testGetter(self, false, "parent"); testGetter(self, false, "parent");
testGetter(0, true, "child"); testGetter(0, true, "child");
</script> </script>
...@@ -21,6 +21,7 @@ promise_setup(async () => { ...@@ -21,6 +21,7 @@ promise_setup(async () => {
// so the parent ends up in the site-keyed agent cluster and the child in the // so the parent ends up in the site-keyed agent cluster and the child in the
// origin-keyed one. // origin-keyed one.
testDifferentAgentClusters([self, 0]); testDifferentAgentClusters([self, 0]);
testGetter(self, false, "parent"); testGetter(self, false, "parent");
testGetter(0, true, "child"); testGetter(0, true, "child");
</script> </script>
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
<script type="module"> <script type="module">
import { import {
insertIframe, insertIframe,
testDifferentAgentClusters testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -20,4 +21,7 @@ promise_setup(async () => { ...@@ -20,4 +21,7 @@ promise_setup(async () => {
// as is the child's non-request. So the parent ends up in the origin-keyed // 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. // agent cluster and the child ends up in the site-keyed one.
testDifferentAgentClusters([self, 0]); testDifferentAgentClusters([self, 0]);
testGetter(self, true, "parent");
testGetter(0, false, "child");
</script> </script>
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
<script type="module"> <script type="module">
import { import {
insertIframe, insertIframe,
testDifferentAgentClusters testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -20,4 +21,7 @@ promise_setup(async () => { ...@@ -20,4 +21,7 @@ promise_setup(async () => {
// cluster (the default port's origin), and the child ends up in a different // cluster (the default port's origin), and the child ends up in a different
// origin-keyed agent cluster (the other port's origin). // origin-keyed agent cluster (the other port's origin).
testDifferentAgentClusters([self, 0]); testDifferentAgentClusters([self, 0]);
testGetter(self, true, "parent");
testGetter(0, true, "child");
</script> </script>
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
insertIframe, insertIframe,
testSameAgentCluster, testSameAgentCluster,
testDifferentAgentClusters, testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -29,4 +30,8 @@ testSameAgentCluster([self, 0], "Parent to child1"); ...@@ -29,4 +30,8 @@ testSameAgentCluster([self, 0], "Parent to child1");
testDifferentAgentClusters([self, 1], "Parent to child2"); testDifferentAgentClusters([self, 1], "Parent to child2");
testDifferentAgentClusters([0, 1], "child1 to child2"); testDifferentAgentClusters([0, 1], "child1 to child2");
testDifferentAgentClusters([1, 0], "child2 to child1"); testDifferentAgentClusters([1, 0], "child2 to child1");
testGetter(self, false, "parent");
testGetter(0, false, "child1");
testGetter(1, true, "child2");
</script> </script>
...@@ -21,7 +21,6 @@ promise_setup(async () => { ...@@ -21,7 +21,6 @@ promise_setup(async () => {
await insertIframe("{{hosts[][www1]}}", "?1"); await insertIframe("{{hosts[][www1]}}", "?1");
}); });
// Since everybody is different-origin, everyone's requests/non-requests get // Since everybody is different-origin, everyone's requests/non-requests get
// respected. // respected.
// //
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
import { import {
insertIframe, insertIframe,
testDifferentAgentClusters, testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 0], "Parent to child1"); ...@@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 0], "Parent to child1");
testDifferentAgentClusters([self, 1], "Parent to child2"); testDifferentAgentClusters([self, 1], "Parent to child2");
testDifferentAgentClusters([0, 1], "child1 to child2"); testDifferentAgentClusters([0, 1], "child1 to child2");
testDifferentAgentClusters([1, 0], "child2 to child1"); testDifferentAgentClusters([1, 0], "child2 to child1");
testGetter(self, true, "parent");
testGetter(0, false, "child1");
testGetter(1, true, "child2");
</script> </script>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
import { import {
insertIframe, insertIframe,
testDifferentAgentClusters, testDifferentAgentClusters,
testGetter
} from "../resources/helpers.mjs"; } from "../resources/helpers.mjs";
promise_setup(async () => { promise_setup(async () => {
...@@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 0], "Parent to child1"); ...@@ -30,4 +31,8 @@ testDifferentAgentClusters([self, 0], "Parent to child1");
testDifferentAgentClusters([self, 1], "Parent to child2"); testDifferentAgentClusters([self, 1], "Parent to child2");
testDifferentAgentClusters([0, 1], "child1 to child2"); testDifferentAgentClusters([0, 1], "child1 to child2");
testDifferentAgentClusters([1, 0], "child2 to child1"); testDifferentAgentClusters([1, 0], "child2 to child1");
testGetter(self, true, "parent");
testGetter(0, true, "child1");
testGetter(1, true, "child2");
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment