| <!doctype html> |
| <title>Scheduling API: TaskController.setPriority()</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-visible"); |
| tc.signal.onprioritychange = t.step_func_done(() => { |
| assert_equals(tc.signal.priority, "background"); |
| }); |
| tc.setPriority("background"); |
| }, 'Test that TaskController.setPriority() triggers an onprioritychange event on the signal'); |
| |
| </script> |