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 9d14a2bfff3a8c231bba9bdee4557c3c969d9003..2d1a92aec34b7090d01ec80e8c84fbbf7ca752f8 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 |
@@ -137,6 +137,12 @@ InspectorTest.sendRawCommand = function(command, handler) |
return this._requestId; |
} |
+InspectorTest.readyForTest = function() |
+{ |
+ var embedderMessage = { "id": ++this._embedderRequestId, "method": "readyForTest" }; |
+ DevToolsHost.sendMessageToEmbedder(JSON.stringify(embedderMessage)); |
+} |
+ |
/** |
* @param {string|!Object} messageOrObject |
*/ |
@@ -164,6 +170,20 @@ DevToolsAPI.dispatchMessage = function(messageOrObject) |
} |
/** |
+ * @param {number} callId |
+ * @param {string} script |
+ */ |
+DevToolsAPI.evaluateForTestInFrontend = function(callId, script) |
+{ |
+ try { |
+ eval(script); |
+ } catch (e) { |
+ InspectorTest.log("FAIL: exception in evaluateForTestInFrontend: " + e); |
+ InspectorTest.completeTest(); |
+ } |
+} |
+ |
+/** |
* Logs message to document. |
* @param {string} message |
*/ |
@@ -380,22 +400,7 @@ InspectorTest.didInvokePageFunctionPromise = function(callId, value, didResolve) |
callback(value); |
} |
-InspectorTest.eventHandler["Inspector.evaluateForTestInFrontend"] = function(message) |
-{ |
- try { |
- eval(message.params.script); |
- } catch (e) { |
- InspectorTest.log("FAIL: exception in evaluateForTestInFrontend: " + e); |
- InspectorTest.completeTest(); |
- } |
-}; |
- |
-function enableInspectorAgent() |
-{ |
- InspectorTest.sendCommand("Inspector.enable", { }); |
-} |
- |
-window.addEventListener("load", enableInspectorAgent, false); |
+window.addEventListener("load", InspectorTest.readyForTest.bind(InspectorTest), false); |
</script> |
</head> |