Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

  • This test has a WPT meta file that expects 2 subtest issues.
  • This WPT test may be referenced by the following Test IDs:
    • /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/atomics-wait-async.https.any.html - WPT Dashboard Interop Dashboard
    • /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/atomics-wait-async.https.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker
promise_test(async () => {
const sab = new SharedArrayBuffer(64);
const ta = new Int32Array(sab);
const waitAsyncObj = Atomics.waitAsync(ta, 0, 0, 10);
assert_equals(waitAsyncObj.async, true);
const v = await waitAsyncObj.value;
assert_equals(v, "timed-out");
}, `Atomics.waitAsync timeout in a ${self.constructor.name}`);
promise_test(async () => {
const sab = new SharedArrayBuffer(64);
const ta = new Int32Array(sab);
const waitAsyncObj = Atomics.waitAsync(ta, 0, 0);
assert_equals(waitAsyncObj.async, true);
const worker = new Worker("resources/notify-worker.js");
worker.postMessage(sab);
const v = await waitAsyncObj.value;
assert_equals(v, "ok");
}, `Atomics.waitAsync notification in a ${self.constructor.name}`);