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

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

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/Source/devtools/front_end/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index d7953f71171d9d093e3ca034e35011d671f645d9..b67f01d7f5f91b22f1edc76880e3e0f41c913caf 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -318,22 +318,20 @@ 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(inspectorAgentEnableCallback);
+ this._mainTarget.inspectorAgent().enable();
+ InspectorFrontendHost.readyForTest();
- function inspectorAgentEnableCallback()
- {
- console.timeStamp("Main.inspectorAgentEnableCallback");
- InspectorFrontendHost.readyForTest();
- // Asynchronously run the extensions.
- setTimeout(lateInitialization, 0);
- }
+ // Asynchronously run the extensions.
+ setTimeout(lateInitialization, 0);
function lateInitialization()
{
+ console.timeStamp("Main.lateInitialization");
WebInspector.extensionServer.initializeExtensions();
}
},
@@ -611,15 +609,16 @@ WebInspector.Main.prototype = {
},
/**
- * @override
- * @param {number} callId
- * @param {string} script
+ * @param {!WebInspector.Event} event
*/
- evaluateForTestInFrontend: function(callId, script)
+ _evaluateForTestInFrontend: function(event)
{
if (!InspectorFrontendHost.isUnderTest())
return;
+ var callId = /** @type {number} */ (event.data["callId"]);
+ var script = /** @type {number} */ (event.data["script"]);
+
/**
* @suppressGlobalPropertiesCheck
*/

Powered by Google App Engine
This is Rietveld 408576698