3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
7 function testFunction()
12 var p = new Promise(function(res, rej) {
18 var q = new Promise(function(res, rej) {
25 reject(new Error("err"));
30 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints;
31 var numberOfPauses = 6;
33 InspectorTest.setQuiet(true);
34 InspectorTest.startDebuggerTest(step1);
38 pane._setBreakpoint("instrumentation:newPromise");
39 pane._setBreakpoint("instrumentation:promiseResolved");
40 pane._setBreakpoint("instrumentation:promiseRejected");
41 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
44 function didPause(callFrames, reason, breakpointIds, asyncStackTrace, auxData)
46 var eventName = (auxData && auxData.eventName || "").replace(/^instrumentation:/, "");
47 InspectorTest.addResult("\nPaused on " + eventName);
48 InspectorTest.captureStackTrace(callFrames);
51 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
53 InspectorTest.resumeExecution(step2);
58 pane._removeBreakpoint("instrumentation:newPromise");
59 pane._removeBreakpoint("instrumentation:promiseResolved");
60 pane._removeBreakpoint("instrumentation:promiseRejected");
61 InspectorTest.completeDebuggerTest();
68 <body onload="runTest()">
70 Tests that debugger will stop on Promise events.