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

Unified Diff: LayoutTests/inspector/sources/debugger/disable-breakpoints.html_disabled

Issue 724053003: DevTools: Add a test for disabling breakpoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/disable-breakpoints-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger/disable-breakpoints.html_disabled
diff --git a/LayoutTests/inspector/sources/debugger/disable-breakpoints.html_disabled b/LayoutTests/inspector/sources/debugger/disable-breakpoints.html_disabled
new file mode 100644
index 0000000000000000000000000000000000000000..bb0b5d5da94d369f1c80387939931edfaae4ecbd
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/disable-breakpoints.html_disabled
@@ -0,0 +1,113 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script>
+function testFunction()
+{
+ var x = Math.sqrt(10);
+ console.log("Done.");
+ return x;
+}
+
+var test = function()
+{
+ var currentSourceFrame;
+ InspectorTest.setQuiet(true);
+ InspectorTest.runDebuggerTestSuite([
+ function testSetBreakpointPauseResumeThenDisable(next)
+ {
+ InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
+
+ function didShowScriptSource(sourceFrame)
+ {
+ InspectorTest.addResult("Script source was shown.");
+ InspectorTest.setBreakpoint(sourceFrame, 7, "", true);
+ InspectorTest.waitUntilPaused(didPause);
+ InspectorTest.runTestFunction();
+ }
+
+ function didPause(callFrames)
+ {
+ InspectorTest.addResult("Script execution paused.");
+ InspectorTest.captureStackTrace(callFrames);
+ InspectorTest.dumpBreakpointSidebarPane();
+ InspectorTest.addConsoleSniffer(testFunctionFinishedForTheFirstTime);
+ InspectorTest.resumeExecution(didResume);
+ }
+
+ function didResume(callFrames)
+ {
+ InspectorTest.addResult("Script execution resumed.");
+ }
+
+ function testFunctionFinishedForTheFirstTime()
+ {
+ InspectorTest.addResult("Test function finished.");
+
+ InspectorTest.addResult("Disabling breakpoints...");
+ WebInspector.breakpointManager.setBreakpointsActive(false);
+
+ InspectorTest.addResult("Running test function again...");
+ InspectorTest.addConsoleSniffer(testFunctionFinishedForTheSecondTime);
+ InspectorTest.runTestFunction();
+ }
+
+ function testFunctionFinishedForTheSecondTime(callFrames)
+ {
+ InspectorTest.addResult("Test function finished.");
+ next();
+ }
+ },
+
+ function testEnableBreakpointsAgain(next)
+ {
+ InspectorTest.showScriptSource("disable-breakpoints.html", didShowScriptSource);
+
+ function didShowScriptSource(sourceFrame)
+ {
+ currentSourceFrame = sourceFrame;
+ InspectorTest.addResult("Enabling breakpoints...");
+ WebInspector.breakpointManager.setBreakpointsActive(true);
+
+ InspectorTest.addResult("Running test function...");
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
+ }
+
+ function didPause(callFrames)
+ {
+ InspectorTest.addResult("Script execution paused.");
+ InspectorTest.captureStackTrace(callFrames);
+ InspectorTest.dumpBreakpointSidebarPane();
+ InspectorTest.addConsoleSniffer(testFunctionFinished);
+ InspectorTest.resumeExecution(didResume);
+ }
+
+ function didResume(callFrames)
+ {
+ InspectorTest.addResult("Script execution resumed.");
+ }
+
+ function testFunctionFinished()
+ {
+ InspectorTest.addResult("Test function finished.");
+ InspectorTest.dumpBreakpointSidebarPane();
+ InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointDecoration", breakpointRemoved);
+ InspectorTest.removeBreakpoint(currentSourceFrame, 7);
+ }
+
+ function breakpointRemoved()
+ {
+ InspectorTest.addResult("Breakpoints removed.");
+ InspectorTest.dumpBreakpointSidebarPane();
+ next();
+ }
+ },
+ ]);
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests disabling breakpoints.</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/disable-breakpoints-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698