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

Unified Diff: test/inspector/runtime/clear-of-command-line-api.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/clear-of-command-line-api.js
diff --git a/test/inspector/runtime/clear-of-command-line-api.js b/test/inspector/runtime/clear-of-command-line-api.js
index 776144c4f0ba3579d6b3bb9efd93cfb2c336a8a5..2af2f4917f3d9721b8f96c36226efa5451a4ef7b 100644
--- a/test/inspector/runtime/clear-of-command-line-api.js
+++ b/test/inspector/runtime/clear-of-command-line-api.js
@@ -4,7 +4,7 @@
print("Tests that CommandLineAPI is presented only while evaluation.");
-InspectorTest.evaluateInPage(
+InspectorTest.addScript(
`
var methods = ["dir","dirxml","profile","profileEnd","clear","table","keys","values","debug","undebug","monitor","unmonitor","inspect","copy"];
var window = this;
@@ -85,10 +85,7 @@ runExpressionAndDumpPresentedMethods("")
function evaluate(expression, includeCommandLineAPI)
{
- var cb;
- var p = new Promise(resolver => cb = resolver);
- InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: expression, objectGroup: "console", includeCommandLineAPI: includeCommandLineAPI }, cb);
- return p;
+ return Protocol.Runtime.evaluate({ expression: expression, objectGroup: "console", includeCommandLineAPI: includeCommandLineAPI });
}
function setLastEvaluationResultTo239()
@@ -101,7 +98,7 @@ function runExpressionAndDumpPresentedMethods(expression)
InspectorTest.log(expression);
return setLastEvaluationResultTo239()
.then(() => evaluate(expression + "; var a = presentedAPIMethods(); a", true))
- .then((result) => InspectorTest.logObject(result));
+ .then((result) => InspectorTest.logMessage(result));
}
function dumpLeftMethods()
@@ -109,12 +106,12 @@ function dumpLeftMethods()
// Should always be zero.
return setLastEvaluationResultTo239()
.then(() => evaluate("presentedAPIMethods()", false))
- .then((result) => InspectorTest.logObject(result));
+ .then((result) => InspectorTest.logMessage(result));
}
function dumpDir()
{
// Should always be presented.
return evaluate("dir", false)
- .then((result) => InspectorTest.logObject(result));
+ .then((result) => InspectorTest.logMessage(result));
}

Powered by Google App Engine
This is Rietveld 408576698