Bug 1728209 [wpt PR 30239] - [wasm] Deprecate cross-origin module sharing, a=testonly

Automatic update from web-platform-tests
[wasm] Deprecate cross-origin module sharing

With this CL cross-origin module sharing gets disabled by default.
It can be re-enabled by setting the command line switch
`cross-origin-webassembly-module-sharing-allowed`, by setting the
enterprise policy `CrossOriginWebAssemblyModuleSharingEnabled`, or
by --enable-features=CrossOriginWebAssemblyModuleSharingEnabled.

Bug: chromium:1225641
Change-Id: I950f2121856a8c185df93e27c476ec90faf3f136
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3094205
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Anqing Zhao <anqing@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#917573}

--

wpt-commits: cd381d102622e91faf515ab77f8ca0376fbaf311
wpt-pr: 30239
This commit is contained in:
Andreas Haas 2021-09-03 04:10:05 +00:00 коммит произвёл moz-wptsync-bot
Родитель 962bd3b8e5
Коммит 4a525584aa
2 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,5 @@
<title>A test page that is sent a WebAssembly Module cross-origin cannot receive it</title>
<script>
self.onmessageerror = () => parent.postMessage('messageerror received', "*");
</script>

Просмотреть файл

@ -0,0 +1,31 @@
<title>Postmessage of a WebAssembly.Module cross-origin fails with a messageerror</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./resources/test-incrementer.js"></script>
<body></body>
<script>
promise_test(async t => {
// Create an iframe. It will notify this document when the "messageerror"
// event is triggered.
const iframe = document.createElement("iframe");
iframe.src = "//{{domains[www1]}}:{{location[port]}}" +
"/wasm/serialization/module/resources/incrementer-iframe-failure.html";
// Instantiate and wait for the document to be loaded.
const iframeLoaded = new Promise(resolve => iframe.onload = resolve);
document.body.appendChild(iframe);
await iframeLoaded;
const module = await createWasmModule();
const messageErrorReceived = new Promise(resolve => {
window.onmessage = ({data}) => {
if (data == 'messageerror received')
resolve();
};
});
iframe.contentWindow.postMessage({message: 'send module', module}, "*");
await messageErrorReceived;
}, "postMessaging a wasm module to a cross-origin iframe fails");
</script>