diff options
Diffstat (limited to 'testing/web-platform/tests/scheduler/task-signal-onprioritychange.any.js')
-rw-r--r-- | testing/web-platform/tests/scheduler/task-signal-onprioritychange.any.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/scheduler/task-signal-onprioritychange.any.js b/testing/web-platform/tests/scheduler/task-signal-onprioritychange.any.js new file mode 100644 index 0000000000..7f59e1f1f8 --- /dev/null +++ b/testing/web-platform/tests/scheduler/task-signal-onprioritychange.any.js @@ -0,0 +1,14 @@ +// META: title=Scheduler: TaskSignal onprioritychange +// META: global=window,worker +'use strict'; + +async_test(t => { + const controller = new TaskController({priority: 'user-visible'}); + controller.signal.onprioritychange = t.step_func_done((event) => { + assert_equals(controller.signal.priority, 'background'); + assert_equals(event.type, 'prioritychange'); + assert_equals(event.target.priority, 'background'); + assert_equals(event.previousPriority, 'user-visible'); + }); + controller.setPriority('background'); +}, 'Test that TaskSignal.onprioritychange listens for prioritychange events'); |