Skip to content

Commit

Permalink
Revert of [DevTools] Use InspectorFrontendHost.readyForTest for layou…
Browse files Browse the repository at this point in the history
…t 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}

[email protected],[email protected]
# 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}
  • Loading branch information
battre authored and Commit bot committed Mar 24, 2016
1 parent 791c2d1 commit 2c06e0c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
9 changes: 0 additions & 9 deletions front_end/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<!{fileSystemName: string, rootURL: string, fileSystemPath: string}>} fileSystems
*/
Expand Down
2 changes: 0 additions & 2 deletions front_end/host/InspectorFrontendHostAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ InspectorFrontendHostAPI.Events = {
DispatchMessage: "dispatchMessage",
DispatchMessageChunk: "dispatchMessageChunk",
EnterInspectElementMode: "enterInspectElementMode",
EvaluateForTestInFrontend: "evaluateForTestInFrontend",
FileSystemsLoaded: "fileSystemsLoaded",
FileSystemRemoved: "fileSystemRemoved",
FileSystemAdded: "fileSystemAdded",
Expand Down Expand Up @@ -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"]],
Expand Down
23 changes: 12 additions & 11 deletions front_end/main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
},
Expand Down Expand Up @@ -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
*/
Expand Down
7 changes: 7 additions & 0 deletions protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
}
],
"events": [
{
"name": "evaluateForTestInFrontend",
"parameters": [
{ "name": "testCallId", "type": "integer" },
{ "name": "script", "type": "string" }
]
},
{
"name": "inspect",
"parameters": [
Expand Down

0 comments on commit 2c06e0c

Please sign in to comment.