Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/origin/origin-keyed-agent-clusters/sandboxed-iframe-keying.sub.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>A sandboxed iframe doesn't decide the keying of its URL's origin</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script type="module">
import {
insertIframe,
navigateIframe,
testSameAgentCluster,
testGetter
} from "./resources/helpers.mjs";
promise_setup(async () => {
// Must be sequential, not parallel: the sandboxed frame must load first.
const iframe = document.createElement("iframe");
iframe.sandbox = "allow-scripts";
const loaded = navigateIframe(iframe, "{{hosts[][www]}}", "?1");
document.body.append(iframe);
await loaded;
await insertIframe("{{hosts[][www]}}", "?0");
});
// Child 1's origin is opaque, so its header is recorded for that origin and not
// for its URL's. Child 2 is then site-keyed, as it requests, and in the parent's
// agent cluster.
testGetter(0, true, "child1");
testGetter(1, false, "child2");
testSameAgentCluster([self, 1], "Parent to child2");
</script>