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

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: 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 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 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;
yurys 2013/12/04 15:25:52 initiatorStackTrace would be a better name for asy
aandrey 2013/12/04 15:57:26 for which one? anyway "initiator" would seem confu
yurys 2013/12/05 11:37:48 For those which are asyncStackTrace at the moment,
aandrey 2013/12/05 13:03:40 Out of these two I like "async" more. Moreover it
+ }
};
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;

Powered by Google App Engine
This is Rietveld 408576698