Bug 1296498 - Enable new RDM UI for Nightly. r=ntim draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 26 Sep 2016 15:19:15 -0500
changeset 418578 340b9ab1b7916cb9c81dc8fecafc4703ae4ebe50
parent 417649 c55bcb7c777ea09431b4d16903ed079ae5632648
child 418579 56b9aad69395a4e873e62e1fe74e65732c6f2ce2
child 418612 fa279294bd302a293668e465bc4a0bd4d5a64e1c
child 418631 b08268666c2ad2bc5fb2d11d55bf1d963bdbf0d4
push id30716
push userbmo:jryans@gmail.com
push dateWed, 28 Sep 2016 18:50:57 +0000
reviewersntim
bugs1296498
milestone52.0a1
Bug 1296498 - Enable new RDM UI for Nightly. r=ntim MozReview-Commit-ID: Iiu9tf4o9Df
devtools/client/preferences/devtools.js
devtools/client/responsivedesign/responsivedesign.jsm
devtools/client/responsivedesign/test/head.js
--- 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();