| 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 964923de02c6eae259df4d16bad08e4410a096e3..fc3cbd3a0e8771ae6cde90272608ac6041daface 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
|
| @@ -358,61 +358,6 @@ InspectorTest.pageReloaded = function()
|
| callback();
|
| }
|
|
|
| -var lastPromiseEvalId = 0;
|
| -var pendingPromiseEvalRequests = {};
|
| -
|
| -/**
|
| - * The given function should take two callback paraters before the arguments:
|
| - * * resolve - called when successful (with optional result)
|
| - * * reject - called when there was a failure (with optional error)
|
| - */
|
| -InspectorTest.invokePageFunctionPromise = function(functionName, parameters)
|
| -{
|
| - return new Promise(function(resolve, reject) {
|
| - var id = ++lastPromiseEvalId;
|
| - pendingPromiseEvalRequests[id] = { resolve: InspectorTest.safeWrap(resolve), reject: InspectorTest.safeWrap(reject) };
|
| -
|
| - var jsonParameters = [];
|
| - for (var i = 0; i < parameters.length; ++i)
|
| - jsonParameters.push(JSON.stringify(parameters[i]));
|
| - var asyncEvalWrapper = function(callId, functionName, argumentsArray)
|
| - {
|
| - function evalCallbackResolve(result)
|
| - {
|
| - testRunner.evaluateInWebInspector(2, "InspectorTest.didInvokePageFunctionPromise(" + callId + ", " + JSON.stringify(result) + ", true);");
|
| - }
|
| -
|
| - function evalCallbackReject(result)
|
| - {
|
| - testRunner.evaluateInWebInspector(2, "InspectorTest.didInvokePageFunctionPromise(" + callId + ", " + JSON.stringify(result) + ", false);");
|
| - }
|
| -
|
| - var args = [evalCallbackResolve, evalCallbackReject].concat(argumentsArray.map(JSON.stringify));
|
| - var functionCall = functionName + ".call(null, " + args.join(", ") + ")";
|
| - try {
|
| - eval(functionCall);
|
| - } catch(e) {
|
| - InspectorTest.log("Error: " + e);
|
| - evalCallbackReject(e);
|
| - }
|
| - }
|
| - var pageRequest = "(" + asyncEvalWrapper.toString() + ")(" + id + ", unescape('" + escape(functionName) + "'), [" + jsonParameters.join(", ") + "])";
|
| - InspectorTest.evaluateInPage(pageRequest);
|
| - });
|
| -}
|
| -
|
| -InspectorTest.didInvokePageFunctionPromise = function(callId, value, didResolve)
|
| -{
|
| - var callbacks = pendingPromiseEvalRequests[callId];
|
| - if (!callbacks) {
|
| - InspectorTest.log("Missing callback for async eval " + callId + ", perhaps callback invoked twice?");
|
| - return;
|
| - }
|
| - var callback = didResolve ? callbacks.resolve : callbacks.reject;
|
| - delete pendingPromiseEvalRequests[callId];
|
| - callback(value);
|
| -}
|
| -
|
| window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false);
|
|
|
| </script>
|
|
|