From f1fcf6094fd987214cbdeb669b392c3d5ea19462 Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Tue, 16 Jul 2019 16:24:14 +0000 Subject: [PATCH] Bug 1539461 - Remove the aboutdebugging.new-enabled preference r=remote-debugging-reviewers,daisuke Depends on D37860 Differential Revision: https://phabricator.services.mozilla.com/D37863 --HG-- extra : moz-landing-system : lando --- devtools/client/aboutdebugging-new/README.md | 4 +-- .../aboutdebugging-new/test/browser/head.js | 9 ------ devtools/client/menus.js | 23 +++++--------- .../client/preferences/devtools-client.js | 3 -- devtools/client/webide/content/webide.js | 9 ++---- devtools/client/webide/test/head.js | 7 +---- .../webide/test/test_deprecation_message.html | 31 ++----------------- .../startup/AboutDebuggingRegistration.jsm | 16 +++------- 8 files changed, 21 insertions(+), 81 deletions(-) diff --git a/devtools/client/aboutdebugging-new/README.md b/devtools/client/aboutdebugging-new/README.md index 401237b3edda..fd64f6ac467b 100644 --- a/devtools/client/aboutdebugging-new/README.md +++ b/devtools/client/aboutdebugging-new/README.md @@ -3,7 +3,7 @@ ## 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 @@ -16,7 +16,7 @@ The about:debugging-new UI is built using React and Redux. The various React/Red 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. diff --git a/devtools/client/aboutdebugging-new/test/browser/head.js b/devtools/client/aboutdebugging-new/test/browser/head.js index 73aa03b76f50..c7f926b7cf62 100644 --- a/devtools/client/aboutdebugging-new/test/browser/head.js +++ b/devtools/client/aboutdebugging-new/test/browser/head.js @@ -39,13 +39,6 @@ registerCleanupFunction(async function() { 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, @@ -61,8 +54,6 @@ async function openAboutDebugging({ enableLocalTabs ); - await enableNewAboutDebugging(); - info("opening about:debugging"); const tab = await addTab("about:debugging"); diff --git a/devtools/client/menus.js b/devtools/client/menus.js index b2796153acd6..e996f589681f 100644 --- a/devtools/client/menus.js +++ b/devtools/client/menus.js @@ -26,7 +26,6 @@ */ const { Cu } = require("chrome"); -const Services = require("Services"); loader.lazyRequireGetter( this, @@ -69,19 +68,6 @@ loader.lazyImporter( "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", @@ -98,7 +84,14 @@ exports.menuitems = [ 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", diff --git a/devtools/client/preferences/devtools-client.js b/devtools/client/preferences/devtools-client.js index ce3df222455e..d8ed76e09170 100644 --- a/devtools/client/preferences/devtools-client.js +++ b/devtools/client/preferences/devtools-client.js @@ -357,9 +357,6 @@ pref("devtools.responsive.showUserAgentInput", true); 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); diff --git a/devtools/client/webide/content/webide.js b/devtools/client/webide/content/webide.js index fdfadfc2c1df..d42f39cbd491 100644 --- a/devtools/client/webide/content/webide.js +++ b/devtools/client/webide/content/webide.js @@ -148,13 +148,8 @@ var UI = { "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(); }, diff --git a/devtools/client/webide/test/head.js b/devtools/client/webide/test/head.js index da455947d1b3..b656609a0bae 100644 --- a/devtools/client/webide/test/head.js +++ b/devtools/client/webide/test/head.js @@ -47,20 +47,15 @@ registerCleanupFunction(() => { 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, diff --git a/devtools/client/webide/test/test_deprecation_message.html b/devtools/client/webide/test/test_deprecation_message.html index 05f4efe8e570..d0d9b252fd0e 100644 --- a/devtools/client/webide/test/test_deprecation_message.html +++ b/devtools/client/webide/test/test_deprecation_message.html @@ -18,29 +18,9 @@ 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; @@ -69,11 +49,6 @@ await removeTab(mainWindow.gBrowser.selectedTab, mainWindow); await closeWebIDE(win); - } - - (async function() { - await testWithMessageDisabled(); - await testWithMessageEnabled(); SimpleTest.finish(); })(); diff --git a/devtools/startup/AboutDebuggingRegistration.jsm b/devtools/startup/AboutDebuggingRegistration.jsm index c52d1cb9c95b..362451de1e96 100644 --- a/devtools/startup/AboutDebuggingRegistration.jsm +++ b/devtools/startup/AboutDebuggingRegistration.jsm @@ -4,10 +4,8 @@ "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; @@ -22,14 +20,10 @@ AboutDebugging.prototype = { 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();