(source, newSource, location, next)
| 82 | ]); |
| 83 | |
| 84 | async function test(source, newSource, location, next) { |
| 85 | function dumpSourceWithBreakpoint(source, location) { |
| 86 | var lineNumber = location.lineNumber; |
| 87 | var columnNumber = location.columnNumber; |
| 88 | var lines = source.split('\n'); |
| 89 | lines = lines.map(line => line.length > 80 ? line.substring(0, 77) + '...' : line); |
| 90 | lines[lineNumber] = lines[lineNumber].slice(0, columnNumber) + '#' + lines[lineNumber].slice(columnNumber); |
| 91 | InspectorTest.log(lines.join('\n')); |
| 92 | } |
| 93 | |
| 94 | Protocol.Debugger.onScriptParsed(({ params: { resolvedBreakpoints } }) => { |
| 95 | for (const {location} of resolvedBreakpoints ?? []) { |
| 96 | dumpSourceWithBreakpoint(newSource, location); |
| 97 | } |
| 98 | }) |
| 99 | |
| 100 | var sourceURL = `test${++finishedTests}.js`; |
| 101 | await Protocol.Runtime.evaluate({ expression: `${source}\n//# sourceURL=${sourceURL}` }); |
| 102 | let {result:{locations}} = await Protocol.Debugger.setBreakpointByUrl({ |
| 103 | url: sourceURL, |
| 104 | lineNumber: location.lineNumber, |
| 105 | columnNumber: location.columnNumber |
| 106 | }); |
| 107 | dumpSourceWithBreakpoint(source, locations[0]); |
| 108 | await Protocol.Runtime.evaluate({ expression: `${newSource}\n//# sourceURL=${sourceURL}` }); |
| 109 | next(); |
| 110 | } |
no test coverage detected