| OLD | NEW |
| 1 function scheduleTestFunction() |
| 2 { |
| 3 setTimeout(testFunction, 0); |
| 4 } |
| 5 |
| 1 var initialize_DebuggerTest = function() { | 6 var initialize_DebuggerTest = function() { |
| 2 | 7 |
| 3 InspectorTest.preloadPanel("sources"); | 8 InspectorTest.preloadPanel("sources"); |
| 4 | 9 |
| 5 InspectorTest.startDebuggerTest = function(callback, quiet) | 10 InspectorTest.startDebuggerTest = function(callback, quiet) |
| 6 { | 11 { |
| 7 console.assert(InspectorTest.debuggerModel.debuggerEnabled(), "Debugger has
to be enabled"); | 12 console.assert(InspectorTest.debuggerModel.debuggerEnabled(), "Debugger has
to be enabled"); |
| 8 if (quiet !== undefined) | 13 if (quiet !== undefined) |
| 9 InspectorTest._quiet = quiet; | 14 InspectorTest._quiet = quiet; |
| 10 WebInspector.SourcesPanel.show(); | 15 WebInspector.SourcesPanel.show(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 InspectorTest.addResult(""); | 69 InspectorTest.addResult(""); |
| 65 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); | 70 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); |
| 66 InspectorTest.safeWrap(nextTest)(runner, runner); | 71 InspectorTest.safeWrap(nextTest)(runner, runner); |
| 67 } | 72 } |
| 68 | 73 |
| 69 InspectorTest.startDebuggerTest(runner); | 74 InspectorTest.startDebuggerTest(runner); |
| 70 }; | 75 }; |
| 71 | 76 |
| 72 InspectorTest.runTestFunction = function() | 77 InspectorTest.runTestFunction = function() |
| 73 { | 78 { |
| 74 InspectorTest.evaluateInPage("setTimeout(testFunction, 0)"); | 79 InspectorTest.evaluateInPage("scheduleTestFunction()"); |
| 75 InspectorTest.addResult("Set timer for test function."); | 80 InspectorTest.addResult("Set timer for test function."); |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) | 83 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) |
| 79 { | 84 { |
| 80 InspectorTest.runTestFunction(); | 85 InspectorTest.runTestFunction(); |
| 81 InspectorTest.waitUntilPaused(callback); | 86 InspectorTest.waitUntilPaused(callback); |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 InspectorTest.runAsyncCallStacksTest = function(totalDebuggerStatements, maxAsyn
cCallStackDepth) | 89 InspectorTest.runAsyncCallStacksTest = function(totalDebuggerStatements, maxAsyn
cCallStackDepth) |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 url = uiLocation.uiSourceCode.name(); | 269 url = uiLocation.uiSourceCode.name(); |
| 265 lineNumber = uiLocation.lineNumber + 1; | 270 lineNumber = uiLocation.lineNumber + 1; |
| 266 } else { | 271 } else { |
| 267 url = WebInspector.displayNameForURL(script.sourceURL); | 272 url = WebInspector.displayNameForURL(script.sourceURL); |
| 268 lineNumber = frame.location().lineNumber + 1; | 273 lineNumber = frame.location().lineNumber + 1; |
| 269 } | 274 } |
| 270 var s = (isFramework ? " * " : " ") + (printed++) + ") " + frame
.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) +
")"; | 275 var s = (isFramework ? " * " : " ") + (printed++) + ") " + frame
.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) +
")"; |
| 271 results.push(s); | 276 results.push(s); |
| 272 if (options.printReturnValue && frame.returnValue()) | 277 if (options.printReturnValue && frame.returnValue()) |
| 273 results.push(" <return>: " + frame.returnValue().descripti
on); | 278 results.push(" <return>: " + frame.returnValue().descripti
on); |
| 279 if (frame.functionName === "scheduleTestFunction") { |
| 280 var remainingFrames = callFrames.length - 1 - i; |
| 281 if (remainingFrames) |
| 282 results.push(" <... skipeed remaining frames ...>"); |
| 283 break; |
| 284 } |
| 274 } | 285 } |
| 275 return printed; | 286 return printed; |
| 276 } | 287 } |
| 277 | 288 |
| 278 results.push("Call stack:"); | 289 results.push("Call stack:"); |
| 279 printCallFrames(callFrames); | 290 printCallFrames(callFrames); |
| 280 | 291 |
| 281 while (asyncStackTrace) { | 292 while (asyncStackTrace) { |
| 282 results.push(" [" + (asyncStackTrace.description || "Async Call") + "
]"); | 293 results.push(" [" + (asyncStackTrace.description || "Async Call") + "
]"); |
| 283 var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.t
argetManager.mainTarget()); | 294 var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.t
argetManager.mainTarget()); |
| 284 var printed = printCallFrames(WebInspector.DebuggerModel.CallFrame.fromP
ayloadArray(debuggerModel, asyncStackTrace.callFrames)); | 295 var printed = printCallFrames(WebInspector.DebuggerModel.CallFrame.fromP
ayloadArray(debuggerModel, asyncStackTrace.callFrames)); |
| 285 if (!printed) | 296 if (!printed) |
| 286 results.pop(); | 297 results.pop(); |
| 287 if (asyncStackTrace.callFrames.peekLast().functionName === "testFunction
") | |
| 288 break; | |
| 289 asyncStackTrace = asyncStackTrace.asyncStackTrace; | 298 asyncStackTrace = asyncStackTrace.asyncStackTrace; |
| 290 } | 299 } |
| 291 return results.join("\n"); | 300 return results.join("\n"); |
| 292 }; | 301 }; |
| 293 | 302 |
| 294 InspectorTest.dumpSourceFrameContents = function(sourceFrame) | 303 InspectorTest.dumpSourceFrameContents = function(sourceFrame) |
| 295 { | 304 { |
| 296 InspectorTest.addResult("==Source frame contents start=="); | 305 InspectorTest.addResult("==Source frame contents start=="); |
| 297 var textEditor = sourceFrame._textEditor; | 306 var textEditor = sourceFrame._textEditor; |
| 298 for (var i = 0; i < textEditor.linesCount; ++i) | 307 for (var i = 0; i < textEditor.linesCount; ++i) |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 return self.runtime.instancesPromise(WebInspector.SourcesView.EditorAction).
then(function(editorActions) { | 532 return self.runtime.instancesPromise(WebInspector.SourcesView.EditorAction).
then(function(editorActions) { |
| 524 for (var i = 0; i < editorActions.length; ++i) { | 533 for (var i = 0; i < editorActions.length; ++i) { |
| 525 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAc
tion) | 534 if (editorActions[i] instanceof WebInspector.ScriptFormatterEditorAc
tion) |
| 526 return editorActions[i]; | 535 return editorActions[i]; |
| 527 } | 536 } |
| 528 return null; | 537 return null; |
| 529 }); | 538 }); |
| 530 }; | 539 }; |
| 531 | 540 |
| 532 }; | 541 }; |
| OLD | NEW |