Chromium Code Reviews| 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(); |
| }, |
| /** |