blob: b3f7f769daf243169e76871adda57a70d49d21a4 [file] [log] [blame]
Chris Harrelsonde7048e2019-07-03 00:26:591<!doctype HTML>
2<meta charset=utf-8>
3<title>Printing in microtask after navigation</title>
4<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
5<link rel="help" href="https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#printing">
6<script src="/resources/testharness.js"></script>
7<script src="/resources/testharnessreport.js"></script>
8Passes if it does not crash.
9<script>
10 let print_promise = new Promise(function(resolve, reject) {
11 resolve();
12 });
13
14 // Call print in a microtask. This will execute after the navigation click
15 // has happened, which will cause the document to become neutered and
16 // ineligible for the print command.
17 print_promise.then(() => print());
18</script>
19 <a href="resources/destination.html">
20<script>
21 document.getElementsByTagName("a")[0].click();
22</script>