Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-revoke-error-in-worker.html
blob15116eed9099505b31ff8270b2ba1ffeea7291ed
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>
7 var worker;
9 function createPromise()
11 worker = new Worker("resources/worker-with-defer-handled-promise.js");
14 function handlePromiseRejection()
16 worker.postMessage("");
19 function test()
21 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAdded);
22 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated, messageUpdated);
24 InspectorTest.addResult("Creating worker with promise");
25 InspectorTest.evaluateInPageWithTimeout("createPromise()");
27 function messageAdded(event)
29 InspectorTest.addResult("");
30 InspectorTest.addResult("Message added: " + event.data.level + " " + event.data.type);
31 var counter = WebInspector.Main.WarningErrorCounter._instanceForTest;
32 for (var counter of counter._counters)
33 InspectorTest.addResult(" " + counter.title);
35 if (event.data.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
36 InspectorTest.dumpConsoleClassesBrief();
37 InspectorTest.addResult("");
38 InspectorTest.addResult("Handling promise");
39 InspectorTest.evaluateInPageWithTimeout("handlePromiseRejection()");
43 function messageUpdated()
45 InspectorTest.dumpConsoleClassesBrief();
46 InspectorTest.completeTest();
50 </script>
51 </head>
53 <body onload="runTest()">
54 <p>Tests that console revokes lazily handled promise rejections.</p>
56 </body>
57 </html>