| 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 var p = Promise.resolve() |
| 8 .then(() => 239); |
| 9 console.log(42); |
| 10 // comments 1 |
| 11 // comments 2 |
| 12 // comments 3 |
| 13 // comments 4 |
| 14 // comments 5 |
| 15 fetch("url").then(response => response.data()).then(data => data.json()); |
| 16 // comment 6 |
| 17 // super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, super long comm
ent, super long comment, super long comment, super long comment, |
| 18 // comment 7 |
| 19 Promise.resolve(); |
| 20 return p; |
| 21 } |
| 22 //# sourceURL=foo.js |
| 23 </script> |
| 24 <script> |
| 25 |
| 26 function test() |
| 27 { |
| 28 InspectorTest.startDebuggerTestPromise() |
| 29 .then(() => InspectorTest.showScriptSource("foo.js", didShowScriptSource
)); |
| 30 |
| 31 function didShowScriptSource(sourceFrame) |
| 32 { |
| 33 var uiSourceCode = sourceFrame._uiSourceCode; |
| 34 var breakpointManager = WebInspector.breakpointManager; |
| 35 setBreakpoint(breakpointManager, sourceFrame, 3, false) |
| 36 .then(() => setBreakpoint(breakpointManager, sourceFrame, 4, false)) |
| 37 .then(() => setBreakpoint(breakpointManager, sourceFrame, 5, false)) |
| 38 .then(() => setBreakpoint(breakpointManager, sourceFrame, 6, false)) |
| 39 .then(() => setBreakpoint(breakpointManager, sourceFrame, 11, false)
) |
| 40 .then(() => setBreakpoint(breakpointManager, sourceFrame, 12, false)
) |
| 41 .then(() => setBreakpoint(breakpointManager, sourceFrame, 13, false)
) |
| 42 .then(() => InspectorTest.completeDebuggerTest()); |
| 43 } |
| 44 |
| 45 function setBreakpoint(breakpointManager, sourceFrame, lineNumberClicked, sh
iftKey) |
| 46 { |
| 47 var resolveCallback; |
| 48 var promise = new Promise(resolve => resolveCallback = resolve); |
| 49 InspectorTest.addSniffer(sourceFrame.__proto__, "_breakpointWasSetForTes
t", dumpLocation, false); |
| 50 sourceFrame._handleGutterClick({ data: { lineNumber: lineNumberClicked,
event: { button: 0, shiftKey: shiftKey, consume: () => true }}}); |
| 51 return promise; |
| 52 |
| 53 function dumpLocation(lineNumber, columnNumber, condition, enabled) |
| 54 { |
| 55 InspectorTest.addResult(`${lineNumberClicked}: breakpointAdded(${lin
eNumber}, ${columnNumber})`); |
| 56 resolveCallback(); |
| 57 } |
| 58 } |
| 59 }; |
| 60 |
| 61 </script> |
| 62 </head> |
| 63 <body onload="runTest()"> |
| 64 <p>Checks that locations are correctly resolved for gutter click.</p> |
| 65 </body> |
| 66 </html> |
| OLD | NEW |