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

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

Issue 1819243002: [DevTools] Use InspectorFrontendHost.readyForTest for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ready-for-test
Patch Set: resource-tree-reload.html fix Created 4 years, 9 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/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>

Powered by Google App Engine
This is Rietveld 408576698