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