3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
7 function testFunction()
9 setTimeout(timeoutOffCapturing
, 0);
12 function timeoutOffCapturing()
14 setTimeout(timeoutOffCapturing2
, 0);
15 debugger; // Will start capturing async stacks from this point.
16 setTimeout(timeoutOnCapturing
, 0);
19 function timeoutOffCapturing2()
24 function timeoutOnCapturing()
31 var totalDebuggerStatements
= 3;
32 var maxAsyncCallStackDepth
= 4;
34 InspectorTest
.setQuiet(true);
35 InspectorTest
.startDebuggerTest(step1
);
39 InspectorTest
.DebuggerAgent
.setAsyncCallStackDepth(0, step2
);
44 InspectorTest
.runTestFunctionAndWaitUntilPaused(didPause
);
47 function resumeExecution()
49 InspectorTest
.resumeExecution(InspectorTest
.waitUntilPaused
.bind(InspectorTest
, didPause
));
53 var callStacksOutput
= [];
54 function didPause(callFrames
, reason
, breakpointIds
, asyncStackTrace
)
58 InspectorTest
.DebuggerAgent
.setAsyncCallStackDepth(maxAsyncCallStackDepth
, resumeExecution
);
62 callStacksOutput
.push(InspectorTest
.captureStackTraceIntoString(callFrames
, asyncStackTrace
) + "\n");
63 if (step
< totalDebuggerStatements
) {
66 InspectorTest
.addResult("Captured call stacks in no particular order:");
67 callStacksOutput
.sort();
68 InspectorTest
.addResults(callStacksOutput
);
69 InspectorTest
.completeDebuggerTest();
77 <body onload=
"runTest()">
79 Tests that capturing asynchronous call stacks in debugger works if started after some time since the page loads.