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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/runtime/console-line-and-column.js
diff --git a/test/inspector/runtime/console-line-and-column.js b/test/inspector/runtime/console-line-and-column.js
index c370f24ea95e1b20854250a32558cb12cf221a86..fe5c24f27cbaf134e1f2aca409fbefc98f49d4cc 100644
--- a/test/inspector/runtime/console-line-and-column.js
+++ b/test/inspector/runtime/console-line-and-column.js
@@ -2,34 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-InspectorTest.sendCommand("Runtime.enable", {});
+Protocol.Runtime.enable();
addConsoleMessagePromise("console.log(239)")
- .then(dumpMessage)
+ .then(message => InspectorTest.logMessage(message))
.then(() => addConsoleMessagePromise("var l = console.log;\n l(239)"))
- .then(dumpMessage)
+ .then(message => InspectorTest.logMessage(message))
.then(() => InspectorTest.completeTest());
function addConsoleMessagePromise(expression)
{
- var cb;
- var p = new Promise((resolver) => cb = resolver);
- InspectorTest.eventHandler["Runtime.consoleAPICalled"] = (messageObject) => cb(messageObject);
- InspectorTest.sendCommand("Runtime.evaluate", { expression: expression });
- return p;
-}
-
-function dumpMessage(messageObject)
-{
- var msg = messageObject.params;
- delete msg.executionContextId;
- delete msg.args;
- delete msg.timestamp;
- for (var frame of msg.stackTrace.callFrames)
- frame.scriptId = 0;
- if (!frame.functionName)
- frame.functionName = "(anonymous)";
- if (!frame.url)
- frame.url = "(empty)";
- InspectorTest.logObject(msg);
+ var wait = Protocol.Runtime.onceConsoleAPICalled();
+ Protocol.Runtime.evaluate({ expression: expression });
+ return wait;
}
« 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