Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /scheduler/tentative/yield/yield-abort.any.html - WPT Dashboard Interop Dashboard
- /scheduler/tentative/yield/yield-abort.any.worker.html - WPT Dashboard Interop Dashboard
'use strict';
promise_test(t => {
const controller = new TaskController();
const signal = controller.signal;
const task = scheduler.postTask(async () => {
controller.abort();
const p = scheduler.yield();
await promise_rejects_dom(t, 'AbortError', p);
}, {signal});
return promise_rejects_dom(t, 'AbortError', task);
}, 'yield() with an aborted signal');
promise_test(t => {
const controller = new TaskController();
const signal = controller.signal;
return scheduler.postTask(async () => {
scheduler.postTask(async () => {controller.abort();}, {priority: 'user-blocking'});
t.step(() => assert_false(signal.aborted));
const p = scheduler.yield();
await promise_rejects_dom(t, 'AbortError', p);
}, {signal});
}, 'yield() aborted in a separate task');