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 |
| 7 function testFunction() |
| 8 { |
| 9 return 0; |
| 10 } |
| 11 |
| 12 var test = function() |
| 13 { |
| 14 var testName = WebInspector.resourceTreeModel.inspectedPageURL(); |
| 15 testName = testName.substring(testName.lastIndexOf('/') + 1); |
| 16 InspectorTest.startDebuggerTest(step1); |
| 17 var testSourceFrame; |
| 18 function step1() |
| 19 { |
| 20 InspectorTest.showScriptSource(testName, step2); |
| 21 } |
| 22 |
| 23 function step2(sourceFrame) |
| 24 { |
| 25 testSourceFrame = sourceFrame; |
| 26 InspectorTest.addResult("Main resource was shown."); |
| 27 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabl
ed", step3); |
| 28 WebInspector.debuggerModel.disableDebugger(); |
| 29 } |
| 30 |
| 31 function step3() |
| 32 { |
| 33 InspectorTest.addResult("Debugger disabled."); |
| 34 InspectorTest.setBreakpoint(testSourceFrame, 8, "", true); |
| 35 InspectorTest.addResult("Breakpoint added"); |
| 36 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable
d", step4); |
| 37 WebInspector.debuggerModel.enableDebugger(); |
| 38 } |
| 39 |
| 40 function step4() |
| 41 { |
| 42 InspectorTest.addResult("Debugger was enabled"); |
| 43 InspectorTest.runTestFunctionAndWaitUntilPaused(step5); |
| 44 } |
| 45 |
| 46 function step5() |
| 47 { |
| 48 InspectorTest.resumeExecution(step6); |
| 49 } |
| 50 |
| 51 function step6() |
| 52 { |
| 53 InspectorTest.addResult("Disable debugger again"); |
| 54 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabl
ed", step7); |
| 55 WebInspector.debuggerModel.disableDebugger(); |
| 56 } |
| 57 |
| 58 function step7() |
| 59 { |
| 60 InspectorTest.addResult("Debugger disabled"); |
| 61 var breakpoint = WebInspector.breakpointManager.findBreakpointOnLine(tes
tSourceFrame.uiSourceCode(), 8); |
| 62 breakpoint.remove(); |
| 63 InspectorTest.addResult("Breakpoint removed"); |
| 64 InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnable
d", step8); |
| 65 WebInspector.debuggerModel.enableDebugger(); |
| 66 } |
| 67 |
| 68 function step8() |
| 69 { |
| 70 InspectorTest.addResult("Debugger enabled"); |
| 71 InspectorTest.addResult("Evaluating test function."); |
| 72 InspectorTest.evaluateInConsole("testFunction()", step9); |
| 73 } |
| 74 |
| 75 function step9() |
| 76 { |
| 77 InspectorTest.addResult("function evaluated without a pause on the break
point.") |
| 78 InspectorTest.completeDebuggerTest(); |
| 79 } |
| 80 }; |
| 81 |
| 82 </script> |
| 83 </head> |
| 84 |
| 85 <body onload="runTest()"> |
| 86 <p> |
| 87 Tests that breakpoints are correctly handled while debugger is turned off</a> |
| 88 </p> |
| 89 </body> |
| 90 </html> |
OLD | NEW |