Commit c3cb5809 authored by Domenic Denicola's avatar Domenic Denicola Committed by Commit Bot

Origin isolation: more port-related WPTs

Bug: 1042415
Change-Id: Ic742454a819841f1bdc8487aa5f16504775d95d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285329Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785971}
parent 72158dea
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is not isolated, subdomain child 1 is isolated, non-subdomain but different-port 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 () => {
// 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[][]}}:{{ports[https][1]}}");
});
// Everyone is different-origin, so everyone's request/non-request is
// respected.
//
// So, the parent and child2 end up in the site-keyed agent cluster, and child1
// ends up in an origin-keyed agent cluster.
testDifferentAgentClusters([self, 0], "Parent to child1");
testSameAgentCluster([self, 1], "Parent to child2");
testDifferentAgentClusters([0, 1], "child1 to child2");
testDifferentAgentClusters([1, 0], "child2 to child1");
testOriginIsolationRestricted(self, false, "parent");
testOriginIsolationRestricted(0, true, "child1");
testOriginIsolationRestricted(1, false, "child2");
</script>
<!DOCTYPE html>
<meta charset="utf-8">
<title>Parent is isolated, subdomain child 1 is isolated, non-subdomain but different-port 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,
testDifferentAgentClusters,
testOriginIsolationRestricted
} 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[][]}}:{{ports[https][1]}}");
});
// Everyone is different-origin, so everyone's request/non-request is
// respected.
//
// So, child2 ends up in the site-keyed agent cluster, and the parent and child1
// end up in two separate origin-keyed agent clusters.
testDifferentAgentClusters([self, 0], "Parent to child1");
testDifferentAgentClusters([self, 1], "Parent to child2");
testDifferentAgentClusters([0, 1], "child1 to child2");
testDifferentAgentClusters([1, 0], "child2 to child1");
testOriginIsolationRestricted(self, true, "parent");
testOriginIsolationRestricted(0, true, "child1");
testOriginIsolationRestricted(1, false, "child2");
</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