Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-revoke-error.html
blobfafe9a86733646c69833ede9af3d5049622029d0
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 p = [];
9 function createPromises()
11 for (var i = 0; i < 3; ++i)
12 p.push(Promise.reject(new Error("Handled error")));
15 function handleSomeRejections()
17 p[0].catch(function() {});
18 p[2].catch(function() {});
21 function test()
23 InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAdded);
25 InspectorTest.addResult("Creating promise");
26 InspectorTest.evaluateInPageWithTimeout("createPromises()");
28 var messageNumber = 0;
29 function messageAdded(event)
31 InspectorTest.addResult("Message added: " + event.data.level + " " + event.data.type);
32 if (++messageNumber < 3)
33 return;
34 messageNumber = 0;
36 InspectorTest.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAdded);
37 InspectorTest.addResult("");
38 InspectorTest.addResult("errors: " + InspectorTest.consoleModel.errors());
39 InspectorTest.addResult("revokedErrors: " + InspectorTest.consoleModel.revokedErrors());
41 // Process array as a batch.
42 InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated, messageUpdated);
43 InspectorTest.dumpConsoleClassesBrief();
44 InspectorTest.addResult("");
45 InspectorTest.addResult("Handling promise");
46 InspectorTest.evaluateInPageWithTimeout("handleSomeRejections()");
49 function messageUpdated()
51 if (++messageNumber < 2)
52 return;
53 InspectorTest.dumpConsoleClassesBrief();
54 InspectorTest.addResult("errors: " + InspectorTest.consoleModel.errors());
55 InspectorTest.addResult("revokedErrors: " + InspectorTest.consoleModel.revokedErrors());
56 InspectorTest.completeTest();
60 </script>
61 </head>
63 <body onload="runTest()">
64 <p>Tests that console revokes lazily handled promise rejections.</p>
66 </body>
67 </html>