Bug 1296498 - Enable new RDM UI for Nightly. r=ntim
MozReview-Commit-ID: Iiu9tf4o9Df
--- a/devtools/client/preferences/devtools.js
+++ b/devtools/client/preferences/devtools.js
@@ -345,11 +345,15 @@ pref("devtools.telemetry.tools.opened.ve
// Enable the JSON View tool (an inspector for application/json documents) on
// Nightly and Dev. Edition.
#ifdef RELEASE_BUILD
pref("devtools.jsonview.enabled", false);
#else
pref("devtools.jsonview.enabled", true);
#endif
-// Disable the HTML responsive design tool by default. Currently disabled until
-// ready to replace the legacy XUL version.
+// Enable the HTML responsive design tool in Nightly only. Disabled by default for all
+// other channels.
+#ifdef NIGHTLY_BUILD
+pref("devtools.responsive.html.enabled", true);
+#else
pref("devtools.responsive.html.enabled", false);
+#endif
--- a/devtools/client/responsivedesign/responsivedesign.jsm
+++ b/devtools/client/responsivedesign/responsivedesign.jsm
@@ -126,20 +126,22 @@ var Manager = {
this.toggle(aWindow, aTab);
default:
}
})
};
EventEmitter.decorate(Manager);
-// If the experimental HTML UI is enabled, delegate the ResponsiveUIManager API
-// over to that tool instead. Performing this delegation here allows us to
-// contain the pref check to a single place.
-if (Services.prefs.getBoolPref("devtools.responsive.html.enabled")) {
+// If the new HTML RDM UI is enabled and e10s is enabled by default (e10s is required for
+// the new HTML RDM UI to function), delegate the ResponsiveUIManager API over to that
+// tool instead. Performing this delegation here allows us to contain the pref check to a
+// single place.
+if (Services.prefs.getBoolPref("devtools.responsive.html.enabled") &&
+ Services.appinfo.browserTabsRemoteAutostart) {
let { ResponsiveUIManager } =
require("devtools/client/responsive.html/manager");
this.ResponsiveUIManager = ResponsiveUIManager;
} else {
this.ResponsiveUIManager = Manager;
}
var defaultPresets = [
--- a/devtools/client/responsivedesign/test/head.js
+++ b/devtools/client/responsivedesign/test/head.js
@@ -8,18 +8,21 @@ let testDir = gTestPath.substr(0, gTestP
let sharedHeadURI = testDir + "../../../framework/test/shared-head.js";
Services.scriptloader.loadSubScript(sharedHeadURI, this);
// Import the GCLI test helper
let gcliHelpersURI = testDir + "../../../commandline/test/helpers.js";
Services.scriptloader.loadSubScript(gcliHelpersURI, this);
flags.testing = true;
+Services.prefs.setBoolPref("devtools.responsive.html.enabled", false);
+
registerCleanupFunction(() => {
flags.testing = false;
+ Services.prefs.clearUserPref("devtools.responsive.html.enabled");
Services.prefs.clearUserPref("devtools.responsiveUI.currentPreset");
Services.prefs.clearUserPref("devtools.responsiveUI.customHeight");
Services.prefs.clearUserPref("devtools.responsiveUI.customWidth");
Services.prefs.clearUserPref("devtools.responsiveUI.presets");
Services.prefs.clearUserPref("devtools.responsiveUI.rotate");
});
SimpleTest.requestCompleteLog();