| OLD | NEW |
| (Empty) |
| 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> | |
| 6 function testFunction() | |
| 7 { | |
| 8 var x = Math.sqrt(10); | |
| 9 console.log("Done."); | |
| 10 return x; | |
| 11 } | |
| 12 | |
| 13 var test = function() | |
| 14 { | |
| 15 var currentSourceFrame; | |
| 16 InspectorTest.setQuiet(true); | |
| 17 InspectorTest.runDebuggerTestSuite([ | |
| 18 function testSetBreakpointPauseResumeThenDisable(next) | |
| 19 { | |
| 20 InspectorTest.showScriptSource("disable-breakpoints.html", didShowSc
riptSource); | |
| 21 | |
| 22 function didShowScriptSource(sourceFrame) | |
| 23 { | |
| 24 InspectorTest.addResult("Script source was shown."); | |
| 25 InspectorTest.setBreakpoint(sourceFrame, 7, "", true); | |
| 26 InspectorTest.waitUntilPaused(didPause); | |
| 27 InspectorTest.runTestFunction(); | |
| 28 } | |
| 29 | |
| 30 function didPause(callFrames) | |
| 31 { | |
| 32 InspectorTest.addResult("Script execution paused."); | |
| 33 InspectorTest.captureStackTrace(callFrames); | |
| 34 InspectorTest.dumpBreakpointSidebarPane(); | |
| 35 InspectorTest.addConsoleSniffer(testFunctionFinishedForTheFirstT
ime); | |
| 36 InspectorTest.resumeExecution(didResume); | |
| 37 } | |
| 38 | |
| 39 function didResume(callFrames) | |
| 40 { | |
| 41 InspectorTest.addResult("Script execution resumed."); | |
| 42 } | |
| 43 | |
| 44 function testFunctionFinishedForTheFirstTime() | |
| 45 { | |
| 46 InspectorTest.addResult("Test function finished."); | |
| 47 | |
| 48 InspectorTest.addResult("Disabling breakpoints..."); | |
| 49 WebInspector.breakpointManager.setBreakpointsActive(false); | |
| 50 | |
| 51 InspectorTest.addResult("Running test function again..."); | |
| 52 InspectorTest.addConsoleSniffer(testFunctionFinishedForTheSecond
Time); | |
| 53 InspectorTest.runTestFunction(); | |
| 54 } | |
| 55 | |
| 56 function testFunctionFinishedForTheSecondTime(callFrames) | |
| 57 { | |
| 58 InspectorTest.addResult("Test function finished."); | |
| 59 next(); | |
| 60 } | |
| 61 }, | |
| 62 | |
| 63 function testEnableBreakpointsAgain(next) | |
| 64 { | |
| 65 InspectorTest.showScriptSource("disable-breakpoints.html", didShowSc
riptSource); | |
| 66 | |
| 67 function didShowScriptSource(sourceFrame) | |
| 68 { | |
| 69 currentSourceFrame = sourceFrame; | |
| 70 InspectorTest.addResult("Enabling breakpoints..."); | |
| 71 WebInspector.breakpointManager.setBreakpointsActive(true); | |
| 72 | |
| 73 InspectorTest.addResult("Running test function..."); | |
| 74 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | |
| 75 } | |
| 76 | |
| 77 function didPause(callFrames) | |
| 78 { | |
| 79 InspectorTest.addResult("Script execution paused."); | |
| 80 InspectorTest.captureStackTrace(callFrames); | |
| 81 InspectorTest.dumpBreakpointSidebarPane(); | |
| 82 InspectorTest.addConsoleSniffer(testFunctionFinished); | |
| 83 InspectorTest.resumeExecution(didResume); | |
| 84 } | |
| 85 | |
| 86 function didResume(callFrames) | |
| 87 { | |
| 88 InspectorTest.addResult("Script execution resumed."); | |
| 89 } | |
| 90 | |
| 91 function testFunctionFinished() | |
| 92 { | |
| 93 InspectorTest.addResult("Test function finished."); | |
| 94 InspectorTest.dumpBreakpointSidebarPane(); | |
| 95 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD
ecoration", breakpointRemoved); | |
| 96 InspectorTest.removeBreakpoint(currentSourceFrame, 7); | |
| 97 } | |
| 98 | |
| 99 function breakpointRemoved() | |
| 100 { | |
| 101 InspectorTest.addResult("Breakpoints removed."); | |
| 102 InspectorTest.dumpBreakpointSidebarPane(); | |
| 103 next(); | |
| 104 } | |
| 105 }, | |
| 106 ]); | |
| 107 } | |
| 108 </script> | |
| 109 </head> | |
| 110 <body onload="runTest()"> | |
| 111 <p>Tests disabling breakpoints.</p> | |
| 112 </body> | |
| 113 </html> | |
| OLD | NEW |