From 2c06e0c7c6b3a2b91139b4466aa6111a18b89468 Mon Sep 17 00:00:00 2001 From: battre Date: Thu, 24 Mar 2016 04:52:23 -0700 Subject: [PATCH] Revert of [DevTools] Use InspectorFrontendHost.readyForTest for layout tests. (patchset #3 id:40001 of https://codereview.chromium.org/1819243002/ ) Reason for revert: http/tests/inspector/resource-tree/resource-tree-reload.html is flaky BUG=597572 Original issue's description: > [DevTools] Use InspectorFrontendHost.readyForTest for layout tests. > > BUG=none > > Committed: https://crrev.com/89f7238cebbf5d77e4caa84d0a2750f6faa7e983 > Cr-Commit-Position: refs/heads/master@{#383015} TBR=pfeldman@chromium.org,dgozman@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=none Review URL: https://codereview.chromium.org/1828983002 Cr-Commit-Position: refs/heads/master@{#383053} --- front_end/devtools.js | 9 --------- front_end/host/InspectorFrontendHostAPI.js | 2 -- front_end/main/Main.js | 23 +++++++++++----------- protocol.json | 7 +++++++ 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/front_end/devtools.js b/front_end/devtools.js index 84325f7a37..e98419de79 100644 --- a/front_end/devtools.js +++ b/front_end/devtools.js @@ -160,15 +160,6 @@ DevToolsAPIImpl.prototype = { this._dispatchOnInspectorFrontendAPI("enterInspectElementMode", []); }, - /** - * @param {number} callId - * @param {string} script - */ - evaluateForTestInFrontend: function(callId, script) - { - this._dispatchOnInspectorFrontendAPI("evaluateForTestInFrontend", [callId, script]); - }, - /** * @param {!Array.} fileSystems */ diff --git a/front_end/host/InspectorFrontendHostAPI.js b/front_end/host/InspectorFrontendHostAPI.js index 98f2717648..79bfed4ba1 100644 --- a/front_end/host/InspectorFrontendHostAPI.js +++ b/front_end/host/InspectorFrontendHostAPI.js @@ -39,7 +39,6 @@ InspectorFrontendHostAPI.Events = { DispatchMessage: "dispatchMessage", DispatchMessageChunk: "dispatchMessageChunk", EnterInspectElementMode: "enterInspectElementMode", - EvaluateForTestInFrontend: "evaluateForTestInFrontend", FileSystemsLoaded: "fileSystemsLoaded", FileSystemRemoved: "fileSystemRemoved", FileSystemAdded: "fileSystemAdded", @@ -70,7 +69,6 @@ InspectorFrontendHostAPI.EventDescriptors = [ [InspectorFrontendHostAPI.Events.DispatchMessage, ["messageObject"]], [InspectorFrontendHostAPI.Events.DispatchMessageChunk, ["messageChunk", "messageSize"]], [InspectorFrontendHostAPI.Events.EnterInspectElementMode, []], - [InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, ["callId", "script"]], [InspectorFrontendHostAPI.Events.FileSystemsLoaded, ["fileSystems"]], [InspectorFrontendHostAPI.Events.FileSystemRemoved, ["fileSystemPath"]], [InspectorFrontendHostAPI.Events.FileSystemAdded, ["errorMessage", "fileSystem"]], diff --git a/front_end/main/Main.js b/front_end/main/Main.js index b67f01d7f5..d7953f7117 100644 --- a/front_end/main/Main.js +++ b/front_end/main/Main.js @@ -318,20 +318,22 @@ WebInspector.Main.prototype = { this._mainTarget.registerInspectorDispatcher(this); InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ReloadInspectedPage, this._reloadInspectedPage, this); - InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, this._evaluateForTestInFrontend, this); if (this._mainTarget.isServiceWorker() || this._mainTarget.isPage()) this._mainTarget.runtimeAgent().run(); - this._mainTarget.inspectorAgent().enable(); - InspectorFrontendHost.readyForTest(); + this._mainTarget.inspectorAgent().enable(inspectorAgentEnableCallback); - // Asynchronously run the extensions. - setTimeout(lateInitialization, 0); + function inspectorAgentEnableCallback() + { + console.timeStamp("Main.inspectorAgentEnableCallback"); + InspectorFrontendHost.readyForTest(); + // Asynchronously run the extensions. + setTimeout(lateInitialization, 0); + } function lateInitialization() { - console.timeStamp("Main.lateInitialization"); WebInspector.extensionServer.initializeExtensions(); } }, @@ -609,16 +611,15 @@ WebInspector.Main.prototype = { }, /** - * @param {!WebInspector.Event} event + * @override + * @param {number} callId + * @param {string} script */ - _evaluateForTestInFrontend: function(event) + evaluateForTestInFrontend: function(callId, script) { if (!InspectorFrontendHost.isUnderTest()) return; - var callId = /** @type {number} */ (event.data["callId"]); - var script = /** @type {number} */ (event.data["script"]); - /** * @suppressGlobalPropertiesCheck */ diff --git a/protocol.json b/protocol.json index 9462985bd0..7fafc5499c 100644 --- a/protocol.json +++ b/protocol.json @@ -16,6 +16,13 @@ } ], "events": [ + { + "name": "evaluateForTestInFrontend", + "parameters": [ + { "name": "testCallId", "type": "integer" }, + { "name": "script", "type": "string" } + ] + }, { "name": "inspect", "parameters": [