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