Bug 1539461 - Remove the aboutdebugging.new-enabled preference r=remote-debugging-reviewers,daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 16 Jul 2019 16:24:14 +0000
changeset 482952 e7b380a94ec877db5e792a94991455505be3bab2
parent 482951 124a38ea2ab287d0a8e7d52ada945ee5a91cff9b
child 482953 fa403f52f17f8d02b138829002c8d7dded0af732
push id36303
push userdvarga@mozilla.com
push dateWed, 17 Jul 2019 09:36:40 +0000
treeherdermozilla-central@29e9dde37bd2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-debugging-reviewers, daisuke
bugs1539461
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539461 - Remove the aboutdebugging.new-enabled preference r=remote-debugging-reviewers,daisuke Depends on D37860 Differential Revision: https://phabricator.services.mozilla.com/D37863
devtools/client/aboutdebugging-new/README.md
devtools/client/aboutdebugging-new/test/browser/head.js
devtools/client/menus.js
devtools/client/preferences/devtools-client.js
devtools/client/webide/content/webide.js
devtools/client/webide/test/head.js
devtools/client/webide/test/test_deprecation_message.html
devtools/startup/AboutDebuggingRegistration.jsm
--- a/devtools/client/aboutdebugging-new/README.md
+++ b/devtools/client/aboutdebugging-new/README.md
@@ -1,27 +1,27 @@
 # about:debugging-new
 
 ## What is about:debugging-new
 The purpose of about:debugging is to be a debugging hub to start inspecting your addons, processes, tabs and workers. This new version of about:debugging will also allow you to debug remote devices (Firefox for Android on a smartphone). The user should be able to connect either via USB or WiFi. This solution is supposed to replace the various existing remote debugging solutions available in Firefox DevTools, WebIDE and the Connect page.
 
-To try about:debugging-new, the preference `devtools.aboutdebugging.new-enabled` needs to be set to true in `about:config`. After that, the UI is available by typing `about:debugging` in the Firefox URL bar.
+To try out about:debugging, type `about:debugging` in the Firefox URL bar.
 
 ## Technical overview
 
 The about:debugging-new UI is built using React and Redux. The various React/Redux files should be organized as follows:
 - devtools/client/aboutdebugging-new/src/actions
 - devtools/client/aboutdebugging-new/src/components
 - devtools/client/aboutdebugging-new/src/middleware
 - devtools/client/aboutdebugging-new/src/reducers
 
 The folder `devtools/client/aboutdebugging-new/src/modules` contains various helpers and classes that are not related to React/Redux. For instance modules/usb-runtimes.js provides an abstraction layer to enable USB runtimes scanning, to list USB runtimes etc...
 
 ### Firefox Component Registration
-about:debugging-new is an "about" page registered via a component manifest that is located in `/devtools/startup/aboutdebugging.manifest`. The component registration code is at `/devtools/startup/aboutdebugging-registration.js` and mostly contains the logic to switch between the old and the new about:debugging UI, based on the value of the preference `devtools.aboutdebugging.new-enabled`.
+about:debugging-new is an "about" page registered via a component manifest that is located in `/devtools/startup/aboutdebugging.manifest`. The component registration code is at `/devtools/startup/aboutdebugging-registration.js`.
 
 ### Actions
 Actions should cover all user or external events that change the UI.
 
 #### asynchronous actions
 For asynchronous actions, we will use the thunk middleware, similar to what it done in the webconsole and netmonitor. An asynchronous action should be split in three actions:
 - start
 - success
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -34,40 +34,31 @@ registerCleanupFunction(async function()
   await adbProcess.kill();
 
   const {
     remoteClientManager,
   } = require("devtools/client/shared/remote-debugging/remote-client-manager");
   await remoteClientManager.removeAllClients();
 });
 
-/**
- * Enable the new about:debugging panel.
- */
-async function enableNewAboutDebugging() {
-  await pushPref("devtools.aboutdebugging.new-enabled", true);
-}
-
 async function openAboutDebugging({
   enableWorkerUpdates,
   enableLocalTabs = true,
 } = {}) {
   if (!enableWorkerUpdates) {
     silenceWorkerUpdates();
   }
 
   // This preference changes value depending on the build type, tests need to use a
   // consistent value regarless of the build used.
   await pushPref(
     "devtools.aboutdebugging.local-tab-debugging",
     enableLocalTabs
   );
 
-  await enableNewAboutDebugging();
-
   info("opening about:debugging");
 
   const tab = await addTab("about:debugging");
   const browser = tab.linkedBrowser;
   const document = browser.contentDocument;
   const window = browser.contentWindow;
 
   info("Wait until Connect page is displayed");
--- a/devtools/client/menus.js
+++ b/devtools/client/menus.js
@@ -21,17 +21,16 @@
  *   Helps figuring out the DOM id for the related <xul:key>
  *   in order to have the key text displayed in menus.
  * - checkbox:
  *   If true, the menuitem is prefixed by a checkbox and runtime code can
  *   toggle it.
  */
 
 const { Cu } = require("chrome");
-const Services = require("Services");
 
 loader.lazyRequireGetter(
   this,
   "gDevToolsBrowser",
   "devtools/client/framework/devtools-browser",
   true
 );
 loader.lazyRequireGetter(
@@ -64,46 +63,40 @@ loader.lazyImporter(
   "resource://devtools/client/scratchpad/scratchpad-manager.jsm"
 );
 loader.lazyImporter(
   this,
   "ProfilerMenuButton",
   "resource://devtools/client/performance-new/popup/menu-button.jsm"
 );
 
-const isAboutDebuggingEnabled = Services.prefs.getBoolPref(
-  "devtools.aboutdebugging.new-enabled",
-  false
-);
-const aboutDebuggingItem = {
-  id: "menu_devtools_remotedebugging",
-  l10nKey: "devtoolsRemoteDebugging",
-  oncommand(event) {
-    const window = event.target.ownerDocument.defaultView;
-    gDevToolsBrowser.openAboutDebugging(window.gBrowser);
-  },
-};
-
 exports.menuitems = [
   {
     id: "menu_devToolbox",
     l10nKey: "devToolboxMenuItem",
     async oncommand(event) {
       try {
         const window = event.target.ownerDocument.defaultView;
         await gDevToolsBrowser.toggleToolboxCommand(window.gBrowser, Cu.now());
       } catch (e) {
         console.error(`Exception while opening the toolbox: ${e}\n${e.stack}`);
       }
     },
     keyId: "toggleToolbox",
     checkbox: true,
   },
   { id: "menu_devtools_separator", separator: true },
-  ...(isAboutDebuggingEnabled ? [aboutDebuggingItem] : []),
+  {
+    id: "menu_devtools_remotedebugging",
+    l10nKey: "devtoolsRemoteDebugging",
+    oncommand(event) {
+      const window = event.target.ownerDocument.defaultView;
+      gDevToolsBrowser.openAboutDebugging(window.gBrowser);
+    },
+  },
   {
     id: "menu_webide",
     l10nKey: "webide",
     oncommand() {
       gDevToolsBrowser.openWebIDE();
     },
     keyId: "webide",
   },
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -352,19 +352,16 @@ pref("devtools.responsive.show-setting-t
 #endif
 // Show the custom user agent input in Nightly builds.
 #if defined(NIGHTLY_BUILD)
 pref("devtools.responsive.showUserAgentInput", true);
 #else
 pref("devtools.responsive.showUserAgentInput", false);
 #endif
 
-// Enable new about:debugging.
-pref("devtools.aboutdebugging.new-enabled", true);
-
 // Show tab debug targets for This Firefox (on by default for local builds).
 #ifdef MOZILLA_OFFICIAL
   pref("devtools.aboutdebugging.local-tab-debugging", false);
 #else
   pref("devtools.aboutdebugging.local-tab-debugging", true);
 #endif
 
 // Show process debug targets.
--- a/devtools/client/webide/content/webide.js
+++ b/devtools/client/webide/content/webide.js
@@ -143,23 +143,18 @@ var UI = {
 
     this.setupDeck();
 
     this.contentViewer = window.docShell.contentViewer;
     this.contentViewer.fullZoom = Services.prefs.getCharPref(
       "devtools.webide.zoom"
     );
 
-    // If the new about:debugging is enabled, show a deprecation message to encourage
-    // users to open the new Remote Debugging
-    if (
-      Services.prefs.getBoolPref("devtools.aboutdebugging.new-enabled", false)
-    ) {
-      this.showDeprecationMessage();
-    }
+    // Show the deprecation message to encourage users to open the new Remote Debugging
+    this.showDeprecationMessage();
 
     gDevToolsBrowser.isWebIDEInitialized.resolve();
   },
 
   destroy: function() {
     window.removeEventListener("focus", this.onfocus, true);
     AppManager.off("app-manager-update", this.appManagerUpdate);
     AppManager.destroy();
--- a/devtools/client/webide/test/head.js
+++ b/devtools/client/webide/test/head.js
@@ -42,30 +42,25 @@ var registerCleanupFunction =
   registerCleanupFunction || SimpleTest.registerCleanupFunction;
 registerCleanupFunction(() => {
   Services.prefs.clearUserPref("devtools.webide.enabled");
   Services.prefs.clearUserPref("devtools.webide.enableLocalRuntime");
   Services.prefs.clearUserPref("devtools.webide.autoinstallADBExtension");
   Services.prefs.clearUserPref("devtools.webide.busyTimeout");
   Services.prefs.clearUserPref("devtools.webide.lastSelectedProject");
   Services.prefs.clearUserPref("devtools.webide.lastConnectedRuntime");
-  Services.prefs.clearUserPref("devtools.aboutdebugging.new-enabled");
 });
 
-var openWebIDE = async function({ autoInstallAddons, newAboutDebugging } = {}) {
+var openWebIDE = async function({ autoInstallAddons } = {}) {
   info("opening WebIDE");
 
   Services.prefs.setBoolPref(
     "devtools.webide.autoinstallADBExtension",
     !!autoInstallAddons
   );
-  Services.prefs.setBoolPref(
-    "devtools.aboutdebugging.new-enabled",
-    !!newAboutDebugging
-  );
 
   const win = Services.ww.openWindow(
     null,
     "chrome://webide/content/",
     "webide",
     "chrome,centerscreen,resizable",
     null
   );
--- a/devtools/client/webide/test/test_deprecation_message.html
+++ b/devtools/client/webide/test/test_deprecation_message.html
@@ -13,39 +13,19 @@
   </head>
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
-        async function testWithMessageDisabled() {
-          info("Open WebIDE with the newAboutDebugging preference set to FALSE");
-          const win = await openWebIDE({
-            newAboutDebugging: false,
-          });
-
-          const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
-          await gDevToolsBrowser.isWebIDEInitialized.promise;
-          ok(true, "WebIDE was initialized");
-
-          info("Check if the deprecation message is hidden");
-          const nbox = win.UI.deprecationBox;
-          const deprecationMessage = nbox.getNotificationWithValue("webide:deprecationnotification");
-          ok(!deprecationMessage, "The deprecation message is hidden");
-
-          await closeWebIDE(win);
-        }
-
-        async function testWithMessageEnabled() {
-          info("Open WebIDE with the newAboutDebugging preference set to TRUE");
-          const win = await openWebIDE({
-            newAboutDebugging: true,
-          });
+        (async function() {
+          info("Open WebIDE");
+          const win = await openWebIDE();
 
           const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
           await gDevToolsBrowser.isWebIDEInitialized.promise;
           ok(true, "WebIDE was initialized");
 
           info("Check if the deprecation message is displayed");
           const nbox = win.UI.deprecationBox;
           const deprecationMessage = nbox.getNotificationWithValue("webide:deprecationnotification");
@@ -64,20 +44,15 @@
             const contentWindow = mainWindow.gBrowser.selectedBrowser.contentWindow;
             return contentWindow.location.href.startsWith("about:debugging");
           });
 
           info("Remove the about:debugging tab");
           await removeTab(mainWindow.gBrowser.selectedTab, mainWindow);
 
           await closeWebIDE(win);
-        }
-
-        (async function() {
-          await testWithMessageDisabled();
-          await testWithMessageEnabled();
 
           SimpleTest.finish();
         })();
       };
     </script>
   </body>
 </html>
\ No newline at end of file
--- a/devtools/startup/AboutDebuggingRegistration.jsm
+++ b/devtools/startup/AboutDebuggingRegistration.jsm
@@ -1,40 +1,34 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-// Register the about:debugging URL, that allows to debug various targets such as addons,
-// workers and tabs by launching a dedicated DevTools toolbox for the selected target.
-// If DevTools are not installed, this about page will display a shim landing page
-// encouraging the user to download and install DevTools.
+// Register the about:debugging URL, that allows to debug tabs, extensions, workers on
+// the current instance of Firefox or on a remote Firefox.
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDebugging() {}
 
 AboutDebugging.prototype = {
   classDescription: "about:debugging",
   classID: Components.ID("1060afaf-dc9e-43da-8646-23a2faf48493"),
   contractID: "@mozilla.org/network/protocol/about;1?what=debugging",
 
   QueryInterface: ChromeUtils.generateQI([nsIAboutModule]),
 
   newChannel: function(_, loadInfo) {
-    const uri = Services.prefs.getBoolPref(
-      "devtools.aboutdebugging.new-enabled"
-    )
-      ? "chrome://devtools/content/aboutdebugging-new/index.html"
-      : "chrome://devtools/content/aboutdebugging/aboutdebugging.xhtml";
-
     const chan = Services.io.newChannelFromURIWithLoadInfo(
-      Services.io.newURI(uri),
+      Services.io.newURI(
+        "chrome://devtools/content/aboutdebugging-new/index.html"
+      ),
       loadInfo
     );
     chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;