Bug 1553029 - Show WebIDE deprecation message if the new about:debugging is enabled r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 21 May 2019 07:37:48 +0000
changeset 474688 b2b3da42e524731c6f03655451445669a2501c5a
parent 474687 3892b0290dbdf5ff2c1d907876fb79d5db8f6cff
child 474689 754426d70d2870cc8cdb4814f547b4e476648ff9
push id36044
push userrmaries@mozilla.com
push dateTue, 21 May 2019 15:45:34 +0000
treeherdermozilla-central@78571bb1f20e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1553029
milestone69.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 1553029 - Show WebIDE deprecation message if the new about:debugging is enabled r=daisuke Rather than having a separate preference for showing the deprecation message, we should reuse the aboutdebugging new pref Differential Revision: https://phabricator.services.mozilla.com/D31964
devtools/client/webide/content/webide.js
devtools/client/webide/preferences/webide.js
devtools/client/webide/test/head.js
devtools/client/webide/test/test_deprecation_message.html
--- a/devtools/client/webide/content/webide.js
+++ b/devtools/client/webide/content/webide.js
@@ -110,18 +110,19 @@ var UI = {
 
     Services.prefs.setBoolPref("devtools.webide.autoinstallADBExtension", false);
 
     this.setupDeck();
 
     this.contentViewer = window.docShell.contentViewer;
     this.contentViewer.fullZoom = Services.prefs.getCharPref("devtools.webide.zoom");
 
-    // Show a deprecation message to encourage users to open the new Remote Debugging
-    if (Services.prefs.getBoolPref("devtools.webide.showDeprecationMessage", false)) {
+    // 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();
     }
 
     gDevToolsBrowser.isWebIDEInitialized.resolve();
   },
 
   destroy: function() {
     window.removeEventListener("focus", this.onfocus, true);
--- a/devtools/client/webide/preferences/webide.js
+++ b/devtools/client/webide/preferences/webide.js
@@ -6,11 +6,8 @@ pref("devtools.webide.templatesURL", "ht
 pref("devtools.webide.autoinstallADBExtension", true);
 pref("devtools.webide.autoConnectRuntime", true);
 pref("devtools.webide.restoreLastProject", true);
 pref("devtools.webide.enableLocalRuntime", false);
 pref("devtools.webide.lastConnectedRuntime", "");
 pref("devtools.webide.lastSelectedProject", "");
 pref("devtools.webide.zoom", "1");
 pref("devtools.webide.busyTimeout", 10000);
-
-// Show a deprecation message when starting WebIDE.
-pref("devtools.webide.showDeprecationMessage", true);
--- a/devtools/client/webide/test/head.js
+++ b/devtools/client/webide/test/head.js
@@ -30,24 +30,24 @@ var registerCleanupFunction = registerCl
                               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.webide.showDeprecationMessage");
+  Services.prefs.clearUserPref("devtools.aboutdebugging.new-enabled");
 });
 
-var openWebIDE = async function({ autoInstallAddons, showDeprecationMessage } = {}) {
+var openWebIDE = async function({ autoInstallAddons, newAboutDebugging } = {}) {
   info("opening WebIDE");
 
   Services.prefs.setBoolPref("devtools.webide.autoinstallADBExtension", !!autoInstallAddons);
-  Services.prefs.setBoolPref("devtools.webide.showDeprecationMessage", !!showDeprecationMessage);
+  Services.prefs.setBoolPref("devtools.aboutdebugging.new-enabled", !!newAboutDebugging);
 
   const win = Services.ww.openWindow(null, "chrome://webide/content/", "webide",
                                    "chrome,centerscreen,resizable", null);
 
   await new Promise(resolve => {
     win.addEventListener("load", function() {
       SimpleTest.requestCompleteLog();
       SimpleTest.executeSoon(resolve);
--- a/devtools/client/webide/test/test_deprecation_message.html
+++ b/devtools/client/webide/test/test_deprecation_message.html
@@ -14,37 +14,37 @@
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         async function testWithMessageDisabled() {
-          info("Open WebIDE with the showDeprecationMessage preference set to FALSE");
+          info("Open WebIDE with the newAboutDebugging preference set to FALSE");
           const win = await openWebIDE({
-            showDeprecationMessage: false,
+            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 showDeprecationMessage preference set to TRUE");
+          info("Open WebIDE with the newAboutDebugging preference set to TRUE");
           const win = await openWebIDE({
-            showDeprecationMessage: true,
+            newAboutDebugging: true,
           });
 
           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;