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

Unified Diff: test/inspector/runtime/call-function-on-async.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/call-function-on-async.js
diff --git a/test/inspector/runtime/call-function-on-async.js b/test/inspector/runtime/call-function-on-async.js
index 8cf8977578bc4aa2526cca98d8503336374934c9..4a72bbd40f3b6f4aec1886f16c7a2808b3c91f5a 100644
--- a/test/inspector/runtime/call-function-on-async.js
+++ b/test/inspector/runtime/call-function-on-async.js
@@ -14,7 +14,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ true,
/* generatePreview */ false,
/* awaitPromise */ false)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
},
@@ -27,7 +27,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ false,
/* generatePreview */ false,
/* awaitPromise */ true)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
},
@@ -40,7 +40,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ false,
/* generatePreview */ false,
/* awaitPromise */ true)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
},
@@ -53,7 +53,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ false,
/* generatePreview */ false,
/* awaitPromise */ true)
- .then((result) => InspectorTest.logObject(result.error))
+ .then((result) => InspectorTest.logMessage(result.error))
.then(() => next());
},
@@ -66,7 +66,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ true,
/* generatePreview */ false,
/* awaitPromise */ true)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
},
@@ -79,7 +79,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ false,
/* generatePreview */ true,
/* awaitPromise */ true)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
},
@@ -92,7 +92,7 @@ InspectorTest.runTestSuite([
/* returnByValue */ true,
/* generatePreview */ false,
/* awaitPromise */ true)
- .then((result) => dumpResult(result.result))
+ .then((result) => InspectorTest.logMessage(result))
.then(() => next());
}
]);
@@ -101,14 +101,14 @@ function callFunctionOn(objectExpression, functionDeclaration, argumentExpressio
{
var objectId;
var callArguments = [];
- var promise = InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: objectExpression })
+ var promise = Protocol.Runtime.evaluate({ expression: objectExpression })
.then((result) => objectId = result.result.result.objectId)
for (let argumentExpression of argumentExpressions) {
promise = promise
- .then(() => InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: argumentExpression }))
+ .then(() => Protocol.Runtime.evaluate({ expression: argumentExpression }))
.then((result) => addArgument(result.result.result));
}
- return promise.then(() => InspectorTest.sendCommandPromise("Runtime.callFunctionOn", { objectId: objectId, functionDeclaration: functionDeclaration, arguments: callArguments, returnByValue: returnByValue, generatePreview: generatePreview, awaitPromise: awaitPromise }));
+ return promise.then(() => Protocol.Runtime.callFunctionOn({ objectId: objectId, functionDeclaration: functionDeclaration, arguments: callArguments, returnByValue: returnByValue, generatePreview: generatePreview, awaitPromise: awaitPromise }));
function addArgument(result)
{
@@ -122,21 +122,8 @@ function callFunctionOn(objectExpression, functionDeclaration, argumentExpressio
callArguments.push({});
} else {
InspectorTest.log("Unexpected argument object:");
- InspectorTest.logObject(result);
+ InspectorTest.logMessage(result);
InspectorTest.completeTest();
}
}
}
-
-function dumpResult(result)
-{
- if (result.exceptionDetails && result.exceptionDetails.scriptId)
- result.exceptionDetails.scriptId = 0;
- if (result.result && result.result.objectId)
- result.result.objectId = "[ObjectId]";
- if (result.exceptionDetails) {
- result.exceptionDetails.exceptionId = 0;
- result.exceptionDetails.exception.objectId = 0;
- }
- InspectorTest.logObject(result);
-}
« no previous file with comments | « test/inspector/runtime/await-promise-expected.txt ('k') | test/inspector/runtime/call-function-on-async-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698