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

Unified 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, 10 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5926a89e7dac9bd23be9c3575cd87e970a4c39e1
--- /dev/null
+++ b/test/inspector/debugger/get-possible-breakpoints-master.js
@@ -0,0 +1,34 @@
+// 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;
+ }
+ lines = lines.filter(line => line.indexOf('//# sourceURL=') === -1);
+ InspectorTest.log(lines.join('\n'));
+ return message;
+}
« 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