Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /scheduler/post-task-with-abort-signal.any.html - WPT Dashboard Interop Dashboard
- /scheduler/post-task-with-abort-signal.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /scheduler/post-task-with-abort-signal.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /scheduler/post-task-with-abort-signal.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=Scheduler: postTask and AbortSignal
// META: global=window,worker
'use strict';
promise_test(t => {
const controller = new AbortController();
const signal = controller.signal;
const taskResult = scheduler.postTask(() => {}, {signal});
controller.abort();
return promise_rejects_dom(t, 'AbortError', taskResult);
}, 'Test that scheduler.postTask() accepts an AbortSignal that is not also a TaskSignal');