Skip to content

Commit 2b3a440

Browse files
annevkmoz-wptsync-bot
authored andcommitted
Bug 1571693 [wpt PR 17802] - HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP, a=testonly
Automatic update from web-platform-tests HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP For whatwg/html#4734. -- wpt-commits: aecedb53e28abad5432227e293dd016cfc46d4b7 wpt-pr: 17802
1 parent 1a3dc7c commit 2b3a440

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
test(() => {
2+
const sab = new SharedArrayBuffer();
3+
const channel = new MessageChannel();
4+
assert_throws("DataCloneError", () => channel.port1.postMessage(sab));
5+
}, "SharedArrayBuffer over MessageChannel without COOP+COEP");
6+
7+
test(() => {
8+
const sab = new SharedArrayBuffer();
9+
const channel = new BroadcastChannel("Is mir egal");
10+
assert_throws("DataCloneError", () => channel.postMessage(sab));
11+
}, "SharedArrayBuffer over BroadcastChannel without COOP+COEP");
12+
13+
if (self.GLOBAL.isWindow()) {
14+
test(() => {
15+
const sab = new SharedArrayBuffer();
16+
assert_throws("DataCloneError", () => self.postMessage(sab));
17+
}, "SharedArrayBuffer over postMessage() without COOP+COEP");
18+
}

0 commit comments

Comments
 (0)