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

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

Issue 2526013002: [DevTools] Added inline breakpoints (Closed)
Patch Set: rebased test 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-inline-breakpoint-decorations.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-inline-breakpoint-decorations.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-inline-breakpoint-decorations.html
new file mode 100644
index 0000000000000000000000000000000000000000..93329e48bed3a3fb434790836025e8dbfded7421
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/source-frame-inline-breakpoint-decorations.html
@@ -0,0 +1,112 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script>
+function foo()
+{
+ var p = Promise.resolve().then(() => console.log(42))
+ .then(() => console.log(239));
+ return p;
+}
+//# sourceURL=foo.js
+</script>
+<script>
+
+function test()
+{
+ function waitAndDumpDecorations(sourceFrame)
+ {
+ return InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame)
+ .then(() => InspectorTest.dumpJavaScriptSourceFrameBreakpoints(sourceFrame));
+ }
+
+ Runtime.experiments.enableForTest("inlineBreakpoints");
+ Bindings.breakpointManager._storage._breakpoints = {};
+ InspectorTest.runDebuggerTestSuite([
+ function testAddRemoveBreakpoint(next)
+ {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("foo.js", addBreakpoint);
+
+ function addBreakpoint(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.prepareSourceFrameForBreakpointTest(sourceFrame);
+ InspectorTest.addResult("Setting breakpoint");
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 3, "", true)
+ .then(() => waitAndDumpDecorations(javaScriptSourceFrame).then(removeBreakpoint));
+ }
+
+ function removeBreakpoint()
+ {
+ InspectorTest.addResult("Toggle breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 3);
+ }
+ },
+
+ function testAddRemoveBreakpointInLineWithOneLocation(next)
+ {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("foo.js", addBreakpoint);
+
+ function addBreakpoint(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.prepareSourceFrameForBreakpointTest(sourceFrame);
+ InspectorTest.addResult("Setting breakpoint");
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 5, "", true)
+ .then(() => waitAndDumpDecorations(javaScriptSourceFrame).then(removeBreakpoint));
+ }
+
+ function removeBreakpoint()
+ {
+ InspectorTest.addResult("Toggle breakpoint");
+ InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 5);
+ waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
+ }
+ },
+
+ function clickByInlineBreakpoint(next) {
+ var javaScriptSourceFrame;
+ InspectorTest.showScriptSource("foo.js", addBreakpoint);
+
+ function addBreakpoint(sourceFrame)
+ {
+ javaScriptSourceFrame = sourceFrame;
+ InspectorTest.prepareSourceFrameForBreakpointTest(sourceFrame);
+ InspectorTest.addResult("Setting breakpoint");
+ InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 3, "", true)
+ .then(() => waitAndDumpDecorations(javaScriptSourceFrame).then(clickBySecondLocation));
+ }
+
+ function clickBySecondLocation()
+ {
+ InspectorTest.addResult("Click by second breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(clickByFirstLocation);
+ InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 1);
+ }
+
+ function clickByFirstLocation()
+ {
+ InspectorTest.addResult("Click by first breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(clickBySecondLocationAgain);
+ InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 0);
+ }
+
+ function clickBySecondLocationAgain()
+ {
+ InspectorTest.addResult("Click by second breakpoint");
+ waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
+ InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 1);
+ }
+ }
+ ]);
+};
+</script>
+</head>
+<body onload="runTest()">
+<p>Checks that JavaScriptSourceFrame show inline breakpoints correctly</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698