Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: LayoutTests/inspector/sources/debugger/debugger-disable-add-breakpoint.html

Issue 323503002: Devtools: Support disabling and enabling of debugger in TargetBreakpoints (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix expectations Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698