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

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

Issue 297823003: DevTools: Remove async call stacks support for EventTarget.addEventListener. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | 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 var images = [ document.createElement("img"), document.createElement("img"), doc ument.createElement("img"), document.createElement("img") ];
8
9 function testFunction() 7 function testFunction()
10 { 8 {
11 setTimeout(timeoutOffCapturing, 0); 9 setTimeout(timeoutOffCapturing, 0);
12 } 10 }
13 11
14 function timeoutOffCapturing() 12 function timeoutOffCapturing()
15 { 13 {
16 images[0].addEventListener("click", clickedOffCapturing, false);
17 images[2].addEventListener("click", clickedOffCapturing, false);
18 images[0].addEventListener("error", imageErrorOffCapturing, false);
19 images[2].addEventListener("error", imageErrorOffCapturing, false);
20 setTimeout(timeoutOffCapturing2, 0); 14 setTimeout(timeoutOffCapturing2, 0);
21 debugger; // Will start capturing async stacks from this point. 15 debugger; // Will start capturing async stacks from this point.
22 setTimeout(timeoutOnCapturing, 0); 16 setTimeout(timeoutOnCapturing, 0);
23 } 17 }
24 18
25 function timeoutOffCapturing2() 19 function timeoutOffCapturing2()
26 { 20 {
27 function shouldBeNoAsyncStack() 21 debugger;
28 {
29 debugger;
30 }
31
32 var node = document.createElement("div");
33 node.addEventListener("click", shouldBeNoAsyncStack, false);
34 node.click();
35 } 22 }
36 23
37 function timeoutOnCapturing() 24 function timeoutOnCapturing()
38 { 25 {
39 debugger; 26 debugger;
40 images[1].addEventListener("click", clickedOnCapturing, false);
41 images[3].addEventListener("click", clickedOnCapturing, false);
42 images[1].addEventListener("error", imageErrorOnCapturing, false);
43 images[3].addEventListener("error", imageErrorOnCapturing, false);
44
45 images[0].click();
46 images[1].click();
47
48 setImageNonExistingSrc(0);
49 }
50
51 function clickedOffCapturing(e) { onClick(e.target); }
52 function clickedOnCapturing(e) { onClick(e.target); }
53
54 function onClick(img)
55 {
56 var index = images.indexOf(img);
57 switch (index) {
58 case 0:
59 images[1].click();
60 break;
61 case 1:
62 images[2].click();
63 break;
64 case 2:
65 images[3].click();
66 break;
67 case 3:
68 debugger;
69 break;
70 }
71 }
72
73 function imageErrorOffCapturing(e) { onImageError(e.target); }
74 function imageErrorOnCapturing(e) { onImageError(e.target); }
75
76 var imageErrorsCount = 0;
77 function onImageError(img)
78 {
79 var index = images.indexOf(img);
80 switch (index) {
81 case 0:
82 setImageNonExistingSrc(1);
83 break;
84 case 1:
85 setImageNonExistingSrc(2);
86 break;
87 case 2:
88 setImageNonExistingSrc(3);
89 debugger;
90 break;
91 case 3:
92 debugger;
93 break;
94 }
95 }
96
97 function setImageNonExistingSrc(imgIndex)
98 {
99 images[imgIndex].src = "/non_existing.png?count=" + (++imageErrorsCount) + " &now=" + Date.now();
100 } 27 }
101 28
102 var test = function() 29 var test = function()
103 { 30 {
104 var totalDebuggerStatements = 7; 31 var totalDebuggerStatements = 3;
105 var maxAsyncCallStackDepth = 4; 32 var maxAsyncCallStackDepth = 4;
106 33
107 InspectorTest.setQuiet(true); 34 InspectorTest.setQuiet(true);
108 InspectorTest.startDebuggerTest(step1); 35 InspectorTest.startDebuggerTest(step1);
109 36
110 function step1() 37 function step1()
111 { 38 {
112 DebuggerAgent.setAsyncCallStackDepth(0, step2); 39 DebuggerAgent.setAsyncCallStackDepth(0, step2);
113 } 40 }
114 41
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 </script> 74 </script>
148 </head> 75 </head>
149 76
150 <body onload="runTest()"> 77 <body onload="runTest()">
151 <p> 78 <p>
152 Tests that capturing asynchronous call stacks in debugger works if started after some time since the page loads. 79 Tests that capturing asynchronous call stacks in debugger works if started after some time since the page loads.
153 </p> 80 </p>
154 81
155 </body> 82 </body>
156 </html> 83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698