mirror of
https://github.com/servo/servo.git
synced 2025-09-10 06:58:21 +01:00
Update web-platform-tests to revision 0f0b7a7e353421b600ee555bf354d3a98bb603ae
This commit is contained in:
parent
363073568e
commit
71dcf37d55
175 changed files with 2749 additions and 678 deletions
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Based on similar tests in html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/ -->
|
||||
<meta charset="utf-8">
|
||||
<title>WebAssembly.Modules cannot be transferred</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="./resources/create-empty-wasm-module.js"></script>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
test(() => {
|
||||
const module = createEmptyWasmModule();
|
||||
assert_throws("DataCloneError", () => window.postMessage(module, "*", [module]));
|
||||
assert_throws("DataCloneError", () => window.postMessage("test", "*", [module]));
|
||||
}, "Trying to transfer a WebAssembly.Module to this window throws");
|
||||
|
||||
test(() => {
|
||||
const module = createEmptyWasmModule();
|
||||
const worker = new Worker("resources/echo-worker.js");
|
||||
assert_throws("DataCloneError", () => worker.postMessage(module, [module]));
|
||||
assert_throws("DataCloneError", () => worker.postMessage("test", [module]));
|
||||
}, "Trying to transfer a WebAssembly.Module to a worker throws");
|
||||
|
||||
test(() => {
|
||||
const module = createEmptyWasmModule();
|
||||
const channel = new MessageChannel();
|
||||
assert_throws("DataCloneError", () => channel.port1.postMessage(module, [module]));
|
||||
assert_throws("DataCloneError", () => channel.port1.postMessage("test", [module]));
|
||||
}, "Trying to transfer a WebAssembly.Module through a MessagePort throws");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue