| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> |
| 6 function foo() { |
| 7 Promise.resolve().then(() => 239).then(() => 42); |
| 8 Promise.resolve(); |
| 9 return; |
| 10 } |
| 11 //# sourceURL=foo.js |
| 12 </script> |
| 13 <script> |
| 14 |
| 15 function test() |
| 16 { |
| 17 InspectorTest.startDebuggerTestPromise() |
| 18 .then(() => InspectorTest.showScriptSource("foo.js", didShowScriptSource
)); |
| 19 |
| 20 function didShowScriptSource(sourceFrame) |
| 21 { |
| 22 var uiSourceCode = sourceFrame._uiSourceCode; |
| 23 var breakpointManager = WebInspector.breakpointManager; |
| 24 |
| 25 InspectorTest.addResult("Locations for first line"); |
| 26 breakpointManager.possibleBreakpoints(uiSourceCode, new WebInspector.Tex
tRange(0, 0, 1, 0)) |
| 27 .then(dumpLocations) |
| 28 .then(() => InspectorTest.addResult("All locations")) |
| 29 .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new
WebInspector.TextRange(0, 0, 6, 0))) |
| 30 .then(dumpLocations) |
| 31 .then(() => InspectorTest.addResult("Existing location by position")
) |
| 32 .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new
WebInspector.TextRange(2, 31, 2, 32))) |
| 33 .then(dumpLocations) |
| 34 .then(() => InspectorTest.addResult("Not existing location by positi
on")) |
| 35 .then(() => breakpointManager.possibleBreakpoints(uiSourceCode, new
WebInspector.TextRange(2, 32, 2, 33))) |
| 36 .then(dumpLocations) |
| 37 .then(() => InspectorTest.completeDebuggerTest()); |
| 38 } |
| 39 |
| 40 function dumpLocations(locations) |
| 41 { |
| 42 for (var location of locations) |
| 43 InspectorTest.addResult(`location(${location.lineNumber}, ${location
.columnNumber})`); |
| 44 } |
| 45 }; |
| 46 |
| 47 </script> |
| 48 </head> |
| 49 <body onload="runTest()"> |
| 50 <p>Checks that BreakpointManager.possibleBreakpoints returns correct locations</
p> |
| 51 </body> |
| 52 </html> |
| OLD | NEW |