-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML: ensure serializing SharedArrayBuffer throws without COOP+COEP
For whatwg/html#4734.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...astructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
test(() => { | ||
const sab = new SharedArrayBuffer(); | ||
const channel = new MessageChannel(); | ||
assert_throws("DataCloneError", () => channel.port1.postMessage(sab)); | ||
}, "SharedArrayBuffer over MessageChannel without COOP+COEP"); | ||
|
||
test(() => { | ||
const sab = new SharedArrayBuffer(); | ||
const channel = new BroadcastChannel("Is mir egal"); | ||
assert_throws("DataCloneError", () => channel.postMessage(sab)); | ||
}, "SharedArrayBuffer over BroadcastChannel without COOP+COEP"); | ||
|
||
if (self.GLOBAL.isWindow()) { | ||
test(() => { | ||
const sab = new SharedArrayBuffer(); | ||
assert_throws("DataCloneError", () => self.postMessage(sab)); | ||
}, "SharedArrayBuffer over postMessage() without COOP+COEP"); | ||
} |