summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js
blob: 168fe92f54a36662477c23f79790b282f888da56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// META: title=Scheduler: TaskController.abort() with Signal and Priority
// META: global=window,worker
'use strict';

promise_test(async t => {
  const controller = new TaskController();
  const signal = controller.signal;

  const task1 = scheduler.postTask(() => {}, {signal});
  const task2 = scheduler.postTask(() => {}, {priority: 'background', signal});

  controller.abort();

  await promise_rejects_dom(t, 'AbortError',  task1);
  return promise_rejects_dom(t, 'AbortError',  task2);
}, 'Test that when scheduler.postTask() is given both a signal and priority, the signal abort is honored');