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

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

Issue 2522613003: DevTools: respect isUnderTest conditions in the browser tests. (Closed)
Patch Set: Created 4 years, 1 month 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 261dddbc9433ed6dd9053c57667336e6d13947b7..8dd3dee20ca08e4c546f44c005e1b3b878a89f09 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -51,9 +51,6 @@ Main.Main = class {
_loaded() {
console.timeStamp('Main._loaded');
-
- if (InspectorFrontendHost.isUnderTest())
- self.runtime.useTestBase();
Runtime.setPlatform(Host.platform());
InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
}
@@ -63,6 +60,8 @@ Main.Main = class {
*/
_gotPreferences(prefs) {
console.timeStamp('Main._gotPreferences');
+ if (Host.isUnderTest(prefs))
+ self.runtime.useTestBase();
this._createSettings(prefs);
this._createAppUI();
}
@@ -78,7 +77,7 @@ Main.Main = class {
storagePrefix = '__custom__';
else if (
!Runtime.queryParam('can_dock') && !!Runtime.queryParam('debugFrontend') &&
- !InspectorFrontendHost.isUnderTest())
+ !Host.isUnderTest(prefs))
storagePrefix = '__bundled__';
var clearLocalStorage = window.localStorage ? window.localStorage.clear.bind(window.localStorage) : undefined;
var localStorage =
@@ -87,8 +86,7 @@ Main.Main = class {
prefs, InspectorFrontendHost.setPreference, InspectorFrontendHost.removePreference,
InspectorFrontendHost.clearPreferences, storagePrefix);
Common.settings = new Common.Settings(globalStorage, localStorage);
-
- if (!InspectorFrontendHost.isUnderTest())
+ if (!Host.isUnderTest(prefs))
new Common.VersionController().updateVersion();
}
@@ -129,7 +127,7 @@ Main.Main = class {
Runtime.experiments.cleanUpStaleExperiments();
- if (InspectorFrontendHost.isUnderTest()) {
+ if (Host.isUnderTest(prefs)) {
var testPath = JSON.parse(prefs['testPath'] || '""');
// Enable experiments for testing.
if (testPath.indexOf('layers/') !== -1)

Powered by Google App Engine
This is Rietveld 408576698