| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../http/tests/inspector/console-test.js"></script> | |
| 5 <script src="../../../http/tests/inspector/debugger-test.js"></script> | |
| 6 <script> | |
| 7 | |
| 8 function testFunction() | |
| 9 { | |
| 10 console.clear(); | |
| 11 debugger; | |
| 12 } | |
| 13 | |
| 14 function runPromises() | |
| 15 { | |
| 16 var reject; | |
| 17 var p = new Promise(function(res, rej) { | |
| 18 reject = rej; | |
| 19 }); | |
| 20 p.catch(function p_catch() { | |
| 21 throwDOMException(); | |
| 22 }); | |
| 23 reject(new Error("FAIL: Should not be printed to console")); | |
| 24 } | |
| 25 | |
| 26 function throwDOMException() | |
| 27 { | |
| 28 var a = document.createElement("div"); | |
| 29 var b = document.createElement("div"); | |
| 30 a.removeChild(b); | |
| 31 } | |
| 32 | |
| 33 function runPromisesFromInspector() | |
| 34 { | |
| 35 // setTimeout to cut off VM call frames from the stack trace. | |
| 36 setTimeout(function timeout() { | |
| 37 runPromises() | |
| 38 }, 0); | |
| 39 } | |
| 40 | |
| 41 function test() | |
| 42 { | |
| 43 InspectorTest.setQuiet(true); | |
| 44 InspectorTest.startDebuggerTest(step1); | |
| 45 | |
| 46 function step1() | |
| 47 { | |
| 48 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | |
| 49 } | |
| 50 | |
| 51 function didPause(callFrames, reason, breakpointIds, asyncStackTrace) | |
| 52 { | |
| 53 InspectorTest.addConsoleViewSniffer(addMessage, true); | |
| 54 InspectorTest.evaluateInPage("runPromisesFromInspector()", resumeExecuti
on); | |
| 55 } | |
| 56 | |
| 57 function resumeExecution() | |
| 58 { | |
| 59 InspectorTest.resumeExecution(); | |
| 60 } | |
| 61 | |
| 62 function addMessage(uiMessage) | |
| 63 { | |
| 64 InspectorTest.expandConsoleMessages(dump); | |
| 65 } | |
| 66 | |
| 67 function dump() | |
| 68 { | |
| 69 InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textConten
tWithLineBreaks); | |
| 70 InspectorTest.completeTest(); | |
| 71 } | |
| 72 } | |
| 73 | |
| 74 </script> | |
| 75 </head> | |
| 76 | |
| 77 <body onload="runTest()"> | |
| 78 <p> | |
| 79 Tests unhandled promise that was rejected with a DOM exception. | |
| 80 </p> | |
| 81 | |
| 82 </body> | |
| 83 </html> | |
| OLD | NEW |