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

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

Issue 1153923005: DevTools: shard inspector/debugger tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
(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 setTimeout(timeoutOffCapturing, 0);
10 }
11
12 function timeoutOffCapturing()
13 {
14 setTimeout(timeoutOffCapturing2, 0);
15 debugger; // Will start capturing async stacks from this point.
16 setTimeout(timeoutOnCapturing, 0);
17 }
18
19 function timeoutOffCapturing2()
20 {
21 debugger;
22 }
23
24 function timeoutOnCapturing()
25 {
26 debugger;
27 }
28
29 var test = function()
30 {
31 var totalDebuggerStatements = 3;
32 var maxAsyncCallStackDepth = 4;
33
34 InspectorTest.setQuiet(true);
35 InspectorTest.startDebuggerTest(step1);
36
37 function step1()
38 {
39 InspectorTest.DebuggerAgent.setAsyncCallStackDepth(0, step2);
40 }
41
42 function step2()
43 {
44 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
45 }
46
47 function resumeExecution()
48 {
49 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(Inspect orTest, didPause));
50 }
51
52 var step = 0;
53 var callStacksOutput = [];
54 function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
55 {
56 ++step;
57 if (step === 1) {
58 InspectorTest.DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStack Depth, resumeExecution);
59 return;
60 }
61
62 callStacksOutput.push(InspectorTest.captureStackTraceIntoString(callFram es, asyncStackTrace) + "\n");
63 if (step < totalDebuggerStatements) {
64 resumeExecution();
65 } else {
66 InspectorTest.addResult("Captured call stacks in no particular order :");
67 callStacksOutput.sort();
68 InspectorTest.addResults(callStacksOutput);
69 InspectorTest.completeDebuggerTest();
70 }
71 }
72 }
73
74 </script>
75 </head>
76
77 <body onload="runTest()">
78 <p>
79 Tests that capturing asynchronous call stacks in debugger works if started after some time since the page loads.
80 </p>
81
82 </body>
83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698