Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /scheduler/task-signal-onprioritychange.any.html - WPT Dashboard Interop Dashboard
- /scheduler/task-signal-onprioritychange.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /scheduler/task-signal-onprioritychange.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /scheduler/task-signal-onprioritychange.any.worker.html - WPT Dashboard Interop Dashboard
// 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');