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

Side by Side Diff: test/inspector/runtime/console-line-and-column.js

Issue 2390733002: [inspector] Make InspectorTest.sendCommand* private (Closed)
Patch Set: addressed comments Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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.sendCommand("Runtime.enable", {}); 5 Protocol.Runtime.enable();
6 6
7 addConsoleMessagePromise("console.log(239)") 7 addConsoleMessagePromise("console.log(239)")
8 .then(dumpMessage) 8 .then(message => InspectorTest.logMessage(message))
9 .then(() => addConsoleMessagePromise("var l = console.log;\n l(239)")) 9 .then(() => addConsoleMessagePromise("var l = console.log;\n l(239)"))
10 .then(dumpMessage) 10 .then(message => InspectorTest.logMessage(message))
11 .then(() => InspectorTest.completeTest()); 11 .then(() => InspectorTest.completeTest());
12 12
13 function addConsoleMessagePromise(expression) 13 function addConsoleMessagePromise(expression)
14 { 14 {
15 var cb; 15 var wait = Protocol.Runtime.onceConsoleAPICalled();
16 var p = new Promise((resolver) => cb = resolver); 16 Protocol.Runtime.evaluate({ expression: expression });
17 InspectorTest.eventHandler["Runtime.consoleAPICalled"] = (messageObject) => cb (messageObject); 17 return wait;
18 InspectorTest.sendCommand("Runtime.evaluate", { expression: expression });
19 return p;
20 } 18 }
21
22 function dumpMessage(messageObject)
23 {
24 var msg = messageObject.params;
25 delete msg.executionContextId;
26 delete msg.args;
27 delete msg.timestamp;
28 for (var frame of msg.stackTrace.callFrames)
29 frame.scriptId = 0;
30 if (!frame.functionName)
31 frame.functionName = "(anonymous)";
32 if (!frame.url)
33 frame.url = "(empty)";
34 InspectorTest.logObject(msg);
35 }
OLDNEW
« no previous file with comments | « test/inspector/runtime/console-deprecated-methods.js ('k') | test/inspector/runtime/console-line-and-column-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698