OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 InspectorTest.log('Checks that debugger agent uses source content to restore bre
akpoints.'); | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that debugge
r agent uses source content to restore breakpoints.'); |
6 | 6 |
7 Protocol.Debugger.enable(); | 7 Protocol.Debugger.enable(); |
8 InspectorTest.runTestSuite([ | 8 InspectorTest.runTestSuite([ |
9 function testSameSource(next) { | 9 function testSameSource(next) { |
10 var source = 'function foo() {\nboo();\n}'; | 10 var source = 'function foo() {\nboo();\n}'; |
11 test(source, source, { lineNumber: 1, columnNumber: 0 }, next); | 11 test(source, source, { lineNumber: 1, columnNumber: 0 }, next); |
12 }, | 12 }, |
13 | 13 |
14 function testOneLineOffset(next) { | 14 function testOneLineOffset(next) { |
15 var source = 'function foo() {\nboo();\n}'; | 15 var source = 'function foo() {\nboo();\n}'; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 var sourceURL = `test${++finishedTests}.js`; | 60 var sourceURL = `test${++finishedTests}.js`; |
61 await Protocol.Debugger.setBreakpointByUrl({ | 61 await Protocol.Debugger.setBreakpointByUrl({ |
62 url: sourceURL, | 62 url: sourceURL, |
63 lineNumber: location.lineNumber, | 63 lineNumber: location.lineNumber, |
64 columnNumber: location.columnNumber | 64 columnNumber: location.columnNumber |
65 }); | 65 }); |
66 await Protocol.Runtime.evaluate({ expression: `${source}\n//# sourceURL=${sour
ceURL}` }); | 66 await Protocol.Runtime.evaluate({ expression: `${source}\n//# sourceURL=${sour
ceURL}` }); |
67 await Protocol.Runtime.evaluate({ expression: `${newSource}\n//# sourceURL=${s
ourceURL}` }); | 67 await Protocol.Runtime.evaluate({ expression: `${newSource}\n//# sourceURL=${s
ourceURL}` }); |
68 next(); | 68 next(); |
69 } | 69 } |
OLD | NEW |