3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 function testFunction()
15 var currentSourceFrame;
16 InspectorTest.setQuiet(true);
17 InspectorTest.runDebuggerTestSuite([
18 function testSetBreakpointPauseResumeThenDisable(next)
20 InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
22 function didShowScriptSource(sourceFrame)
24 InspectorTest.addResult("Script source was shown.");
25 InspectorTest.setBreakpoint(sourceFrame, 7, "", true);
26 InspectorTest.waitUntilPaused(didPause);
27 InspectorTest.runTestFunction();
30 function didPause(callFrames)
32 InspectorTest.addResult("Script execution paused.");
33 InspectorTest.captureStackTrace(callFrames);
34 InspectorTest.dumpBreakpointSidebarPane();
35 InspectorTest.addConsoleSniffer(testFunctionFinishedForTheFirstTime);
36 InspectorTest.resumeExecution(didResume);
39 function didResume(callFrames)
41 InspectorTest.addResult("Script execution resumed.");
44 function testFunctionFinishedForTheFirstTime()
46 InspectorTest.addResult("Test function finished.");
48 InspectorTest.addResult("Disabling breakpoints...");
49 WebInspector.breakpointManager.setBreakpointsActive(false);
51 InspectorTest.addResult("Running test function again...");
52 InspectorTest.addConsoleSniffer(testFunctionFinishedForTheSecondTime);
53 InspectorTest.runTestFunction();
56 function testFunctionFinishedForTheSecondTime(callFrames)
58 InspectorTest.addResult("Test function finished.");
63 function testEnableBreakpointsAgain(next)
65 InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
67 function didShowScriptSource(sourceFrame)
69 currentSourceFrame = sourceFrame;
70 InspectorTest.addResult("Enabling breakpoints...");
71 WebInspector.breakpointManager.setBreakpointsActive(true);
73 InspectorTest.addResult("Running test function...");
74 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
77 function didPause(callFrames)
79 InspectorTest.addResult("Script execution paused.");
80 InspectorTest.captureStackTrace(callFrames);
81 InspectorTest.dumpBreakpointSidebarPane();
82 InspectorTest.addConsoleSniffer(testFunctionFinished);
83 InspectorTest.resumeExecution(didResume);
86 function didResume(callFrames)
88 InspectorTest.addResult("Script execution resumed.");
91 function testFunctionFinished()
93 InspectorTest.addResult("Test function finished.");
94 InspectorTest.dumpBreakpointSidebarPane();
95 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointDecoration", breakpointRemoved);
96 InspectorTest.removeBreakpoint(currentSourceFrame, 7);
99 function breakpointRemoved()
101 InspectorTest.addResult("Breakpoints removed.");
102 InspectorTest.dumpBreakpointSidebarPane();
110 <body onload="runTest()">
111 <p>Tests disabling breakpoints.</p>