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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js

Issue 2208963002: [DevTools] Removed InspectorTest.invokeFunctionInPageAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-promise-from-other-tests
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
Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
index 230a0128be2e65d525be84614b04a88c0e671465..7524497e30c7fe21381c67b521cf1415fe031b6d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
@@ -126,43 +126,8 @@ InspectorTest.invokeAsyncWithTracing = function(functionName, callback)
function onStart()
{
- InspectorTest.invokePageFunctionAsync(functionName, done);
+ InspectorTest.evaluateInPageAsync(functionName + "()").then((data) => InspectorTest.stopTracing((devtoolsEvents) => callback(devtoolsEvents, data)));
}
-
- function done()
- {
- InspectorTest.stopTracing(callback);
- }
-}
-
-InspectorTest._lastEvalId = 0;
-InspectorTest._pendingEvalRequests = {};
-
-InspectorTest.invokePageFunctionAsync = function(functionName, callback)
-{
- var id = ++InspectorTest._lastEvalId;
- InspectorTest._pendingEvalRequests[id] = callback;
- var asyncEvalWrapper = function(callId, functionName)
- {
- function evalCallback(result)
- {
- evaluateInFrontend("InspectorTest.didInvokePageFunctionAsync(" + callId + ", " + JSON.stringify(result) + ");");
- }
- eval(functionName + "(" + evalCallback + ")");
- }
- InspectorTest.evaluateInPage("(" + asyncEvalWrapper.toString() + ")(" + id + ", unescape('" + escape(functionName) + "'))", function() { });
-}
-
-InspectorTest.didInvokePageFunctionAsync = function(callId, value)
-{
- var callback = InspectorTest._pendingEvalRequests[callId];
-
- if (!callback) {
- InspectorTest.addResult("Missing callback for async eval " + callId + ", perhaps callback invoked twice?");
- return;
- }
- delete InspectorTest._pendingEvalRequests[callId];
- callback(value);
}
}

Powered by Google App Engine
This is Rietveld 408576698