Chromium Code Reviews| 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; |