Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: test/inspector/debugger/get-possible-breakpoints-master.js

Issue 2710903003: [inspector] added master test for break locations (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/inspector/debugger/get-possible-breakpoints-master-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 print('Checks Debugger.getPossibleBreakpoints');
6
7 var source = read('test/inspector/debugger/resources/break-locations.js');
8 InspectorTest.addScript(source);
9
10 Protocol.Debugger.onceScriptParsed()
11 .then(message => Protocol.Debugger.getPossibleBreakpoints({ start: { lineNumbe r: 0, columnNumber : 0, scriptId: message.params.scriptId }}))
12 .then(dumpAllLocations)
13 .then(InspectorTest.completeTest);
14 Protocol.Debugger.enable();
15
16 function dumpAllLocations(message) {
17 if (message.error) {
18 InspectorTest.logMessage(message);
19 return;
20 }
21 var lines = source.split('\n');
22 var locations = message.result.locations.sort((loc1, loc2) => {
23 if (loc2.lineNumber !== loc1.lineNumber) return loc2.lineNumber - loc1.lineN umber;
24 return loc2.columnNumber - loc1.columnNumber;
25 });
26 for (var location of locations) {
27 var line = lines[location.lineNumber];
28 line = line.slice(0, location.columnNumber) + '#' + line.slice(location.colu mnNumber);
29 lines[location.lineNumber] = line;
30 }
31 lines = lines.filter(line => line.indexOf('//# sourceURL=') === -1);
32 InspectorTest.log(lines.join('\n'));
33 return message;
34 }
OLDNEW
« no previous file with comments | « no previous file | test/inspector/debugger/get-possible-breakpoints-master-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698