| 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) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 (function() { | 36 (function() { |
| 37 // 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 |
| 38 // 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. |
| 39 | 39 |
| 40 var origThen = Promise.prototype.then; | 40 var origThen = Promise.prototype.then; |
| 41 var origCatch = Promise.prototype.catch; | 41 var origCatch = Promise.prototype.catch; |
| 42 | 42 |
| 43 Promise.prototype.then = function() | 43 Promise.prototype.then = function() |
| 44 { | 44 { |
| 45 var result = origThen.apply(this, arguments); | 45 var result = origThen.apply(this, arguments); |
| 46 origThen.call(result, undefined, onUncaughtPromiseReject); | 46 origThen.call(result, undefined, onUncaughtPromiseReject.bind(null, new
Error().stack)); |
| 47 return result; | 47 return result; |
| 48 } | 48 } |
| 49 | 49 |
| 50 Promise.prototype.catch = function() | 50 Promise.prototype.catch = function() |
| 51 { | 51 { |
| 52 var result = origCatch.apply(this, arguments); | 52 var result = origCatch.apply(this, arguments); |
| 53 origThen.call(result, undefined, onUncaughtPromiseReject); | 53 origThen.call(result, undefined, onUncaughtPromiseReject.bind(null, new
Error().stack)); |
| 54 return result; | 54 return result; |
| 55 } | 55 } |
| 56 | 56 |
| 57 function onUncaughtPromiseReject(e) | 57 function onUncaughtPromiseReject(stack, e) |
| 58 { | 58 { |
| 59 var message = (typeof e === "object" && e.stack) || e; | 59 var message = (typeof e === "object" && e.stack) || e; |
| 60 InspectorTest.addResult("FAIL: Uncaught exception in promise: " + messag
e); | 60 InspectorTest.addResult("FAIL: Uncaught exception in promise: " + messag
e + " " + stack); |
| 61 InspectorTest.completeDebuggerTest(); | 61 InspectorTest.completeDebuggerTest(); |
| 62 } | 62 } |
| 63 })(); | 63 })(); |
| 64 | 64 |
| 65 InspectorTest.runDebuggerTestSuite = function(testSuite) | 65 InspectorTest.runDebuggerTestSuite = function(testSuite) |
| 66 { | 66 { |
| 67 var testSuiteTests = testSuite.slice(); | 67 var testSuiteTests = testSuite.slice(); |
| 68 | 68 |
| 69 function runner() | 69 function runner() |
| 70 { | 70 { |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg
erModel.fromTarget(target)); | 590 var listItem = threadsPane._debuggerModelToListItems.get(WebInspector.Debugg
erModel.fromTarget(target)); |
| 591 threadsPane._onListItemClick(listItem); | 591 threadsPane._onListItemClick(listItem); |
| 592 } | 592 } |
| 593 | 593 |
| 594 InspectorTest.evaluateOnCurrentCallFrame = function(code) | 594 InspectorTest.evaluateOnCurrentCallFrame = function(code) |
| 595 { | 595 { |
| 596 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))
); |
| 597 } | 597 } |
| 598 | 598 |
| 599 }; | 599 }; |
| OLD | NEW |