mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests Test that postMessage doesn't block on event loop Per spec postMessage should queue a message up on the target port immediately. Instead, when Workers are involved, some implementations queue a task up on current thread's event loop, which means that in case it gets blocked, some messages are never sent. Closes https://github.com/whatwg/html/issues/5485. -- wpt-commits: 3320205a9d70636efc03cfff340edecd0bee4694 wpt-pr: 23270
19 lines
480 B
HTML
19 lines
480 B
HTML
<!DOCTYPE html>
|
|
<meta charset=utf-8>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<body>
|
|
<script>
|
|
const t = async_test('postMessage and block');
|
|
|
|
const w = new Worker('support/postMessage_block_worker.js');
|
|
|
|
w.onmessage = t.step_func_done(() => {
|
|
const a = new Int32Array(new SharedArrayBuffer(4));
|
|
w.postMessage(a);
|
|
while (Atomics.load(a, 0) === 0);
|
|
assert_equals(Atomics.load(a, 0), 1);
|
|
});
|
|
</script>
|
|
</body>
|