Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: LayoutTests/inspector/console/console-revoke-error.html

Issue 1095943002: DevTools: [console] Logged promise rejections do not change state once handled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: for landing Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
7 var p = [];
8
9 function createPromises()
10 {
11 for (var i = 0; i < 3; ++i)
12 p.push(Promise.reject(new Error("Handled error")));
13 }
14
15 function handleSomeRejections()
16 {
17 p[0].catch(function() {});
18 p[2].catch(function() {});
19 }
20
21 function test()
22 {
23 InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events .MessageAdded, messageAdded);
24
25 InspectorTest.addResult("Creating promise");
26 InspectorTest.evaluateInPageWithTimeout("createPromises()");
27
28 function messageAdded(event)
29 {
30 InspectorTest.addResult("");
31 InspectorTest.addResult("Message added: " + event.data.level + " " + eve nt.data.type);
32 InspectorTest.addResult("errors: " + InspectorTest.consoleModel.errors() );
33 InspectorTest.addResult("revokedErrors: " + InspectorTest.consoleModel.r evokedErrors());
34
35 if (event.data.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
36 InspectorTest.consoleModel.removeEventListener(WebInspector.ConsoleM odel.Events.MessageAdded, messageAdded);
37 // Process array as a batch.
38 setTimeout(function() {
39 InspectorTest.consoleModel.addEventListener(WebInspector.Console Model.Events.MessageUpdated, messageUpdated);
40 InspectorTest.dumpConsoleClassesBrief();
41 InspectorTest.addResult("");
42 InspectorTest.addResult("Handling promise");
43 InspectorTest.evaluateInPageWithTimeout("handleSomeRejections()" );
44 });
45 }
46 }
47
48 function messageUpdated()
49 {
50 // Process array as a batch.
51 setTimeout(function() {
52 InspectorTest.dumpConsoleClassesBrief();
53 InspectorTest.completeTest();
54 });
55 }
56 }
57
58 </script>
59 </head>
60
61 <body onload="runTest()">
62 <p>Tests that console revokes lazily handled promise rejections.</p>
63
64 </body>
65 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/console/console-revoke-error-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698