Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-uncaught-promise-in-worker.html
blob7c6ff69832cf55760631da5199935c4e5c23819a
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6 var worker;
8 function startWorker()
10 worker = new Worker("resources/worker-with-unhandled-promises.js");
11 worker.postMessage("");
14 function test()
16 InspectorTest.addConsoleViewSniffer(checkConsoleMessages, true);
17 InspectorTest.evaluateInPage("setTimeout(startWorker, 0)");
19 function checkConsoleMessages()
21 var count = InspectorTest.consoleMessagesCount();
22 if (count === 2)
23 WebInspector.console.showPromise().then(expand);
26 function expand()
28 InspectorTest.expandConsoleMessages(dump);
31 function dump()
33 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames();
34 InspectorTest.completeTest();
38 </script>
39 </head>
41 <body onload="runTest()">
42 <p>
43 Tests that uncaught promise rejections happenned in workers are logged into console.
44 </p>
46 </body>
47 </html>