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

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

Issue 1170193002: [DevTools] Add uiTest.testSettings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/devtools/front_end/Runtime.js ('k') | Source/devtools/front_end/main/Tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/main/Main.js
diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js
index 36b8226d0a8dfb4e1e636581056627264f91a2b1..2259a263254087dca5f84756faeb93416633b7ae 100644
--- a/Source/devtools/front_end/main/Main.js
+++ b/Source/devtools/front_end/main/Main.js
@@ -37,6 +37,7 @@
WebInspector.Main = function()
{
WebInspector.console.setUIDelegate(this);
+ WebInspector.Main._instance = this;
runOnWindowLoad(this._loaded.bind(this));
}
@@ -50,19 +51,29 @@ WebInspector.Main.prototype = {
return WebInspector.Revealer.revealPromise(WebInspector.console);
},
+ /**
+ * @param {function()} callback
+ */
+ _resetSettingsForTest: function(callback)
pfeldman 2015/06/09 12:24:51 Why is this here?
dgozman 2015/06/09 13:55:35 Moved to test.
+ {
+ Runtime.experiments.clearForTest();
+ InspectorFrontendHost.getPreferences(this._createSettings.bind(this, callback));
+ },
+
_loaded: function()
{
console.timeStamp("Main._loaded");
if (InspectorFrontendHost.isUnderTest())
self.runtime.useTestBase();
- InspectorFrontendHost.getPreferences(this._createSettings.bind(this));
+ InspectorFrontendHost.getPreferences(this._createSettings.bind(this, this._createAppUI.bind(this)));
},
/**
+ * @param {function()} callback
* @param {!Object<string, string>} prefs
*/
- _createSettings: function(prefs)
+ _createSettings: function(callback, prefs)
pfeldman 2015/06/09 12:24:51 This adds indirection.
{
// Patch settings from the URL param (for tests).
var settingsParam = Runtime.queryParam("settings");
@@ -103,7 +114,7 @@ WebInspector.Main.prototype = {
if (!InspectorFrontendHost.isUnderTest())
new WebInspector.VersionController().updateVersion();
- this._createAppUI();
pfeldman 2015/06/09 12:57:34 Just move this line to the call site (extract a tw
dgozman 2015/06/09 13:55:35 Done.
+ callback();
},
/**
« no previous file with comments | « Source/devtools/front_end/Runtime.js ('k') | Source/devtools/front_end/main/Tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698