Chromium Code Reviews| 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..ab3ff510175f87a38cf6b4aa45994363848cdad0 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html |
| @@ -0,0 +1,91 @@ |
| +<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); |
| + setTimeout(InspectorTest.completeDebuggerTest, 1000); |
|
loislo
2014/06/06 18:00:21
Please remove this.
Test harness already have a wa
sergeyv
2014/06/09 09:08:02
Done.
|
| + 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> |