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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html

Issue 2207093002: [DevTools] InspectorTest.evaluateInPageAsync uses Runtime.evaluate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 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 | third_party/WebKit/LayoutTests/inspector-protocol/worker/worker-console.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
index 98b96f7b638d971ebb8728b16f095a2283147439..964923de02c6eae259df4d16bad08e4410a096e3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html
@@ -283,28 +283,9 @@ InspectorTest.evaluateInPage = function(string, callback)
});
};
-InspectorTest._asyncCallbacks = {};
-InspectorTest._asyncCallbackId = 0;
-
-InspectorTest.evaluateInPageAsync = function(string, callback)
-{
- var id = ++InspectorTest._asyncCallbackId;
- InspectorTest._asyncCallbacks[id] = callback;
- var callbackString = "testRunner.evaluateInWebInspector.bind(testRunner, 42, \"InspectorTest._evaluateInPageAsyncCompleted(" + id + ")\")";
- var code = string.replace("%callback", callbackString);
- InspectorTest.evaluateInPage(code);
-};
-
-InspectorTest._evaluateInPageAsyncCompleted = function(id)
+InspectorTest.evaluateInPageAsync = function(expression)
{
- var callback = InspectorTest._asyncCallbacks[id];
- delete InspectorTest._asyncCallbacks[id];
- if (!callback) {
- InspectorTest.log("Error: no callback for async function");
- InspectorTest.completeTest();
- return;
- }
- callback();
+ return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression": expression, awaitPromise: true }).then((message) => message.result.result.value);
}
InspectorTest.completeTestIfError = function(messageObject)
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/worker/worker-console.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698