summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js')
-rw-r--r--testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js b/testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js
new file mode 100644
index 0000000000..168fe92f54
--- /dev/null
+++ b/testing/web-platform/tests/scheduler/task-controller-abort-signal-and-priority.any.js
@@ -0,0 +1,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');