| <!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/post_task_then_detach_iframe.html"></iframe> |
| <script> |
| 'use strict'; |
| |
| onmessage = () => { assert_unreached("task should not have run"); }; |
| |
| async_test(t => { |
| // Give the task time to run if it hadn't been detached. |
| scheduler.postTask(t.step_func_done(() => {}), { priority: "background" }); |
| }, 'Test scheduler.postTask() from an iframe that is removed before the task runs'); |
| |
| </script> |