| <!doctype html> |
| <title>Scheduling API: postTask</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> |
| |
| <iframe id="i" src="support/create_and_pass_signal.html"></iframe> |
| <script> |
| 'use strict'; |
| |
| var iframe_controller; |
| function passController(controller) { |
| iframe_controller = controller; |
| i.remove(); |
| } |
| |
| async_test(t => { |
| window.onload = function() { |
| setTimeout(() => { |
| scheduler.postTask(() => {}, { signal: iframe_controller.signal }).then( |
| () => assert_unreached("Promise should be rejected"), |
| t.step_func_done()); |
| }, 0); |
| }; |
| }, 'Test scheduler.postTask() with a signal from a detached iframe'); |
| |
| </script> |