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

Side by Side Diff: LayoutTests/inspector/debugger/async-callstack.html

Issue 114033002: DevTools: Capture async stacks for event listeners. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: construct event description Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script> 4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script> 5 <script>
6 6
7 function testFunction() 7 function testFunction()
8 { 8 {
9 function innerTestFunction() 9 function innerTestFunction()
10 { 10 {
11 timeout1(); 11 timeout1();
12 } 12 }
13 setTimeout(innerTestFunction, 0); 13 setTimeout(innerTestFunction, 0);
14 document.getElementById("image").addEventListener("error", imageErrorHandler , false);
14 } 15 }
15 16
16 function timeout1() 17 function timeout1()
17 { 18 {
18 debugger; 19 debugger;
19 requestAnimationFrame(animFrame1); 20 requestAnimationFrame(animFrame1);
20 var id = setInterval(innerInterval1, 0); 21 var id = setInterval(innerInterval1, 0);
21 function innerInterval1() 22 function innerInterval1()
22 { 23 {
23 clearInterval(id); 24 clearInterval(id);
(...skipping 13 matching lines...) Expand all
37 debugger; 38 debugger;
38 } 39 }
39 40
40 function timeout2() 41 function timeout2()
41 { 42 {
42 debugger; 43 debugger;
43 } 44 }
44 45
45 function animFrame2() 46 function animFrame2()
46 { 47 {
48 document.getElementById("image").addEventListener("error", imageErrorHandler , true);
47 debugger; 49 debugger;
48 function longTail0() 50 function longTail0()
49 { 51 {
50 timeout3(); 52 timeout3();
51 } 53 }
52 var funcs = []; 54 var funcs = [];
53 for (var i = 0; i < 20; ++i) 55 for (var i = 0; i < 20; ++i)
54 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" + i + ", 0); };"); 56 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" + i + ", 0); };");
55 funcs.push("setTimeout(longTail" + i + ", 0);"); 57 funcs.push("setTimeout(longTail" + i + ", 0);");
56 eval(funcs.join("\n")); 58 eval(funcs.join("\n"));
57 } 59 }
58 60
59 function timeout3() 61 function timeout3()
60 { 62 {
61 debugger; 63 debugger;
64 image.src = "non_existing.png";
65 }
66
67 function imageErrorHandler()
68 {
69 debugger; // should hit 3 times with different async stacks
62 } 70 }
63 71
64 var test = function() 72 var test = function()
65 { 73 {
66 var totalDebuggerStatements = 6; 74 var totalDebuggerStatements = 9;
67 var maxAsyncCallStackDepth = 4; 75 var maxAsyncCallStackDepth = 4;
68 76
69 InspectorTest.setQuiet(true); 77 InspectorTest.setQuiet(true);
70 InspectorTest.startDebuggerTest(step1); 78 InspectorTest.startDebuggerTest(step1);
71 79
72 function step1() 80 function step1()
73 { 81 {
74 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2); 82 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
75 } 83 }
76 84
(...skipping 22 matching lines...) Expand all
99 } 107 }
100 } 108 }
101 109
102 </script> 110 </script>
103 </head> 111 </head>
104 112
105 <body onload="runTest()"> 113 <body onload="runTest()">
106 <p> 114 <p>
107 Tests asynchronous call stacks in debugger. 115 Tests asynchronous call stacks in debugger.
108 </p> 116 </p>
117 <img id="image" onerror="imageErrorHandler()"></img>
109 118
110 </body> 119 </body>
111 </html> 120 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698