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

Unified Diff: LayoutTests/http/tests/inspector/debugger-test.js

Issue 118293002: DevTools: Support XHR async call stacks in the debugger. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: split tests 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/inspector/debugger-test.js
diff --git a/LayoutTests/http/tests/inspector/debugger-test.js b/LayoutTests/http/tests/inspector/debugger-test.js
index 21d535568fa5df938ea51a053cd0d494f88b2732..6ffa21789727402a3a88eb69b91f4149052a8a60 100644
--- a/LayoutTests/http/tests/inspector/debugger-test.js
+++ b/LayoutTests/http/tests/inspector/debugger-test.js
@@ -83,6 +83,43 @@ InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback)
InspectorTest.waitUntilPaused(callback);
};
+InspectorTest.runAsyncCallStacksTest = function(totalDebuggerStatements, maxAsyncCallStackDepth)
+{
+ maxAsyncCallStackDepth = maxAsyncCallStackDepth || 4;
yurys 2013/12/23 09:11:57 Please make it a required parameter for better rea
aandrey 2013/12/23 12:09:38 Done.
+
+ InspectorTest.setQuiet(true);
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2);
+ }
+
+ function step2()
+ {
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+ }
+
+ var step = 0;
+ var callStacksOutput = [];
+ function didPaused(callFrames, reason, breakpointIds, asyncStackTrace)
+ {
+ ++step;
+ InspectorTest.beginResultBufferring();
yurys 2013/12/23 09:11:57 I must have overlooked this begin/endResultBufferi
aandrey 2013/12/23 12:09:38 Done.
+ InspectorTest.captureStackTrace(callFrames, asyncStackTrace);
+ callStacksOutput.push(InspectorTest.endResultBufferring());
+
+ if (step < totalDebuggerStatements) {
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPaused));
+ } else {
+ InspectorTest.addResult("Captured call stacks in no particular order:");
+ callStacksOutput.sort();
+ InspectorTest.addResults(callStacksOutput);
+ InspectorTest.completeDebuggerTest();
+ }
+ }
+};
+
InspectorTest.waitUntilPausedNextTime = function(callback)
{
InspectorTest._waitUntilPausedCallback = InspectorTest.safeWrap(callback);
@@ -151,7 +188,7 @@ InspectorTest.captureStackTrace = function(callFrames, asyncStackTrace, options)
while (asyncStackTrace) {
InspectorTest.addResult(" [" + (asyncStackTrace.description || "Async Call") + "]");
printCallFrames(asyncStackTrace.callFrames);
- if (asyncStackTrace.callFrames[0].functionName === "testFunction")
+ if (asyncStackTrace.callFrames.peekLast().functionName === "testFunction")
break;
asyncStackTrace = asyncStackTrace.asyncStackTrace;
}

Powered by Google App Engine
This is Rietveld 408576698