| Index: test/inspector/debugger/get-possible-breakpoints-master.js
|
| diff --git a/test/inspector/debugger/get-possible-breakpoints-master.js b/test/inspector/debugger/get-possible-breakpoints-master.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9f7b0a5517e37857802e90051e21e8e7411b5532
|
| --- /dev/null
|
| +++ b/test/inspector/debugger/get-possible-breakpoints-master.js
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2017 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +print('Checks Debugger.getPossibleBreakpoints');
|
| +
|
| +var source = read('test/inspector/debugger/resources/break-locations.js');
|
| +InspectorTest.addScript(source);
|
| +
|
| +Protocol.Debugger.onceScriptParsed()
|
| + .then(message => Protocol.Debugger.getPossibleBreakpoints({ start: { lineNumber: 0, columnNumber : 0, scriptId: message.params.scriptId }}))
|
| + .then(dumpAllLocations)
|
| + .then(InspectorTest.completeTest);
|
| +Protocol.Debugger.enable();
|
| +
|
| +function dumpAllLocations(message) {
|
| + if (message.error) {
|
| + InspectorTest.logMessage(message);
|
| + return;
|
| + }
|
| + var lines = source.split('\n');
|
| + var locations = message.result.locations.sort((loc1, loc2) => {
|
| + if (loc2.lineNumber !== loc1.lineNumber) return loc2.lineNumber - loc1.lineNumber;
|
| + return loc2.columnNumber - loc1.columnNumber;
|
| + });
|
| + for (var location of locations) {
|
| + var line = lines[location.lineNumber];
|
| + line = line.slice(0, location.columnNumber) + '#' + line.slice(location.columnNumber);
|
| + lines[location.lineNumber] = line;
|
| + }
|
| + InspectorTest.log(lines.join('\n'));
|
| + return message;
|
| +}
|
|
|