blob: 70c26156f9cda2b2de1408d356ed3a943bf013c9 [file] [log] [blame]
<!doctype html>
<title>Scheduling API: Signal inheritance</title>
<link rel="author" title="Nate Chapin" href="mailto:japhet@chromium.org">
<link rel="help" href="https://github.com/WICG/main-thread-scheduling">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
'use strict';
async_test(t => {
let tc = new TaskController("user-blocking");
scheduler.postTask(async () => {
await new Promise(resolve => setTimeout(resolve, 0));
scheduler.postTask(() => {}, { signal: scheduler.currentTaskSignal }).then(
() => { assert_unreached('This task should have been aborted'); },
t.step_func_done());
tc.abort();
}, { signal: tc.signal });
}, 'Test that currentTaskSignal works through promise resolution');
</script>