| 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..881369b4fdd84e7258eb62c85273a1fdb3944953
|
| --- /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, updates)
|
| + {
|
| + var promise = Promise.resolve();
|
| + for (var i = 0; i < updates; ++i)
|
| + promise = promise.then(() => InspectorTest.waitJavaScriptSourceFrameBreakpoints(sourceFrame));
|
| + return promise.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");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 2).then(removeBreakpoint)
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2);
|
| + }
|
| +
|
| + function removeBreakpoint()
|
| + {
|
| + InspectorTest.addResult("Toggle breakpoint");
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2);
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 0).then(() => next());
|
| + }
|
| + },
|
| +
|
| + function testTwoBreakpointsResolvedInOneLine(next)
|
| + {
|
| + var javaScriptSourceFrame;
|
| + InspectorTest.showScriptSource("edit-me-breakpoints.js", addBreakpoint);
|
| +
|
| + function addBreakpoint(sourceFrame)
|
| + {
|
| + javaScriptSourceFrame = sourceFrame;
|
| + InspectorTest.addResult("Setting breakpoint");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 4).then(removeBreakpoint);
|
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", true);
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, true);
|
| + }
|
| +
|
| + function removeBreakpoint()
|
| + {
|
| + InspectorTest.addResult("Toggle breakpoint");
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2);
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 0).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, 2).then(addConditionalDisabled);
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, "", false);
|
| + }
|
| +
|
| + function addConditionalDisabled()
|
| + {
|
| + InspectorTest.addResult("Adding conditional disabled breakpoint");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 1).then(addRegularEnabled);
|
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", false);
|
| + }
|
| +
|
| + function addRegularEnabled()
|
| + {
|
| + InspectorTest.addResult("Adding regular enabled breakpoint");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 2).then(addConditionalEnabled);
|
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "", true);
|
| + }
|
| +
|
| + function addConditionalEnabled()
|
| + {
|
| + InspectorTest.addResult("Adding conditional enabled breakpoint");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 2).then(disableAll);
|
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 0, "true", true);
|
| + }
|
| +
|
| + function disableAll()
|
| + {
|
| + InspectorTest.addResult("Disable breakpoints");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 1).then(enabledAll);
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, true);
|
| + }
|
| +
|
| + function enabledAll()
|
| + {
|
| + InspectorTest.addResult("Enable breakpoints");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 2).then(removeAll);
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, true);
|
| + }
|
| +
|
| + function removeAll()
|
| + {
|
| + InspectorTest.addResult("Remove breakpoints");
|
| + waitAndDumpDecorations(javaScriptSourceFrame, 1).then(next);
|
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 2, false);
|
| + }
|
| + }
|
| + ]);
|
| +};
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>Checks that JavaScriptSourceFrame show breakpoints correctly</p>
|
| +</body>
|
| +</html>
|
|
|