1 // META: global=window,worker
4 // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
5 assert_equals(globalThis.SharedArrayBuffer, undefined);
6 assert_false("SharedArrayBuffer" in globalThis);
7 }, "SharedArrayBuffer constructor does not exist without COOP+COEP");
10 // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
11 const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
12 const channel = new MessageChannel();
13 assert_throws_dom("DataCloneError", () => channel.port1.postMessage(sab));
14 }, "SharedArrayBuffer over MessageChannel without COOP+COEP");
17 // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
18 const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
19 const channel = new BroadcastChannel("Is mir egal");
20 assert_throws_dom("DataCloneError", () => channel.postMessage(sab));
21 }, "SharedArrayBuffer over BroadcastChannel without COOP+COEP");
23 if (self.GLOBAL.isWindow()) {
25 // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
26 const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;
27 assert_throws_dom("DataCloneError", () => self.postMessage(sab));
28 }, "SharedArrayBuffer over postMessage() without COOP+COEP");
32 assert_false(self.crossOriginIsolated);
33 }, "Bonus: self.crossOriginIsolated");