Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-frameworks / frameworks-skip-break-program.html
blob4d9e7114c7211b78620364e245bd222c433b2474
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../debugger/resources/framework.js"></script>
6 <script>
8 function testFunction()
10 debugger;
11 Promise.resolve()
12 // Should not pause on console.assert() inside framework.
13 .then(Framework.bind(Framework.assert, null, false, "Assert from test"))
14 // Should not pause on setTimeout inside the framework.
15 .then(Framework.willSchedule(Framework.empty, 0))
16 .then(stop)
17 .catch(function FAIL_should_not_pause(e) { debugger; throw e; });
20 function stop()
22 setTimeout(function() {}, 0); // Should pause here.
25 function test()
27 var frameworkRegexString = "/framework\\.js$";
28 WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString);
30 var pane = WebInspector.panels.sources.sidebarPanes.eventListenerBreakpoints;
32 InspectorTest.startDebuggerTest(step1, true);
34 function step1()
36 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
39 function step2()
41 InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions);
42 pane._setBreakpoint("instrumentation:setTimer");
43 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
46 function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
48 InspectorTest.captureStackTrace(callFrames);
49 completeTest();
52 function completeTest()
54 InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
55 pane._removeBreakpoint("instrumentation:setTimer");
56 InspectorTest.completeDebuggerTest();
60 </script>
61 </head>
63 <body onload="runTest()">
64 <input type='button' onclick='testFunction()' value='Test'/>
65 <p>
66 Tests that framework blackboxing skips instant pauses (e.g. breakpoints on console.assert(), setTimeout(), etc.) if they happen entirely inside the framework.
67 </p>
68 </body>
69 </html>