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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-breakpoint-decorations.html

Issue 2505413002: [DevTools] Prepare JavaScriptSourceFrame for multiple breakpoints per line (Closed)
Patch Set: addressed comments Created 4 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
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-breakpoint-decorations.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-breakpoint-decorations.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-breakpoint-decorations.html
new file mode 100644
index 0000000000000000000000000000000000000000..e06f24830399fc606d60d5234993c30e20f60c47
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-breakpoint-decorations.html
@@ -0,0 +1,126 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../../http/tests/inspector/live-edit-test.js"></script>
+<script src="resources/edit-me-breakpoints.js"></script>
+<script>
+
+function test()
+{
+ function waitAndDumpDecorations(sourceFrame)
+ {
+ return InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame)
+ .then(() => InspectorTest.dumpJavaScriptSourceFrameBreakpoints(sourceFrame));
+ }
+
+ Bindings.breakpointManager._storage._breakpoints = {};
+ InspectorTest.runDebuggerTestSuite([
+ function testAddRemoveBreakpoint(next)
+ {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("edit-me-breakpoints.js", addBreakpoint);
+
+ function addBreakpoint(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.addResult("Setting breakpoint");
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 2, "", true)
+ .then(() => waitAndDumpDecorations(javaScriptSourceFrame))
+ .then(removeBreakpoint);
+ }
+
+ function removeBreakpoint()
+ {
+ InspectorTest.addResult("Toggle breakpoint");
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2);
+ waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
+ }
+ },
+
+ function testTwoBreakpointsResolvedInOneLine(next)
+ {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("edit-me-breakpoints.js", addBreakpoint);
+
+ function addBreakpoint(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.addResult("Setting breakpoint");
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 2, "", true)
+ .then(() => InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", true))
+ .then(() => waitAndDumpDecorations(javaScriptSourceFrame))
+ .then(removeBreakpoint);
+ }
+
+ function removeBreakpoint()
+ {
+ InspectorTest.addResult("Toggle breakpoint");
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2);
+ waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
+ }
+ },
+
+ function testDecorationInGutter(next)
+ {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("edit-me-breakpoints.js", addRegularDisabled);
+
+ function addRegularDisabled(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.addResult("Adding regular disabled breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(addConditionalDisabled);
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 2, "", false);
+ }
+
+ function addConditionalDisabled()
+ {
+ InspectorTest.addResult("Adding conditional disabled breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(addRegularEnabled);
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", false);
+ }
+
+ function addRegularEnabled()
+ {
+ InspectorTest.addResult("Adding regular enabled breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(addConditionalEnabled);
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "", true);
+ }
+
+ function addConditionalEnabled()
+ {
+ InspectorTest.addResult("Adding conditional enabled breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(disableAll);
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", true);
+ }
+
+ function disableAll()
+ {
+ InspectorTest.addResult("Disable breakpoints");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(enabledAll);
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, true);
+ }
+
+ function enabledAll()
+ {
+ InspectorTest.addResult("Enable breakpoints");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(removeAll);
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, true);
+ }
+
+ function removeAll()
+ {
+ InspectorTest.addResult("Remove breakpoints");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(next);
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, false);
+ }
+ }
+ ]);
+};
+</script>
+</head>
+<body onload="runTest()">
+<p>Checks that JavaScriptSourceFrame show breakpoints correctly</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698