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

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

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c3360f4d4579180335a8014e0c1f25936252d018..9b4d04415ed70e74026209e6a657bb7b82600d88 100644
--- a/LayoutTests/http/tests/inspector/debugger-test.js
+++ b/LayoutTests/http/tests/inspector/debugger-test.js
@@ -120,31 +120,42 @@ InspectorTest.resumeExecution = function(callback)
InspectorTest.waitUntilResumed(callback);
};
-InspectorTest.captureStackTrace = function(callFrames, dropLineNumbers, printReturnValue)
+InspectorTest.captureStackTrace = function(callFrames, asyncStackTrace, options)
{
- InspectorTest.addResult("Call stack:");
- for (var i = 0; i < callFrames.length; i++) {
- var frame = callFrames[i];
- var script = WebInspector.debuggerModel.scriptForId(frame.location.scriptId);
- var url;
- var lineNumber;
- if (script) {
- url = WebInspector.displayNameForURL(script.sourceURL);
- lineNumber = frame.location.lineNumber + 1;
- } else {
- url = "(internal script)";
- lineNumber = "(line number)";
+ options = options || {};
+
+ function printCallFrames(callFrames, indent)
+ {
+ indent = indent || "";
+ for (var i = 0; i < callFrames.length; i++) {
+ var frame = callFrames[i];
+ var script = WebInspector.debuggerModel.scriptForId(frame.location.scriptId);
+ var url;
+ var lineNumber;
+ if (script) {
+ url = WebInspector.displayNameForURL(script.sourceURL);
+ lineNumber = frame.location.lineNumber + 1;
+ } else {
+ url = "(internal script)";
+ lineNumber = "(line number)";
+ }
+ var s = " " + i + ") " + frame.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) + ")";
+ InspectorTest.addResult(indent + s);
+ if (options.printReturnValue && frame.returnValue)
+ InspectorTest.addResult(indent + " <return>: " + frame.returnValue.description);
}
- var s = " " + i + ") " + frame.functionName + " (" + url + (dropLineNumbers ? "" : ":" + lineNumber) + ")";
- InspectorTest.addResult(s);
- if (printReturnValue && frame.returnValue)
- InspectorTest.addResult(" <return>: " + frame.returnValue.description);
}
-};
-InspectorTest.captureStackTraceExtended = function(callFrames, dropLineNumbers)
-{
- InspectorTest.captureStackTrace(callFrames, dropLineNumbers, true);
+ InspectorTest.addResult("Call stack:");
+ printCallFrames(callFrames);
+
+ while (asyncStackTrace) {
+ InspectorTest.addResult(" [Async Call]");
+ printCallFrames(asyncStackTrace.callFrames, " ");
+ if (asyncStackTrace.callFrames[0].functionName === "testFunction")
+ break;
+ asyncStackTrace = asyncStackTrace.asyncStackTrace;
+ }
};
InspectorTest.dumpSourceFrameContents = function(sourceFrame)
@@ -156,11 +167,11 @@ InspectorTest.dumpSourceFrameContents = function(sourceFrame)
InspectorTest.addResult("==Source frame contents end==");
};
-InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointIds)
+InspectorTest._pausedScript = function(callFrames, reason, auxData, breakpointIds, asyncStackTrace)
{
if (!InspectorTest._quiet)
InspectorTest.addResult("Script execution paused.");
- InspectorTest._pausedScriptArguments = [callFrames, reason, breakpointIds];
+ InspectorTest._pausedScriptArguments = [callFrames, reason, breakpointIds, asyncStackTrace];
if (InspectorTest._waitUntilPausedCallback) {
var callback = InspectorTest._waitUntilPausedCallback;
delete InspectorTest._waitUntilPausedCallback;
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698