Bug 1539461 - Update extensions tests after removing aboutdebugging.new-enabled pref r=remote-debugging-reviewers,daisuke,rpl
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 16 Jul 2019 16:25:34 +0000
changeset 482963 710e353e8445363e735178a7d40becce588731ef
parent 482962 fa403f52f17f8d02b138829002c8d7dded0af732
child 482964 93ef77eda2f05ded989db1550b661e6e13e9efaa
push id90097
push userjdescottes@mozilla.com
push dateTue, 16 Jul 2019 16:47:03 +0000
treeherderautoland@710e353e8445 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersremote-debugging-reviewers, daisuke, rpl
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 - Update extensions tests after removing aboutdebugging.new-enabled pref r=remote-debugging-reviewers,daisuke,rpl Depends on D37864 Differential Revision: https://phabricator.services.mozilla.com/D37865
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_about_debugging_link.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -42,21 +42,16 @@ XPCOMUtils.defineLazyPreferenceGetter(
   true
 );
 
 XPCOMUtils.defineLazyPreferenceGetter(
   this,
   "useHtmlDiscover",
   "extensions.htmlaboutaddons.discover.enabled"
 );
-XPCOMUtils.defineLazyPreferenceGetter(
-  this,
-  "useNewAboutDebugging",
-  "devtools.aboutdebugging.new-enabled"
-);
 
 const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
 const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
 const PREF_GETADDONS_CACHE_ID_ENABLED =
   "extensions.%ID%.getAddons.cache.enabled";
 const PREF_UI_TYPE_HIDDEN = "extensions.ui.%TYPE%.hidden";
 const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory";
@@ -1172,20 +1167,23 @@ var gViewController = {
     cmd_debugAddons: {
       isEnabled() {
         return true;
       },
       doCommand() {
         let mainWindow = window.windowRoot.ownerGlobal;
         recordLinkTelemetry("about:debugging");
         if ("switchToTabHavingURI" in mainWindow) {
-          let path = useNewAboutDebugging ? "/runtime/this-firefox" : "addons";
-          mainWindow.switchToTabHavingURI(`about:debugging#${path}`, true, {
-            triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
-          });
+          mainWindow.switchToTabHavingURI(
+            `about:debugging#/runtime/this-firefox`,
+            true,
+            {
+              triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
+            }
+          );
         }
       },
     },
 
     cmd_showShortcuts: {
       isEnabled() {
         return true;
       },
--- a/toolkit/mozapps/extensions/test/browser/browser_about_debugging_link.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_about_debugging_link.js
@@ -33,52 +33,41 @@ function waitForRequestsSuccess(store) {
 add_task(async function testAboutDebugging() {
   let win = await open_manager(null);
   let categoryUtilities = new CategoryUtilities(win);
   await categoryUtilities.openType("extension");
 
   let aboutAddonsTab = gBrowser.selectedTab;
   let debugAddonsBtn = win.document.getElementById("utils-debugAddons");
 
-  async function checkUrl(expected, newAboutAddons) {
-    // Set the new about:debugging pref.
-    await SpecialPowers.pushPrefEnv({
-      set: [["devtools.aboutdebugging.new-enabled", newAboutAddons]],
-    });
-
-    // Verify the right URL is loaded.
-    info(`Check about:debugging URL with new: ${newAboutAddons}`);
-    let loaded = BrowserTestUtils.waitForNewTab(gBrowser, expected, true);
-    debugAddonsBtn.doCommand();
-    await loaded;
-    let aboutDebuggingTab = gBrowser.selectedTab;
-
-    if (newAboutAddons) {
-      const { AboutDebugging } = aboutDebuggingTab.linkedBrowser.contentWindow;
-      // Avoid test failures due to closing the about:debugging tab
-      // while it is still initializing.
-      info("Wait until about:debugging actions are finished");
-      await waitForRequestsSuccess(AboutDebugging.store);
-    }
+  // Verify the about:debugging is loaded.
+  info(`Check about:debugging loads`);
+  let loaded = BrowserTestUtils.waitForNewTab(
+    gBrowser,
+    "about:debugging#/runtime/this-firefox",
+    true
+  );
+  debugAddonsBtn.doCommand();
+  await loaded;
+  let aboutDebuggingTab = gBrowser.selectedTab;
 
-    info("Switch back to about:addons");
-    await BrowserTestUtils.switchTab(gBrowser, aboutAddonsTab);
-    is(gBrowser.selectedTab, aboutAddonsTab, "Back to about:addons");
+  const { AboutDebugging } = aboutDebuggingTab.linkedBrowser.contentWindow;
+  // Avoid test failures due to closing the about:debugging tab
+  // while it is still initializing.
+  info("Wait until about:debugging actions are finished");
+  await waitForRequestsSuccess(AboutDebugging.store);
+
+  info("Switch back to about:addons");
+  await BrowserTestUtils.switchTab(gBrowser, aboutAddonsTab);
+  is(gBrowser.selectedTab, aboutAddonsTab, "Back to about:addons");
 
-    info("Re-open about:debugging");
-    let switched = TestUtils.waitForCondition(
-      () => gBrowser.selectedTab == aboutDebuggingTab
-    );
-    debugAddonsBtn.doCommand();
-    await switched;
+  info("Re-open about:debugging");
+  let switched = TestUtils.waitForCondition(
+    () => gBrowser.selectedTab == aboutDebuggingTab
+  );
+  debugAddonsBtn.doCommand();
+  await switched;
 
-    info("Remove the about:debugging tab");
-    BrowserTestUtils.removeTab(aboutDebuggingTab);
-
-    // Reset prefs.
-    await SpecialPowers.popPrefEnv();
-  }
-
-  await checkUrl("about:debugging#/runtime/this-firefox", true);
-  await checkUrl("about:debugging#addons", false);
+  info("Remove the about:debugging tab");
+  BrowserTestUtils.removeTab(aboutDebuggingTab);
 
   await close_manager(win);
 });