Bug 1359203 Part 1 Replace AddonConstants with AddonSettings draft
authorAndrew Swan <aswan@mozilla.com>
Mon, 15 May 2017 22:03:41 -0700
changeset 581371 a589b98517d5fc6fe1704f752a7eb2984d18b3ac
parent 577862 0f4df67c5f162e00d6f52825badf468aefbfba19
child 581372 510bb3d21711c04700b250e484b616a2a1d552ec
push id59850
push useraswan@mozilla.com
push dateFri, 19 May 2017 19:08:41 +0000
bugs1359203
milestone55.0a1
Bug 1359203 Part 1 Replace AddonConstants with AddonSettings AddonConstants duplicated AppConstants, but having it just include the build-time constants meant that the logic for whether to enforce signing was repeated in a few places (and it was incorrect in the front-end code!). Now we centralize that logic in AddonSettings.jsm MozReview-Commit-ID: 2f4x9fnUpPs
browser/base/content/test/general/browser_bug553455.js
toolkit/modules/AppConstants.jsm
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/internal/AddonConstants.jsm
toolkit/mozapps/extensions/internal/AddonSettings.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/internal/moz.build
toolkit/mozapps/extensions/test/browser/browser_details.js
toolkit/mozapps/extensions/test/browser/browser_list.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_install.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -4,17 +4,17 @@
 
 const TESTROOT = "http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const TESTROOT2 = "http://example.org/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const SECUREROOT = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
 const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
 const PROGRESS_NOTIFICATION = "addon-progress";
 
-const { REQUIRE_SIGNING } = Cu.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+Cu.import("resource://gre/modules/AppConstants.jsm");
 
 var rootDir = getRootDirectory(gTestPath);
 var rootPath = rootDir.split("/");
 var chromeName = rootPath[0] + "//" + rootPath[2];
 var croot = chromeName + "/content/browser/toolkit/mozapps/extensions/test/xpinstall/";
 var jar = getJar(croot);
 if (jar) {
   var tmpdir = extractJarToTmp(jar);
@@ -33,157 +33,151 @@ function getObserverTopic(aNotificationI
     topic = "addon-install-started";
   else if (topic == "addon-install-restart")
     topic = "addon-install-complete";
   else if (topic == "addon-installed")
     topic = "webextension-install-notify";
   return topic;
 }
 
-function waitForProgressNotification(aPanelOpen = false, aExpectedCount = 1) {
-  return (async function() {
-    let notificationId = PROGRESS_NOTIFICATION;
-    info("Waiting for " + notificationId + " notification");
+async function waitForProgressNotification(aPanelOpen = false, aExpectedCount = 1) {
+  let notificationId = PROGRESS_NOTIFICATION;
+  info("Waiting for " + notificationId + " notification");
 
-    let topic = getObserverTopic(notificationId);
+  let topic = getObserverTopic(notificationId);
 
-    let observerPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-        // Ignore the progress notification unless that is the notification we want
-        if (notificationId != PROGRESS_NOTIFICATION &&
-            aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
-          return;
-        }
-        Services.obs.removeObserver(observer, topic);
-        resolve();
-      }, topic);
-    });
+  let observerPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+      // Ignore the progress notification unless that is the notification we want
+      if (notificationId != PROGRESS_NOTIFICATION &&
+          aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
+            return;
+      }
+      Services.obs.removeObserver(observer, topic);
+      resolve();
+    }, topic);
+  });
 
-    let panelEventPromise;
-    if (aPanelOpen) {
-      panelEventPromise = Promise.resolve();
-    } else {
-      panelEventPromise = new Promise(resolve => {
-        PopupNotifications.panel.addEventListener("popupshowing", function() {
-          resolve();
-        }, {once: true});
-      });
-    }
-
-    await observerPromise;
-    await panelEventPromise;
+  let panelEventPromise;
+  if (aPanelOpen) {
+    panelEventPromise = Promise.resolve();
+  } else {
+    panelEventPromise = new Promise(resolve => {
+      PopupNotifications.panel.addEventListener("popupshowing", function() {
+        resolve();
+      }, {once: true});
+    });
+  }
 
-    info("Saw a notification");
-    ok(PopupNotifications.isPanelOpen, "Panel should be open");
-    is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
-    if (PopupNotifications.panel.childNodes.length) {
-      let nodes = Array.from(PopupNotifications.panel.childNodes);
-      let notification = nodes.find(n => n.id == notificationId + "-notification");
-      ok(notification, `Should have seen the right notification`);
-      ok(notification.button.hasAttribute("disabled"),
-         "The install button should be disabled");
-    }
+  await observerPromise;
+  await panelEventPromise;
 
-    return PopupNotifications.panel;
-  })();
+  info("Saw a notification");
+  ok(PopupNotifications.isPanelOpen, "Panel should be open");
+  is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
+  if (PopupNotifications.panel.childNodes.length) {
+    let nodes = Array.from(PopupNotifications.panel.childNodes);
+    let notification = nodes.find(n => n.id == notificationId + "-notification");
+    ok(notification, `Should have seen the right notification`);
+    ok(notification.button.hasAttribute("disabled"),
+       "The install button should be disabled");
+  }
+
+  return PopupNotifications.panel;
 }
 
-function waitForNotification(aId, aExpectedCount = 1) {
-  return (async function() {
-    info("Waiting for " + aId + " notification");
+async function waitForNotification(aId, aExpectedCount = 1) {
+  info("Waiting for " + aId + " notification");
 
-    let topic = getObserverTopic(aId);
+  let topic = getObserverTopic(aId);
 
-    let observerPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-        // Ignore the progress notification unless that is the notification we want
-        if (aId != PROGRESS_NOTIFICATION &&
-            aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
-          return;
-        }
-        Services.obs.removeObserver(observer, topic);
-        resolve();
-      }, topic);
-    });
+  let observerPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+      // Ignore the progress notification unless that is the notification we want
+      if (aId != PROGRESS_NOTIFICATION &&
+          aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
+            return;
+      }
+      Services.obs.removeObserver(observer, topic);
+      resolve();
+    }, topic);
+  });
 
-    let panelEventPromise = new Promise(resolve => {
-      PopupNotifications.panel.addEventListener("PanelUpdated", function eventListener(e) {
-        // Skip notifications that are not the one that we are supposed to be looking for
-        if (e.detail.indexOf(aId) == -1) {
-          return;
-        }
-        PopupNotifications.panel.removeEventListener("PanelUpdated", eventListener);
-        resolve();
-      });
+  let panelEventPromise = new Promise(resolve => {
+    PopupNotifications.panel.addEventListener("PanelUpdated", function eventListener(e) {
+      // Skip notifications that are not the one that we are supposed to be looking for
+      if (e.detail.indexOf(aId) == -1) {
+        return;
+      }
+      PopupNotifications.panel.removeEventListener("PanelUpdated", eventListener);
+      resolve();
     });
+  });
 
-    await observerPromise;
-    await panelEventPromise;
+  await observerPromise;
+  await panelEventPromise;
 
-    info("Saw a " + aId + " notification");
-    ok(PopupNotifications.isPanelOpen, "Panel should be open");
-    is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
-    if (PopupNotifications.panel.childNodes.length) {
-      let nodes = Array.from(PopupNotifications.panel.childNodes);
-      let notification = nodes.find(n => n.id == aId + "-notification");
-      ok(notification, "Should have seen the " + aId + " notification");
-    }
+  info("Saw a " + aId + " notification");
+  ok(PopupNotifications.isPanelOpen, "Panel should be open");
+  is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
+  if (PopupNotifications.panel.childNodes.length) {
+    let nodes = Array.from(PopupNotifications.panel.childNodes);
+    let notification = nodes.find(n => n.id == aId + "-notification");
+    ok(notification, "Should have seen the " + aId + " notification");
+  }
 
-    return PopupNotifications.panel;
-  })();
+  return PopupNotifications.panel;
 }
 
 function waitForNotificationClose() {
   return new Promise(resolve => {
     info("Waiting for notification to close");
     PopupNotifications.panel.addEventListener("popuphidden", function() {
       resolve();
     }, {once: true});
   });
 }
 
-function waitForInstallDialog() {
-  return (async function() {
-    if (Preferences.get("xpinstall.customConfirmationUI", false)) {
-      let panel = await waitForNotification("addon-install-confirmation");
-      return panel.childNodes[0];
-    }
+async function waitForInstallDialog() {
+  if (Preferences.get("xpinstall.customConfirmationUI", false)) {
+    let panel = await waitForNotification("addon-install-confirmation");
+    return panel.childNodes[0];
+  }
 
-    info("Waiting for install dialog");
+  info("Waiting for install dialog");
 
-    let window = await new Promise(resolve => {
-      Services.wm.addListener({
-        onOpenWindow(aXULWindow) {
-          Services.wm.removeListener(this);
-          resolve(aXULWindow);
-        },
-        onCloseWindow(aXULWindow) {
-        },
-        onWindowTitleChange(aXULWindow, aNewTitle) {
-        }
-      });
+  let window = await new Promise(resolve => {
+    Services.wm.addListener({
+      onOpenWindow(aXULWindow) {
+        Services.wm.removeListener(this);
+        resolve(aXULWindow);
+      },
+      onCloseWindow(aXULWindow) {
+      },
+      onWindowTitleChange(aXULWindow, aNewTitle) {
+      }
     });
-    info("Install dialog opened, waiting for focus");
+  });
+  info("Install dialog opened, waiting for focus");
 
-    let domwindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIDOMWindow);
-    await new Promise(resolve => {
-      waitForFocus(function() {
-        resolve();
-      }, domwindow);
-    });
-    info("Saw install dialog");
-    is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
+  let domwindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
+                        .getInterface(Ci.nsIDOMWindow);
+  await new Promise(resolve => {
+    waitForFocus(function() {
+      resolve();
+    }, domwindow);
+  });
+  info("Saw install dialog");
+  is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
 
-    // Override the countdown timer on the accept button
-    let button = domwindow.document.documentElement.getButton("accept");
-    button.disabled = false;
+  // Override the countdown timer on the accept button
+  let button = domwindow.document.documentElement.getButton("accept");
+  button.disabled = false;
 
-    return null;
-  })();
+  return null;
 }
 
 function removeTab() {
   return Promise.all([
     waitForNotificationClose(),
     BrowserTestUtils.removeTab(gBrowser.selectedTab)
   ]);
 }
@@ -201,26 +195,24 @@ function cancelInstallDialog(installDial
   if (Preferences.get("xpinstall.customConfirmationUI", false)) {
     installDialog.secondaryButton.click();
   } else {
     let win = Services.wm.getMostRecentWindow("Addons:Install");
     win.document.documentElement.cancelDialog();
   }
 }
 
-function waitForSingleNotification(aCallback) {
-  return (async function() {
-    while (PopupNotifications.panel.childNodes.length == 2) {
-      await new Promise(resolve => executeSoon(resolve));
+async function waitForSingleNotification(aCallback) {
+  while (PopupNotifications.panel.childNodes.length == 2) {
+    await new Promise(resolve => executeSoon(resolve));
 
-      info("Waiting for single notification");
-      // Notification should never close while we wait
-      ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    }
-  })();
+    info("Waiting for single notification");
+    // Notification should never close while we wait
+    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  }
 }
 
 function setupRedirect(aSettings) {
   var url = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/redirect.sjs?mode=setup";
   for (var name in aSettings) {
     url += "&" + name + "=" + aSettings[name];
   }
 
@@ -231,809 +223,767 @@ function setupRedirect(aSettings) {
 
 function getInstalls() {
   return new Promise(resolve => {
     AddonManager.getAllInstalls(installs => resolve(installs));
   });
 }
 
 var TESTS = [
-function test_disabledInstall() {
-  return (async function() {
-    Services.prefs.setBoolPref("xpinstall.enabled", false);
+async function test_disabledInstall() {
+  Services.prefs.setBoolPref("xpinstall.enabled", false);
 
-    let notificationPromise = waitForNotification("xpinstall-disabled");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("xpinstall-disabled");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Enable", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "Software installation is currently disabled. Click Enable and try again.");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Enable", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "Software installation is currently disabled. Click Enable and try again.");
 
-    let closePromise = waitForNotificationClose();
-    // Click on Enable
-    EventUtils.synthesizeMouseAtCenter(notification.button, {});
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  // Click on Enable
+  EventUtils.synthesizeMouseAtCenter(notification.button, {});
+  await closePromise;
 
-    try {
-      ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
-    } catch (e) {
-      ok(false, "xpinstall.enabled should be set");
-    }
+  try {
+    ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
+  } catch (e) {
+    ok(false, "xpinstall.enabled should be set");
+  }
 
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    let installs = await getInstalls();
-    is(installs.length, 0, "Shouldn't be any pending installs");
-  })();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  let installs = await getInstalls();
+  is(installs.length, 0, "Shouldn't be any pending installs");
 },
 
-function test_blockedInstall() {
-  return (async function() {
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+async function test_blockedInstall() {
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Allow", "Should have seen the right button");
-    is(notification.getAttribute("origin"), "example.com",
-       "Should have seen the right origin host");
-    is(notification.getAttribute("label"),
-       gApp + " prevented this site from asking you to install software on your computer.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Allow", "Should have seen the right button");
+  is(notification.getAttribute("origin"), "example.com",
+     "Should have seen the right origin host");
+  is(notification.getAttribute("label"),
+     gApp + " prevented this site from asking you to install software on your computer.",
+     "Should have seen the right message");
 
-    let dialogPromise = waitForInstallDialog();
-    // Click on Allow
-    EventUtils.synthesizeMouse(notification.button, 20, 10, {});
-    // Notification should have changed to progress notification
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
-    let installDialog = await dialogPromise;
+  let dialogPromise = waitForInstallDialog();
+  // Click on Allow
+  EventUtils.synthesizeMouse(notification.button, 20, 10, {});
+  // Notification should have changed to progress notification
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  let installDialog = await dialogPromise;
 
-    notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    panel = await notificationPromise;
+  notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  panel = await notificationPromise;
 
-    notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
-    await removeTab();
-  })();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+  await removeTab();
 },
 
-function test_whitelistedInstall() {
-  return (async function() {
-    let originalTab = gBrowser.selectedTab;
-    let tab;
-    gBrowser.selectedTab = originalTab;
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_whitelistedInstall() {
+  let originalTab = gBrowser.selectedTab;
+  let tab;
+  gBrowser.selectedTab = originalTab;
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?"
-      + triggers).then(newTab => tab = newTab);
-    await progressPromise;
-    let installDialog = await dialogPromise;
-    await BrowserTestUtils.waitForCondition(() => !!tab, "tab should be present");
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?"
+                                                + triggers).then(newTab => tab = newTab);
+  await progressPromise;
+  let installDialog = await dialogPromise;
+  await BrowserTestUtils.waitForCondition(() => !!tab, "tab should be present");
 
-    is(gBrowser.selectedTab, tab,
-       "tab selected in response to the addon-install-confirmation notification");
+  is(gBrowser.selectedTab, tab,
+     "tab selected in response to the addon-install-confirmation notification");
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-             "XPI Test will be installed after you restart " + gApp + ".",
-             "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_failedDownload() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_failedDownload() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "missing.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "missing.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on could not be downloaded because of a connection failure.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on could not be downloaded because of a connection failure.",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_corruptFile() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_corruptFile() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "corrupt.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "corrupt.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on downloaded from this site could not be installed " +
-       "because it appears to be corrupt.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on downloaded from this site could not be installed " +
+     "because it appears to be corrupt.",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_incompatible() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_incompatible() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "incompatible.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "incompatible.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "XPI Test could not be installed because it is not compatible with " +
-       gApp + " " + gVersion + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "XPI Test could not be installed because it is not compatible with " +
+     gApp + " " + gVersion + ".",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_restartless() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_restartless() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "restartless.xpi"
-    }));
-    gBrowser.selectedTab = gBrowser.addTab();
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "restartless.xpi"
+  }));
+  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-installed");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  let notificationPromise = waitForNotification("addon-installed");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending installs");
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending installs");
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", result => {
-        resolve(result);
-      });
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", result => {
+      resolve(result);
     });
-    addon.uninstall();
+  });
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
+  Services.perms.remove(makeURI("http://example.com/"), "install");
 
-    let closePromise = waitForNotificationClose();
-    gBrowser.removeTab(gBrowser.selectedTab);
-    await closePromise;
-  })();
+  let closePromise = waitForNotificationClose();
+  gBrowser.removeTab(gBrowser.selectedTab);
+  await closePromise;
 },
 
-function test_sequential() {
-  return (async function() {
-    // This test is only relevant if using the new doorhanger UI
-    // TODO: this subtest is disabled until multiple notification prompts are
-    // reworked in bug 1188152
-    if (true || !Preferences.get("xpinstall.customConfirmationUI", false)) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_sequential() {
+  // This test is only relevant if using the new doorhanger UI
+  // TODO: this subtest is disabled until multiple notification prompts are
+  // reworked in bug 1188152
+  if (true || !Preferences.get("xpinstall.customConfirmationUI", false)) {
+    return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Restartless XPI": "restartless.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Restartless XPI": "restartless.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    // Should see the right add-on
-    let container = document.getElementById("addon-install-confirmation-content");
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should see the right add-on
+  let container = document.getElementById("addon-install-confirmation-content");
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    progressPromise = waitForProgressNotification(true, 2);
-    triggers = encodeURIComponent(JSON.stringify({
-      "Theme XPI": "theme.xpi"
-    }));
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
+  progressPromise = waitForProgressNotification(true, 2);
+  triggers = encodeURIComponent(JSON.stringify({
+    "Theme XPI": "theme.xpi"
+  }));
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
 
-    // Should still have the right add-on in the confirmation notification
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should still have the right add-on in the confirmation notification
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    // Wait for the install to complete, we won't see a new confirmation
-    // notification
-    await new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-confirmation");
-        resolve();
-      }, "addon-install-confirmation");
-    });
+  // Wait for the install to complete, we won't see a new confirmation
+  // notification
+  await new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-confirmation");
+      resolve();
+    }, "addon-install-confirmation");
+  });
 
-    // Make sure browser-addons.js executes first
-    await new Promise(resolve => executeSoon(resolve));
+  // Make sure browser-addons.js executes first
+  await new Promise(resolve => executeSoon(resolve));
 
-    // Should have dropped the progress notification
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-    is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-       "Should only be showing one install confirmation");
+  // Should have dropped the progress notification
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
+  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
+     "Should only be showing one install confirmation");
 
-    // Should still have the right add-on in the confirmation notification
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should still have the right add-on in the confirmation notification
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    cancelInstallDialog(installDialog);
-
-    ok(PopupNotifications.isPanelOpen, "Panel should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-    is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-       "Should still have an install confirmation open");
+  cancelInstallDialog(installDialog);
 
-    // Should have the next add-on's confirmation dialog
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
+  ok(PopupNotifications.isPanelOpen, "Panel should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
+  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
+     "Should still have an install confirmation open");
 
-    Services.perms.remove(makeURI("http://example.com"), "install");
-    let closePromise = waitForNotificationClose();
-    cancelInstallDialog(installDialog);
-    await closePromise;
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
+  // Should have the next add-on's confirmation dialog
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
+
+  Services.perms.remove(makeURI("http://example.com"), "install");
+  let closePromise = waitForNotificationClose();
+  cancelInstallDialog(installDialog);
+  await closePromise;
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_allUnverified() {
-  return (async function() {
-    // This test is only relevant if using the new doorhanger UI and allowing
-    // unsigned add-ons
-    if (!Preferences.get("xpinstall.customConfirmationUI", false) ||
-        Preferences.get("xpinstall.signatures.required", true) ||
-        REQUIRE_SIGNING) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_allUnverified() {
+  // This test is only relevant if using the new doorhanger UI and allowing
+  // unsigned add-ons
+  if (!Preferences.get("xpinstall.customConfirmationUI", false) ||
+      Preferences.get("xpinstall.signatures.required", true) ||
+      AppConstants.MOZ_REQUIRE_SIGNING) {
+        return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Extension XPI": "restartless-unsigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Extension XPI": "restartless-unsigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notification = document.getElementById("addon-install-confirmation-notification");
-    let message = notification.getAttribute("label");
-    is(message, "Caution: This site would like to install an unverified add-on in " + gApp + ". Proceed at your own risk.");
+  let notification = document.getElementById("addon-install-confirmation-notification");
+  let message = notification.getAttribute("label");
+  is(message, "Caution: This site would like to install an unverified add-on in " + gApp + ". Proceed at your own risk.");
 
-    let container = document.getElementById("addon-install-confirmation-content");
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-    is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
+  let container = document.getElementById("addon-install-confirmation-content");
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
 
-    let notificationPromise = waitForNotification("addon-installed");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  let notificationPromise = waitForNotification("addon-installed");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
-      });
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
+      resolve(result);
     });
-    addon.uninstall();
+  });
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_url() {
-  return (async function() {
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(TESTROOT + "amosigned.xpi");
-    await progressPromise;
-    let installDialog = await dialogPromise;
+async function test_url() {
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(TESTROOT + "amosigned.xpi");
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
 
-    await removeTab();
-  })();
+  await removeTab();
 },
 
-function test_localFile() {
-  return (async function() {
-    let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
-                       .getService(Components.interfaces.nsIChromeRegistry);
-    let path;
-    try {
-      path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
-    } catch (ex) {
-      path = CHROMEROOT + "corrupt.xpi";
-    }
+async function test_localFile() {
+  let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
+                     .getService(Components.interfaces.nsIChromeRegistry);
+  let path;
+  try {
+    path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
+  } catch (ex) {
+    path = CHROMEROOT + "corrupt.xpi";
+  }
 
-    let failPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-failed");
-        resolve();
-      }, "addon-install-failed");
-    });
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(path);
-    await failPromise;
+  let failPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-failed");
+      resolve();
+    }, "addon-install-failed");
+  });
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(path);
+  await failPromise;
 
-    // Wait for the browser code to add the failure notification
-    await waitForSingleNotification();
+  // Wait for the browser code to add the failure notification
+  await waitForSingleNotification();
 
-    let notification = PopupNotifications.panel.childNodes[0];
-    is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
-    is(notification.getAttribute("label"),
-       "This add-on could not be installed because it appears to be corrupt.",
-       "Should have seen the right message");
+  let notification = PopupNotifications.panel.childNodes[0];
+  is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
+  is(notification.getAttribute("label"),
+     "This add-on could not be installed because it appears to be corrupt.",
+     "Should have seen the right message");
 
-    await removeTab();
-  })();
+  await removeTab();
 },
 
-function test_tabClose() {
-  return (async function() {
-    if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
-      info("Test skipped due to xpinstall.customConfirmationUI being false.");
-      return;
-    }
+async function test_tabClose() {
+  if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
+    info("Test skipped due to xpinstall.customConfirmationUI being false.");
+    return;
+  }
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(TESTROOT + "amosigned.xpi");
-    await progressPromise;
-    await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(TESTROOT + "amosigned.xpi");
+  await progressPromise;
+  await dialogPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
 
-    let closePromise = waitForNotificationClose();
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await closePromise;
 
-    installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install since the tab is closed");
-  })();
+  installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install since the tab is closed");
 },
 
 // Add-ons should be cancelled and the install notification destroyed when
 // navigating to a new origin
-function test_tabNavigate() {
-  return (async function() {
-    if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_tabNavigate() {
+  if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
+    return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Extension XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Extension XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  await dialogPromise;
 
-    let closePromise = waitForNotificationClose();
-    let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI("about:blank");
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI("about:blank");
+  await closePromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install");
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await loadPromise;
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await loadPromise;
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_urlBar() {
-  return (async function() {
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
+async function test_urlBar() {
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+
+  gBrowser.selectedTab = gBrowser.addTab("about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gURLBar.value = TESTROOT + "amosigned.xpi";
+  gURLBar.focus();
+  EventUtils.synthesizeKey("VK_RETURN", {});
 
-    gBrowser.selectedTab = gBrowser.addTab("about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gURLBar.value = TESTROOT + "amosigned.xpi";
-    gURLBar.focus();
-    EventUtils.synthesizeKey("VK_RETURN", {});
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
+
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+
+  await removeTab();
+},
+
+async function test_wrongHost() {
+  let requestedUrl = TESTROOT2 + "enabled.html";
+  gBrowser.selectedTab = gBrowser.addTab();
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-             "XPI Test will be installed after you restart " + gApp + ".",
-             "Should have seen the right message");
+  let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
+  gBrowser.loadURI(TESTROOT2 + "enabled.html");
+  await loadedPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let progressPromise = waitForProgressNotification();
+  let notificationPromise = waitForNotification("addon-install-failed");
+  gBrowser.loadURI(TESTROOT + "corrupt.xpi");
+  await progressPromise;
+  let panel = await notificationPromise;
 
-    await removeTab();
-  })();
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on downloaded from this site could not be installed " +
+     "because it appears to be corrupt.",
+     "Should have seen the right message");
+
+  await removeTab();
 },
 
-function test_wrongHost() {
-  return (async function() {
-    let requestedUrl = TESTROOT2 + "enabled.html";
-    gBrowser.selectedTab = gBrowser.addTab();
+async function test_reload() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
-    gBrowser.loadURI(TESTROOT2 + "enabled.html");
-    await loadedPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Unsigned XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
+
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let notificationPromise = waitForNotification("addon-install-failed");
-    gBrowser.loadURI(TESTROOT + "corrupt.xpi");
-    await progressPromise;
-    let panel = await notificationPromise;
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on downloaded from this site could not be installed " +
-       "because it appears to be corrupt.",
-       "Should have seen the right message");
+  function testFail() {
+    ok(false, "Reloading should not have hidden the notification");
+  }
+  PopupNotifications.panel.addEventListener("popuphiding", testFail);
+  let requestedUrl = TESTROOT2 + "enabled.html";
+  let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
+  gBrowser.loadURI(TESTROOT2 + "enabled.html");
+  await loadedPromise;
+  PopupNotifications.panel.removeEventListener("popuphiding", testFail);
 
-    await removeTab();
-  })();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_reload() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_theme() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Unsigned XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Theme XPI": "theme.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "Theme Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    function testFail() {
-      ok(false, "Reloading should not have hidden the notification");
-    }
-    PopupNotifications.panel.addEventListener("popuphiding", testFail);
-    let requestedUrl = TESTROOT2 + "enabled.html";
-    let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
-    gBrowser.loadURI(TESTROOT2 + "enabled.html");
-    await loadedPromise;
-    PopupNotifications.panel.removeEventListener("popuphiding", testFail);
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(result) {
+      resolve(result);
+    });
+  });
+  ok(addon.userDisabled, "Should be switching away from the default theme.");
+  // Undo the pending theme switch
+  addon.userDisabled = false;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(result) {
+      resolve(result);
+    });
+  });
+  isnot(addon, null, "Test theme will have been installed");
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_theme() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_renotifyBlocked() {
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Theme XPI": "theme.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let closePromise = waitForNotificationClose();
+  // hide the panel (this simulates the user dismissing it)
+  panel.hidePopup();
+  await closePromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  info("Timeouts after this probably mean bug 589954 regressed");
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "Theme Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  await new Promise(resolve => executeSoon(resolve));
+
+  notificationPromise = waitForNotification("addon-install-blocked");
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await notificationPromise;
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(result) {
-        resolve(result);
-      });
-    });
-    ok(addon.userDisabled, "Should be switching away from the default theme.");
-    // Undo the pending theme switch
-    addon.userDisabled = false;
+  let installs = await getInstalls();
+  is(installs.length, 2, "Should be two pending installs");
 
-    addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
-      });
-    });
-    isnot(addon, null, "Test theme will have been installed");
-    addon.uninstall();
+  closePromise = waitForNotificationClose();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await closePromise;
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  installs = await getInstalls();
+  is(installs.length, 0, "Should have cancelled the installs");
 },
 
-function test_renotifyBlocked() {
-  return (async function() {
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+async function test_renotifyInstalled() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let closePromise = waitForNotificationClose();
-    // hide the panel (this simulates the user dismissing it)
-    panel.hidePopup();
-    await closePromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    info("Timeouts after this probably mean bug 589954 regressed");
+  // Wait for the complete notification
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
+
+  let closePromise = waitForNotificationClose();
+  // hide the panel (this simulates the user dismissing it)
+  panel.hidePopup();
+  await closePromise;
 
-    await new Promise(resolve => executeSoon(resolve));
+  // Install another
+  await new Promise(resolve => executeSoon(resolve));
 
-    notificationPromise = waitForNotification("addon-install-blocked");
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await notificationPromise;
+  progressPromise = waitForProgressNotification();
+  dialogPromise = waitForInstallDialog();
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  installDialog = await dialogPromise;
+
+  info("Timeouts after this probably mean bug 589954 regressed");
 
-    let installs = await getInstalls();
-    is(installs.length, 2, "Should be two pending installs");
+  // Wait for the complete notification
+  notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    closePromise = waitForNotificationClose();
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    await closePromise;
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending installs");
+  installs[0].cancel();
 
-    installs = await getInstalls();
-    is(installs.length, 0, "Should have cancelled the installs");
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_renotifyInstalled() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_cancel() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+
+  let notificationPromise = waitForNotification(PROGRESS_NOTIFICATION);
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "slowinstall.sjs?file=amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let notification = panel.childNodes[0];
+  // Close the notification
+  let anchor = document.getElementById("addons-notification-icon");
+  anchor.click();
+  // Reopen the notification
+  anchor.click();
 
-    // Wait for the complete notification
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
-
-    let closePromise = waitForNotificationClose();
-    // hide the panel (this simulates the user dismissing it)
-    panel.hidePopup();
-    await closePromise;
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
 
-    // Install another
-    await new Promise(resolve => executeSoon(resolve));
-
-    progressPromise = waitForProgressNotification();
-    dialogPromise = waitForInstallDialog();
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    installDialog = await dialogPromise;
-
-    info("Timeouts after this probably mean bug 589954 regressed");
+  // Cancel the download
+  let install = notification.notification.options.installs[0];
+  let cancelledPromise = new Promise(resolve => {
+    install.addListener({
+      onDownloadCancelled() {
+        install.removeListener(this);
+        resolve();
+      }
+    });
+  });
+  EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
+  await cancelledPromise;
 
-    // Wait for the complete notification
-    notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  await new Promise(resolve => executeSoon(resolve));
+
+  ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending installs");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_cancel() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-    let notificationPromise = waitForNotification(PROGRESS_NOTIFICATION);
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "slowinstall.sjs?file=amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
-
-    let notification = panel.childNodes[0];
-    // Close the notification
-    let anchor = document.getElementById("addons-notification-icon");
-    anchor.click();
-    // Reopen the notification
-    anchor.click();
+async function test_failedSecurity() {
+  Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false);
+  setupRedirect({
+    "Location": TESTROOT + "amosigned.xpi"
+  });
 
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "redirect.sjs?mode=redirect"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, SECUREROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    // Cancel the download
-    let install = notification.notification.options.installs[0];
-    let cancelledPromise = new Promise(resolve => {
-      install.addListener({
-        onDownloadCancelled() {
-          install.removeListener(this);
-          resolve();
-        }
-      });
-    });
-    EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
-    await cancelledPromise;
-
-    await new Promise(resolve => executeSoon(resolve));
-
-    ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
-
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install");
+  let notification = panel.childNodes[0];
+  // Click on Allow
+  EventUtils.synthesizeMouse(notification.button, 20, 10, {});
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
-},
-
-function test_failedSecurity() {
-  return (async function() {
-    Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false);
-    setupRedirect({
-      "Location": TESTROOT + "amosigned.xpi"
-    });
-
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "redirect.sjs?mode=redirect"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, SECUREROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
-
-    let notification = panel.childNodes[0];
-    // Click on Allow
-    EventUtils.synthesizeMouse(notification.button, 20, 10, {});
+  // Notification should have changed to progress notification
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
 
-    // Notification should have changed to progress notification
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  // Wait for it to fail
+  await new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-failed");
+      resolve();
+    }, "addon-install-failed");
+  });
 
-    // Wait for it to fail
-    await new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-failed");
-        resolve();
-      }, "addon-install-failed");
-    });
+  // Allow the browser code to add the failure notification and then wait
+  // for the progress notification to dismiss itself
+  await waitForSingleNotification();
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
 
-    // Allow the browser code to add the failure notification and then wait
-    // for the progress notification to dismiss itself
-    await waitForSingleNotification();
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
-
-    Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
-    await removeTab();
-  })();
+  Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
+  await removeTab();
 }
 ];
 
 var gTestStart = null;
 
 var XPInstallObserver = {
   observe(aSubject, aTopic, aData) {
     var installInfo = aSubject.wrappedJSObject;
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -241,16 +241,23 @@ this.AppConstants = Object.freeze({
 
   MOZ_PLACES:
 #ifdef MOZ_PLACES
   true,
 #else
   false,
 #endif
 
+  MOZ_ADDON_SIGNING:
+#ifdef MOZ_ADDON_SIGNING
+  true,
+#else
+  false,
+#endif
+
   MOZ_REQUIRE_SIGNING:
 #ifdef MOZ_REQUIRE_SIGNING
   true,
 #else
   false,
 #endif
 
   INSTALL_COMPACT_THEMES:
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -14,30 +14,26 @@ var Cu = Components.utils;
 var Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DownloadUtils.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
+Cu.import("resource://gre/modules/addons/AddonSettings.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils", "resource:///modules/E10SUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Extension",
                                   "resource://gre/modules/Extension.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionParent",
                                   "resource://gre/modules/ExtensionParent.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 
-const CONSTANTS = {};
-Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
-const SIGNING_REQUIRED = CONSTANTS.REQUIRE_SIGNING ?
-                         true :
-                         Services.prefs.getBoolPref("xpinstall.signatures.required");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
                                   "resource://gre/modules/Preferences.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Experiments",
   "resource:///modules/experiments/Experiments.jsm");
@@ -2911,17 +2907,17 @@ var gListView = {
   hide() {
     gEventManager.unregisterInstallListener(this);
     doPendingUninstalls(this._listBox);
   },
 
   filterDisabledUnsigned(aFilter = true) {
     let foundDisabledUnsigned = false;
 
-    if (SIGNING_REQUIRED) {
+    if (AddonSettings.REQUIRE_SIGNING) {
       for (let item of this._listBox.childNodes) {
         if (!isCorrectlySigned(item.mAddon))
           foundDisabledUnsigned = true;
         else
           item.hidden = aFilter;
       }
     }
 
@@ -3391,17 +3387,17 @@ var gDetailView = {
         document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
           "details.notification.blocked",
           [this._addon.name], 1
         );
         var errorLink = document.getElementById("detail-error-link");
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.blocked.link");
         errorLink.href = this._addon.blocklistURL;
         errorLink.hidden = false;
-      } else if (!isCorrectlySigned(this._addon) && SIGNING_REQUIRED) {
+      } else if (!isCorrectlySigned(this._addon) && AddonSettings.REQUIRE_SIGNING) {
         this.node.setAttribute("notification", "error");
         document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
           "details.notification.unsignedAndDisabled", [this._addon.name, gStrings.brandShortName], 2
         );
         let errorLink = document.getElementById("detail-error-link");
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.unsigned.link");
         errorLink.href = SUPPORT_URL + "unsigned-addons";
         errorLink.hidden = false;
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -1297,17 +1297,18 @@
               this.setAttribute("notification", "error");
               this._error.textContent = gStrings.ext.formatStringFromName(
                 "notification.blocked",
                 [this.mAddon.name], 1
               );
               this._errorLink.value = gStrings.ext.GetStringFromName("notification.blocked.link");
               this._errorLink.href = this.mAddon.blocklistURL;
               this._errorLink.hidden = false;
-            } else if (!isUpgrade && !isCorrectlySigned(this.mAddon) && SIGNING_REQUIRED) {
+            } else if (!isUpgrade && !isCorrectlySigned(this.mAddon) &&
+                       AddonSettings.REQUIRE_SIGNING) {
               this.setAttribute("notification", "error");
               this._error.textContent = gStrings.ext.formatStringFromName(
                 "notification.unsignedAndDisabled", [this.mAddon.name, gStrings.brandShortName], 2
               );
               this._errorLink.value = gStrings.ext.GetStringFromName("notification.unsigned.link");
               this._errorLink.href = SUPPORT_URL + "unsigned-addons";
               this._errorLink.hidden = false;
             } else if ((!isUpgrade && !this.mAddon.isCompatible) && (AddonManager.checkCompatibility
deleted file mode 100644
--- a/toolkit/mozapps/extensions/internal/AddonConstants.jsm
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 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";
-
-this.EXPORTED_SYMBOLS = [ "ADDON_SIGNING", "REQUIRE_SIGNING" ];
-
-// Make these non-changable properties so they can't be manipulated from other
-// code in the app.
-Object.defineProperty(this, "ADDON_SIGNING", {
-  configurable: false,
-  enumerable: false,
-  writable: false,
-#ifdef MOZ_ADDON_SIGNING
-  value: true,
-#else
-  value: false,
-#endif
-});
-
-Object.defineProperty(this, "REQUIRE_SIGNING", {
-  configurable: false,
-  enumerable: false,
-  writable: false,
-#ifdef MOZ_REQUIRE_SIGNING
-  value: true,
-#else
-  value: false,
-#endif
-});
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/internal/AddonSettings.jsm
@@ -0,0 +1,36 @@
+/* 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";
+
+const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+
+this.EXPORTED_SYMBOLS = [ "AddonSettings" ];
+
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/AppConstants.jsm");
+
+const PREF_SIGNATURES_REQUIRED = "xpinstall.signatures.required";
+
+this.AddonSettings = {};
+
+// Make a non-changable property that can't be manipulated from other
+// code in the app.
+function makeConstant(name, value) {
+  Object.defineProperty(AddonSettings, name, {
+    configurable: false,
+    enumerable: false,
+    writable: false,
+    value,
+  });
+}
+
+makeConstant("ADDON_SIGNING", AppConstants.MOZ_ADDON_SIGNING);
+
+if (AppConstants.MOZ_REQUIRE_SIGNING && !Cu.isInAutomation) {
+  makeConstant("REQUIRE_SIGNING", true);
+} else {
+  XPCOMUtils.defineLazyPreferenceGetter(AddonSettings, "REQUIRE_SIGNING",
+                                        PREF_SIGNATURES_REQUIRED, false);
+}
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -6,27 +6,27 @@
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = ["XPIProvider"];
 
-const CONSTANTS = {};
-Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
-const { ADDON_SIGNING, REQUIRE_SIGNING } = CONSTANTS
-
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/addons/AddonRepository.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AddonSettings",
+                                  "resource://gre/modules/addons/AddonSettings.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+                                  "resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
                                   "resource://gre/modules/ChromeManifestParser.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionData",
                                   "resource://gre/modules/Extension.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
                                   "resource://gre/modules/ExtensionManagement.jsm");
@@ -388,18 +388,17 @@ const SIGNED_TYPES = new Set([
 const TEMP_INSTALL_ID_GEN_SESSION =
   new Uint8Array(Float64Array.of(Math.random()).buffer);
 
 // Whether add-on signing is required.
 function mustSign(aType) {
   if (!SIGNED_TYPES.has(aType))
     return false;
 
-  return ((REQUIRE_SIGNING && !Cu.isInAutomation) ||
-          Preferences.get(PREF_XPI_SIGNATURES_REQUIRED, false));
+  return AddonSettings.REQUIRE_SIGNING;
 }
 
 // Keep track of where we are in startup for telemetry
 // event happened during XPIDatabase.startup()
 const XPI_STARTING = "XPIStarting";
 // event happened after startup() but before the final-ui-startup event
 const XPI_BEFORE_UI_STARTUP = "BeforeFinalUIStartup";
 // event happened after final-ui-startup
@@ -438,17 +437,17 @@ XPCOMUtils.defineLazyPreferenceGetter(th
 function loadLazyObjects() {
   let uri = "resource://gre/modules/addons/XPIProviderUtils.js";
   let scope = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), {
     sandboxName: uri,
     wantGlobalProperties: ["TextDecoder"],
   });
 
   Object.assign(scope, {
-    ADDON_SIGNING,
+    ADDON_SIGNING: AddonSettings.ADDON_SIGNING,
     SIGNED_TYPES,
     BOOTSTRAP_REASONS,
     DB_SCHEMA,
     AddonInternal,
     XPIProvider,
     XPIStates,
     syncLoadManifestFromFile,
     isUsableAddon,
@@ -1936,17 +1935,17 @@ function shouldVerifySignedState(aAddon)
 
   // Hotfixes should always have their signature checked
   let hotfixID = Preferences.get(PREF_EM_HOTFIX_ID, undefined);
   if (hotfixID && aAddon.id == hotfixID)
     return true;
 
   // Otherwise only check signatures if signing is enabled and the add-on is one
   // of the signed types.
-  return ADDON_SIGNING && SIGNED_TYPES.has(aAddon.type);
+  return AddonSettings.ADDON_SIGNING && SIGNED_TYPES.has(aAddon.type);
 }
 
 let gCertDB = Cc["@mozilla.org/security/x509certdb;1"]
               .getService(Ci.nsIX509CertDB);
 
 /**
  * Verifies that a zip file's contents are all correctly signed by an
  * AMO-issued certificate
@@ -1962,17 +1961,17 @@ let gCertDB = Cc["@mozilla.org/security/
 function verifyZipSignedState(aFile, aAddon) {
   if (!shouldVerifySignedState(aAddon))
     return Promise.resolve({
       signedState: AddonManager.SIGNEDSTATE_NOT_REQUIRED,
       cert: null
     });
 
   let root = Ci.nsIX509CertDB.AddonsPublicRoot;
-  if (!REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
+  if (!AppConstants.MOZ_REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
     root = Ci.nsIX509CertDB.AddonsStageRoot;
 
   return new Promise(resolve => {
     let callback = {
       openSignedAppFileFinished(aRv, aZipReader, aCert) {
         if (aZipReader)
           aZipReader.close();
         resolve({
@@ -2004,17 +2003,17 @@ function verifyZipSignedState(aFile, aAd
 function verifyDirSignedState(aDir, aAddon) {
   if (!shouldVerifySignedState(aAddon))
     return Promise.resolve({
       signedState: AddonManager.SIGNEDSTATE_NOT_REQUIRED,
       cert: null,
     });
 
   let root = Ci.nsIX509CertDB.AddonsPublicRoot;
-  if (!REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
+  if (!AppConstants.MOZ_REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
     root = Ci.nsIX509CertDB.AddonsStageRoot;
 
   return new Promise(resolve => {
     let callback = {
       verifySignedDirectoryFinished(aRv, aCert) {
         resolve({
           signedState: getSignedStatus(aRv, aCert, aAddon.id),
           cert: null,
@@ -3217,17 +3216,17 @@ this.XPIProvider = {
                                                      null);
       this.minCompatiblePlatformVersion = Preferences.get(PREF_EM_MIN_COMPAT_PLATFORM_VERSION,
                                                           null);
 
       Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this);
       Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this);
       Services.prefs.addObserver(PREF_E10S_ADDON_BLOCKLIST, this);
       Services.prefs.addObserver(PREF_E10S_ADDON_POLICY, this);
-      if (!REQUIRE_SIGNING || Cu.isInAutomation)
+      if (!AppConstants.MOZ_REQUIRE_SIGNING || Cu.isInAutomation)
         Services.prefs.addObserver(PREF_XPI_SIGNATURES_REQUIRED, this);
       Services.prefs.addObserver(PREF_ALLOW_NON_MPC, this);
       Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS);
 
       // Cu.isModuleLoaded can fail here for external XUL apps where there is
       // no chrome.manifest that defines resource://devtools.
       if (ResProtocolHandler.hasSubstitution("devtools")) {
         if (Cu.isModuleLoaded("resource://devtools/client/framework/ToolboxProcess.jsm")) {
--- a/toolkit/mozapps/extensions/internal/moz.build
+++ b/toolkit/mozapps/extensions/internal/moz.build
@@ -2,16 +2,17 @@
 # vim: set filetype=python:
 # 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/.
 
 EXTRA_JS_MODULES.addons += [
     'AddonRepository.jsm',
     'AddonRepository_SQLiteMigrator.jsm',
+    'AddonSettings.jsm',
     'AddonUpdateChecker.jsm',
     'APIExtensionBootstrap.js',
     'Content.js',
     'E10SAddonsRollout.jsm',
     'GMPProvider.jsm',
     'LightweightThemeImageOptimizer.jsm',
     'ProductAddonChecker.jsm',
     'SpellCheckDictionaryBootstrap.js',
@@ -24,12 +25,8 @@ TESTING_JS_MODULES += [
     'AddonTestUtils.jsm',
 ]
 
 # Don't ship unused providers on Android
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
     EXTRA_JS_MODULES.addons += [
         'PluginProvider.jsm',
     ]
-
-EXTRA_PP_JS_MODULES.addons += [
-    'AddonConstants.jsm',
-]
--- a/toolkit/mozapps/extensions/test/browser/browser_details.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_details.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests various aspects of the details view
 
-const { REQUIRE_SIGNING } = Components.utils.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+Components.utils.import("resource://gre/modules/AppConstants.jsm");
 
 const PREF_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault";
 const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";
 const SEARCH_URL = TESTROOT + "browser_details.xml";
 const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
 
 var gManagerWindow;
 var gCategoryUtilities;
@@ -705,17 +705,17 @@ add_test(function() {
       is_element_hidden(get("detail-pending"), "Pending message should be hidden");
 
       run_next_test();
     });
   });
 });
 
 // These tests are only appropriate when signing can be turned off
-if (!REQUIRE_SIGNING) {
+if (!AppConstants.MOZ_REQUIRE_SIGNING) {
   // Opens and tests the details view for add-on 9
   add_test(function() {
     open_details("addon9@tests.mozilla.org", "extension", function() {
       is(get("detail-name").textContent, "Test add-on 9", "Name should be correct");
 
       is_element_hidden(get("detail-prefs-btn"), "Preferences button should be hidden");
       is_element_hidden(get("detail-enable-btn"), "Enable button should be hidden");
       is_element_visible(get("detail-disable-btn"), "Disable button should be visible");
@@ -769,17 +769,17 @@ add_test(function() {
           });
         });
       });
     });
   });
 });
 
 // These tests are only appropriate when signing can be turned off
-if (!REQUIRE_SIGNING) {
+if (!AppConstants.REQUIRE_SIGNING) {
   // Opens and tests the details view for add-on 10
   add_test(function() {
     open_details("addon10@tests.mozilla.org", "extension", function() {
       is(get("detail-name").textContent, "Test add-on 10", "Name should be correct");
 
       is_element_hidden(get("detail-prefs-btn"), "Preferences button should be hidden");
       is_element_hidden(get("detail-enable-btn"), "Enable button should be hidden");
       is_element_hidden(get("detail-disable-btn"), "Disable button should be hidden");
--- a/toolkit/mozapps/extensions/test/browser/browser_list.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_list.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests the list view
 
 var tempScope = {};
 Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", tempScope);
 var LightweightThemeManager = tempScope.LightweightThemeManager;
-const { REQUIRE_SIGNING } = Components.utils.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+ Components.utils.import("resource://gre/modules/AppConstants.jsm");
 
 var gProvider;
 var gManagerWindow;
 var gCategoryUtilities;
 
 var gApp = document.getElementById("bundle_brand").getString("brandShortName");
 var gVersion = Services.appinfo.version;
 var gDate = new Date(2010, 7, 16);
@@ -413,17 +413,17 @@ add_task(async function() {
   is_element_visible(get_node(addon, "error"), "Error message should be visible");
   is(get_node(addon, "error").textContent, "Test add-on 9 is known to be vulnerable. Use with caution.", "Error message should be correct");
   is_element_visible(get_node(addon, "error-link"), "Error link should be visible");
   is(get_node(addon, "error-link").value, "More Information", "Error link text should be correct");
   is(get_node(addon, "error-link").href, "http://example.com/addon9@tests.mozilla.org", "Error link should be correct");
   is_element_hidden(get_node(addon, "pending"), "Pending message should be hidden");
 
   // These tests are only appropriate when signing can be turned off
-  if (!REQUIRE_SIGNING) {
+  if (!AppConstants.MOZ_REQUIRE_SIGNING) {
     info("Addon 10");
     addon = items["Test add-on 10"];
     addon.parentNode.ensureElementIsVisible(addon);
     ({ name, version } = await get_tooltip_info(addon));
     is(get_node(addon, "name").value, "Test add-on 10", "Name should be correct");
     is(name, "Test add-on 10", "Tooltip name should be correct");
 
     is_element_hidden(get_node(addon, "preferences-btn"), "Preferences button should be hidden");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_signed_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_signed_install.js
@@ -1,14 +1,14 @@
 // Enable signature checks for these tests
 gUseRealCertChecks = true;
 // Disable update security
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
-const {REQUIRE_SIGNING} = AM_Cu.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+Components.utils.import("resource://gre/modules/AppConstants.jsm");
 const PREF_XPI_SIGNATURES_DEV_ROOT = "xpinstall.signatures.dev-root";
 
 const DATA = "data/signing_checks/";
 const ADDONS = {
   bootstrap: {
     unsigned: "unsigned_bootstrap_2.xpi",
     badid: "signed_bootstrap_badid_2.xpi",
     preliminary: "preliminary_bootstrap_2.xpi",
@@ -221,17 +221,17 @@ add_task(async function() {
 add_task(async function() {
   let file = do_get_file(DATA + ADDONS.bootstrap.signed);
   await test_install_working(file, AddonManager.SIGNEDSTATE_SIGNED);
 });
 
 // Try to install an add-on with the "Mozilla Extensions" OU
 add_task(async function() {
   // Remove the REQUIRE_SIGNING and DEV_ROOT stuff when bug 1357948 is fixed.
-  if (REQUIRE_SIGNING) {
+  if (AppConstants.MOZ_REQUIRE_SIGNING) {
     return;
   }
   Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_DEV_ROOT, true);
   let file = do_get_file(DATA + ADDONS.bootstrap.privileged);
   await test_install_working(file, AddonManager.SIGNEDSTATE_PRIVILEGED);
   Services.prefs.clearUserPref(PREF_XPI_SIGNATURES_DEV_ROOT);
 });
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
@@ -1,10 +1,10 @@
 
-const {ADDON_SIGNING} = AM_Cu.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+Components.utils.import("resource://gre/modules/addons/AddonSettings.jsm")
 
 function run_test() {
   run_next_test();
 }
 
 let profileDir;
 add_task(async function setup() {
   profileDir = gProfD.clone();
@@ -21,17 +21,17 @@ const IMPLICIT_ID_XPI = "data/webext-imp
 const IMPLICIT_ID_ID = "webext_implicit_id@tests.mozilla.org";
 
 // webext-implicit-id.xpi has a minimal manifest with no
 // applications or browser_specific_settings, so its id comes
 // from its signature, which should be the ID constant defined below.
 add_task(async function test_implicit_id() {
   // This test needs to read the xpi certificate which only works
   // if signing is enabled.
-  ok(ADDON_SIGNING, "Add-on signing is enabled");
+  ok(AddonSettings.ADDON_SIGNING, "Add-on signing is enabled");
 
   let addon = await promiseAddonByID(IMPLICIT_ID_ID);
   equal(addon, null, "Add-on is not installed");
 
   let xpifile = do_get_file(IMPLICIT_ID_XPI);
   await Promise.all([
     promiseInstallAllFiles([xpifile]),
     promiseWebExtensionStartup(),
@@ -44,17 +44,17 @@ add_task(async function test_implicit_id
 });
 
 // We should also be able to install webext-implicit-id.xpi temporarily
 // and it should look just like the regular install (ie, the ID should
 // come from the signature)
 add_task(async function test_implicit_id_temp() {
   // This test needs to read the xpi certificate which only works
   // if signing is enabled.
-  ok(ADDON_SIGNING, "Add-on signing is enabled");
+  ok(AddonSettings.ADDON_SIGNING, "Add-on signing is enabled");
 
   let addon = await promiseAddonByID(IMPLICIT_ID_ID);
   equal(addon, null, "Add-on is not installed");
 
   let xpifile = do_get_file(IMPLICIT_ID_XPI);
   await Promise.all([
     AddonManager.installTemporaryAddon(xpifile),
     promiseWebExtensionStartup(),