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 a258c951b36c3f648ecb15f005b41956a8b0a473..30a9933f49628eca53e33fb6f6e13aeb4cd1db42 100644 |
--- a/LayoutTests/http/tests/inspector/debugger-test.js |
+++ b/LayoutTests/http/tests/inspector/debugger-test.js |
@@ -120,31 +120,46 @@ InspectorTest.resumeExecution = function(callback) |
InspectorTest.waitUntilResumed(callback); |
}; |
-InspectorTest.captureStackTrace = function(callFrames, dropLineNumbers, printReturnValue) |
+InspectorTest.captureStackTrace = function(callFrames, 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); |
+ |
+ if (options.printAsyncCallStack) { |
+ var lastCallframe = callFrames[callFrames.length - 1]; |
+ while (lastCallframe && lastCallframe.asyncCallFrames) { |
+ InspectorTest.addResult(" [Async Call]"); |
+ callFrames = lastCallframe.asyncCallFrames; |
+ printCallFrames(callFrames, " "); |
+ if (callFrames[0].functionName === "testFunction") |
+ break; |
+ lastCallframe = callFrames[callFrames.length - 1]; |
+ } |
+ } |
}; |
InspectorTest.dumpSourceFrameContents = function(sourceFrame) |