Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/abort/AbortSignal.any.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.any.shadowrealm-in-dedicatedworker.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.any.shadowrealm-in-shadowrealm.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.any.shadowrealm-in-sharedworker.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.any.shadowrealm-in-window.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.any.worker.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.https.any.shadowrealm-in-audioworklet.html - WPT Dashboard Interop Dashboard
- /dom/abort/AbortSignal.https.any.shadowrealm-in-serviceworker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker,shadowrealm
test(t => {
const signal = AbortSignal.abort();
assert_true(signal instanceof AbortSignal, "returned object is an AbortSignal");
assert_true(signal.aborted, "returned signal is already aborted");
}, "the AbortSignal.abort() static returns an already aborted signal");
async_test(t => {
const s = AbortSignal.abort();
s.addEventListener("abort", t.unreached_func("abort event listener called"));
s.onabort = t.unreached_func("abort event handler called");
t.step_timeout(() => { t.done(); }, 2000);
}, "signal returned by AbortSignal.abort() should not fire abort event");