Chromium Code Reviews| 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..5038b2085812ed1e249e64e74728abc81dfc2b0c |
| --- /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.addResult("Setting breakpoint"); |
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 3, "", true) |
| + .then(() => waitAndDumpDecorations(javaScriptSourceFrame)) |
| + .then(removeBreakpoint); |
| + } |
| + |
| + function removeBreakpoint() |
| + { |
| + InspectorTest.addResult("Toggle breakpoint"); |
| + InspectorTest.toggleBreakpoint(javaScriptSourceFrame, 3); |
| + waitAndDumpDecorations(javaScriptSourceFrame).then(() => next()); |
| + } |
| + }, |
| + |
| + function testAddRemoveBreakpointInLineWithOneBreakpoint(next) |
|
lushnikov
2016/11/28 20:35:19
WithOneLocation
kozy
2016/11/29 02:12:36
Done.
|
| + { |
| + var javaScriptSourceFrame; |
| + InspectorTest.showScriptSource("foo.js", addBreakpoint); |
| + |
| + function addBreakpoint(sourceFrame) |
| + { |
| + javaScriptSourceFrame = 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.addResult("Setting breakpoint"); |
| + InspectorTest.createNewBreakpoint(javaScriptSourceFrame, 3, "", true) |
| + .then(() => waitAndDumpDecorations(javaScriptSourceFrame)) |
| + .then(clickBySecondBreakpoint); |
| + } |
| + |
| + function clickBySecondBreakpoint() |
| + { |
| + InspectorTest.addResult("Click by second breakpoint"); |
| + InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 1); |
| + waitAndDumpDecorations(javaScriptSourceFrame).then(clickByFirstBreakpoint); |
| + } |
| + |
| + function clickByFirstBreakpoint() |
| + { |
| + InspectorTest.addResult("Click by first breakpoint"); |
| + InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 0); |
| + waitAndDumpDecorations(javaScriptSourceFrame).then(clickBySecondBreakpointAgein); |
| + } |
| + |
| + function clickBySecondBreakpointAgein() |
|
lushnikov
2016/11/28 20:35:19
Again
kozy
2016/11/29 02:12:36
Done.
|
| + { |
| + InspectorTest.addResult("Click by second breakpoint"); |
| + InspectorTest.clickJavaScriptSourceFrameBreakpoint(javaScriptSourceFrame, 3, 1); |
| + waitAndDumpDecorations(javaScriptSourceFrame).then(() => next()); |
| + } |
| + } |
| + ]); |
| +}; |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p>Checks that JavaScriptSourceFrame show inline breakpoints correctly</p> |
| +</body> |
| +</html> |