| Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..62d425b3bc880c4db2b809207982e04d15a169ca
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/possible-breakpoints.html
|
| @@ -0,0 +1,52 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/debugger-test.js"></script>
|
| +<script>
|
| +function foo() {
|
| + Promise.resolve().then(() => 239).then(() => 42);
|
| + Promise.resolve();
|
| + return;
|
| +}
|
| +//# sourceURL=foo.js
|
| +</script>
|
| +<script>
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.startDebuggerTestPromise()
|
| + .then(() => InspectorTest.showScriptSource("foo.js", didShowScriptSource));
|
| +
|
| + function didShowScriptSource(sourceFrame)
|
| + {
|
| + var uiSourceCode = sourceFrame._uiSourceCode;
|
| + var breakpointManager = WebInspector.breakpointManager;
|
| +
|
| + InspectorTest.addResult("Locations for first line");
|
| + breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(0, 0, 1, 0))
|
| + .then(dumpLocations)
|
| + .then(() => InspectorTest.addResult("All locations"))
|
| + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(0, 0, 6, 0)))
|
| + .then(dumpLocations)
|
| + .then(() => InspectorTest.addResult("Existing location by position"))
|
| + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(2, 31, 2, 32)))
|
| + .then(dumpLocations)
|
| + .then(() => InspectorTest.addResult("Not existing location by position"))
|
| + .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.TextRange(2, 32, 2, 33)))
|
| + .then(dumpLocations)
|
| + .then(() => InspectorTest.completeDebuggerTest());
|
| + }
|
| +
|
| + function dumpLocations(locations)
|
| + {
|
| + for (var location of locations)
|
| + InspectorTest.addResult(`location(${location.lineNumber}, ${location.columnNumber})`);
|
| + }
|
| +};
|
| +
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +<p>Checks that BreakpointManager.possibleBreakpoints returns correct locations</p>
|
| +</body>
|
| +</html>
|
|
|