mirror of
https://github.com/servo/servo.git
synced 2025-10-16 16:29:18 +01:00
32 lines
1,007 B
HTML
32 lines
1,007 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>Parent is isolated, child is not isolated, child is same-origin to the parent</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<div id="log"></div>
|
|
|
|
<script type="module">
|
|
import { insertIframe, sendWasmModule, setBothDocumentDomains } from "./resources/helpers.mjs";
|
|
|
|
let frameWindow;
|
|
promise_setup(async () => {
|
|
frameWindow = await insertIframe("{{hosts[][]}}");
|
|
});
|
|
|
|
// Since they're same-origin, and the parent loaded with isolation, the
|
|
// child's non-request for isolation gets ignored, and both end up origin-keyed.
|
|
|
|
promise_test(async () => {
|
|
const whatHappened = await sendWasmModule(frameWindow);
|
|
|
|
assert_equals(whatHappened, "WebAssembly.Module message received");
|
|
}, "message event must occur");
|
|
|
|
promise_test(async () => {
|
|
await setBothDocumentDomains(frameWindow);
|
|
|
|
// Must not throw
|
|
frameWindow.document;
|
|
}, "setting document.domain must give sync access");
|
|
</script>
|