Index: LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html |
diff --git a/LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html b/LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2051c7a7ffcc49fa8f625de46bb48b778d88f21c |
--- /dev/null |
+++ b/LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html |
@@ -0,0 +1,90 @@ |
+<html> |
+<head> |
+<script src="../../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../../http/tests/inspector/debugger-test.js"></script> |
+<script> |
+ |
+function testFunction() |
+{ |
+ return 0; |
+} |
+ |
+var test = function() |
+{ |
+ var testName = WebInspector.resourceTreeModel.inspectedPageURL(); |
+ testName = testName.substring(testName.lastIndexOf('/') + 1); |
+ InspectorTest.startDebuggerTest(step1); |
+ var testSourceFrame; |
+ function step1() |
+ { |
+ InspectorTest.showScriptSource(testName, step2); |
+ } |
+ |
+ function step2(sourceFrame) |
+ { |
+ testSourceFrame = sourceFrame; |
+ InspectorTest.addResult("Main resource was shown."); |
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabled", step3); |
+ WebInspector.debuggerModel.disableDebugger(); |
+ } |
+ |
+ function step3() |
+ { |
+ InspectorTest.addResult("Debugger disabled."); |
+ InspectorTest.setBreakpoint(testSourceFrame, 8, "", true); |
+ InspectorTest.addResult("Breakpoint added"); |
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnabled", step4); |
+ WebInspector.debuggerModel.enableDebugger(); |
+ } |
+ |
+ function step4() |
+ { |
+ InspectorTest.addResult("Debugger was enabled"); |
+ InspectorTest.runTestFunctionAndWaitUntilPaused(step5); |
+ } |
+ |
+ function step5() |
+ { |
+ InspectorTest.resumeExecution(step6); |
+ } |
+ |
+ function step6() |
+ { |
+ InspectorTest.addResult("Disable debugger again"); |
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasDisabled", step7); |
+ WebInspector.debuggerModel.disableDebugger(); |
+ } |
+ |
+ function step7() |
+ { |
+ InspectorTest.addResult("Debugger disabled"); |
+ var breakpoint = WebInspector.breakpointManager.findBreakpointOnLine(testSourceFrame.uiSourceCode(), 8); |
+ breakpoint.remove(); |
+ InspectorTest.addResult("Breakpoint removed"); |
+ InspectorTest.addSniffer(WebInspector.debuggerModel, "_debuggerWasEnabled", step8); |
+ WebInspector.debuggerModel.enableDebugger(); |
+ } |
+ |
+ function step8() |
+ { |
+ InspectorTest.addResult("Debugger enabled"); |
+ InspectorTest.addResult("Evaluating test function."); |
+ InspectorTest.evaluateInConsole("testFunction()", step9); |
+ } |
+ |
+ function step9() |
+ { |
+ InspectorTest.addResult("function evaluated without a pause on the breakpoint.") |
+ InspectorTest.completeDebuggerTest(); |
+ } |
+}; |
+ |
+</script> |
+</head> |
+ |
+<body onload="runTest()"> |
+<p> |
+Tests that breakpoints are correctly handled while debugger is turned off</a> |
+</p> |
+</body> |
+</html> |