| OLD | NEW |
| 1 function scheduleTestFunction() | 1 function scheduleTestFunction() |
| 2 { | 2 { |
| 3 setTimeout(testFunction, 0); | 3 setTimeout(testFunction, 0); |
| 4 } | 4 } |
| 5 | 5 |
| 6 var initialize_DebuggerTest = function() { | 6 var initialize_DebuggerTest = function() { |
| 7 | 7 |
| 8 InspectorTest.preloadPanel("sources"); | 8 InspectorTest.preloadPanel("sources"); |
| 9 | 9 |
| 10 InspectorTest.startDebuggerTest = function(callback, quiet) | 10 InspectorTest.startDebuggerTest = function(callback, quiet) |
| 11 { | 11 { |
| 12 console.assert(InspectorTest.debuggerModel.debuggerEnabled(), "Debugger has
to be enabled"); | 12 console.assert(InspectorTest.debuggerModel.debuggerEnabled(), "Debugger has
to be enabled"); |
| 13 if (quiet !== undefined) | 13 if (quiet !== undefined) |
| 14 InspectorTest._quiet = quiet; | 14 InspectorTest._quiet = quiet; |
| 15 WebInspector.SourcesPanel.show(); | 15 WebInspector.SourcesPanel.show(); |
| 16 | 16 |
| 17 InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_pausedScrip
t", InspectorTest._pausedScript, true); | 17 InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_pausedScrip
t", InspectorTest._pausedScript, true); |
| 18 InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_resumedScri
pt", InspectorTest._resumedScript, true); | 18 InspectorTest.addSniffer(WebInspector.DebuggerModel.prototype, "_resumedScri
pt", InspectorTest._resumedScript, true); |
| 19 InspectorTest.safeWrap(callback)(); | 19 InspectorTest.safeWrap(callback)(); |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 InspectorTest.startDebuggerTestPromise = function(quiet) |
| 23 { |
| 24 var cb; |
| 25 var p = new Promise(fullfill => cb = fullfill); |
| 26 InspectorTest.startDebuggerTest(cb, quiet); |
| 27 return p; |
| 28 } |
| 29 |
| 22 InspectorTest.completeDebuggerTest = function() | 30 InspectorTest.completeDebuggerTest = function() |
| 23 { | 31 { |
| 24 WebInspector.breakpointManager.setBreakpointsActive(true); | 32 WebInspector.breakpointManager.setBreakpointsActive(true); |
| 25 InspectorTest.resumeExecution(InspectorTest.completeTest.bind(InspectorTest)
); | 33 InspectorTest.resumeExecution(InspectorTest.completeTest.bind(InspectorTest)
); |
| 26 }; | 34 }; |
| 27 | 35 |
| 28 (function() { | 36 (function() { |
| 29 // FIXME: Until there is no window.onerror() for uncaught exceptions in prom
ises | 37 // FIXME: Until there is no window.onerror() for uncaught exceptions in prom
ises |
| 30 // we use this hack to print the exceptions instead of just timing out. | 38 // we use this hack to print the exceptions instead of just timing out. |
| 31 | 39 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 InspectorTest.evaluateInPage("scheduleTestFunction()"); | 87 InspectorTest.evaluateInPage("scheduleTestFunction()"); |
| 80 InspectorTest.addResult("Set timer for test function."); | 88 InspectorTest.addResult("Set timer for test function."); |
| 81 }; | 89 }; |
| 82 | 90 |
| 83 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) | 91 InspectorTest.runTestFunctionAndWaitUntilPaused = function(callback) |
| 84 { | 92 { |
| 85 InspectorTest.runTestFunction(); | 93 InspectorTest.runTestFunction(); |
| 86 InspectorTest.waitUntilPaused(callback); | 94 InspectorTest.waitUntilPaused(callback); |
| 87 }; | 95 }; |
| 88 | 96 |
| 97 InspectorTest.runTestFunctionAndWaitUntilPausedPromise = function() |
| 98 { |
| 99 var cb; |
| 100 var p = new Promise(fullfill => cb = fullfill); |
| 101 InspectorTest.runTestFunctionAndWaitUntilPaused(cb); |
| 102 return p; |
| 103 } |
| 104 |
| 89 InspectorTest.runAsyncCallStacksTest = function(totalDebuggerStatements, maxAsyn
cCallStackDepth) | 105 InspectorTest.runAsyncCallStacksTest = function(totalDebuggerStatements, maxAsyn
cCallStackDepth) |
| 90 { | 106 { |
| 91 InspectorTest.setQuiet(true); | 107 InspectorTest.setQuiet(true); |
| 92 InspectorTest.startDebuggerTest(step1); | 108 InspectorTest.startDebuggerTest(step1); |
| 93 | 109 |
| 94 function step1() | 110 function step1() |
| 95 { | 111 { |
| 96 InspectorTest.DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDept
h, step2); | 112 InspectorTest.DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDept
h, step2); |
| 97 } | 113 } |
| 98 | 114 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg
erModel.fromTarget(target)); | 590 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg
erModel.fromTarget(target)); |
| 575 threadsPane._onListItemClick(listItem); | 591 threadsPane._onListItemClick(listItem); |
| 576 } | 592 } |
| 577 | 593 |
| 578 InspectorTest.evaluateOnCurrentCallFrame = function(code) | 594 InspectorTest.evaluateOnCurrentCallFrame = function(code) |
| 579 { | 595 { |
| 580 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal
lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ))
); | 596 return new Promise(succ => InspectorTest.debuggerModel.evaluateOnSelectedCal
lFrame(code, "console", false, true, false, false, InspectorTest.safeWrap(succ))
); |
| 581 } | 597 } |
| 582 | 598 |
| 583 }; | 599 }; |
| OLD | NEW |