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

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

Issue 74063002: DevTools: Support asynchronous call stacks on backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed test flakiness 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
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script>
6
7 function testFunction()
8 {
9 function innerTestFunction()
10 {
11 timeout1();
12 }
13 setTimeout(innerTestFunction, 0);
14 }
15
16 function timeout1()
17 {
18 debugger;
19 requestAnimationFrame(animFrame1);
20 var id = setInterval(innerInterval1, 0);
21 function innerInterval1()
22 {
23 clearInterval(id);
24 interval1();
25 }
26 }
27
28 function animFrame1()
29 {
30 debugger;
31 setTimeout(timeout2, 0);
32 requestAnimationFrame(animFrame2);
33 }
34
35 function interval1()
36 {
37 debugger;
38 }
39
40 function timeout2()
41 {
42 debugger;
43 }
44
45 function animFrame2()
46 {
47 debugger;
48 function longTail0()
49 {
50 timeout3();
51 }
52 var funcs = [];
53 for (var i = 0; i < 20; ++i)
54 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" + i + ", 0); };");
55 funcs.push("setTimeout(longTail" + i + ", 0);");
56 eval(funcs.join("\n"));
57 }
58
59 function timeout3()
60 {
61 debugger;
62 }
63
64 var test = function()
65 {
66 var totalDebuggerStatements = 6;
67 var maxAsyncCallStackDepth = 4;
68
69 InspectorTest.setQuiet(true);
70 InspectorTest.startDebuggerTest(step1);
71
72 function step1()
73 {
74 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
75 }
76
77 function step2()
78 {
79 InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
80 }
81
82 var step = 0;
83 var callStacksOutput = [];
84 function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
85 {
86 ++step;
87 InspectorTest.beginResultBufferring();
88 InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
89 callStacksOutput.push(InspectorTest.endResultBufferring());
90
91 if (step < totalDebuggerStatements) {
92 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(Ins pectorTest, didPaused));
93 } else {
94 InspectorTest.addResult("Captured call stacks in no particular order :");
95 callStacksOutput.sort();
96 InspectorTest.addResults(callStacksOutput);
97 InspectorTest.completeDebuggerTest();
98 }
99 }
100 }
101
102 </script>
103 </head>
104
105 <body onload="runTest()">
106 <p>
107 Tests asynchronous call stacks in debugger.
108 </p>
109
110 </body>
111 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/inspector-test.js ('k') | LayoutTests/inspector/debugger/async-callstack-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698