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

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: removed trash 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.startDebuggerTest(step1);
70
71 function step1()
72 {
73 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
74 }
75
76 function step2()
77 {
78 InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
79 }
80
81 var step = 0;
82 function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
83 {
84 ++step;
85 InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
86 if (step < totalDebuggerStatements)
87 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(Ins pectorTest, didPaused));
88 else
89 InspectorTest.completeDebuggerTest();
90 }
91 }
92
93 </script>
94 </head>
95
96 <body onload="runTest()">
97 <p>
98 Tests asynchronous call stacks in debugger.
99 </p>
100
101 </body>
102 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698