Bug 1393156 Remove addons manager tests specific to complete themes r=kmag
authorAndrew Swan <aswan@mozilla.com>
Sat, 26 Aug 2017 08:57:56 -0700
changeset 377178 0f29beef0059937c9eb45fa0d37eaa22d854e4ab
parent 377177 eb1d6805d426894dbf7a712f858ed85788e56224
child 377179 379d8bff976a870fadb8ca9641509026d478a54d
push id32402
push userarchaeopteryx@coole-files.de
push dateMon, 28 Aug 2017 14:47:04 +0000
treeherdermozilla-central@d5b6d113cf17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1393156
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1393156 Remove addons manager tests specific to complete themes r=kmag MozReview-Commit-ID: 7D7k2q3x8v9
toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js
toolkit/mozapps/extensions/test/xpcshell/test_theme.js
toolkit/mozapps/extensions/test/xpcshell/test_undothemeuninstall.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_theme.js
toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
@@ -18,20 +18,16 @@
 // its softDisabled property should never become true after that
 
 // softblock3 does the same as softblock2 however it remains disabled
 
 // softblock4 is disabled while unblocked and so should never have softDisabled
 // set to true and stay userDisabled. This add-on is not used in tests that
 // start with add-ons blocked as it would be identical to softblock3
 
-// softblock5 is a theme. Currently themes just get disabled when they become
-// softblocked and have to be manually re-enabled if they become completely
-// unblocked (bug 657520)
-
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 var Cr = Components.results;
 
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 Cu.import("resource://gre/modules/NetUtil.jsm");
@@ -51,28 +47,16 @@ mapFile("/data/blocklistchange/addon_cha
 mapFile("/data/blocklistchange/app_update.xml", testserver);
 mapFile("/data/blocklistchange/blocklist_update1.xml", testserver);
 mapFile("/data/blocklistchange/blocklist_update2.xml", testserver);
 mapFile("/data/blocklistchange/manual_update.xml", testserver);
 
 testserver.registerDirectory("/addons/", do_get_file("addons"));
 
 
-var default_theme = {
-  id: "default@tests.mozilla.org",
-  version: "1.0",
-  name: "Softblocked add-on",
-  internalName: "classic/1.0",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "3"
-  }]
-};
-
 var softblock1_1 = {
   id: "softblock1@tests.mozilla.org",
   version: "1.0",
   name: "Softblocked add-on",
   updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update1.rdf",
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
@@ -207,55 +191,16 @@ var softblock4_3 = {
   updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update3.rdf",
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
     maxVersion: "3"
   }]
 };
 
-var softblock5_1 = {
-  id: "softblock5@tests.mozilla.org",
-  version: "1.0",
-  name: "Softblocked add-on",
-  updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update1.rdf",
-  internalName: "test/1.0",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "3"
-  }]
-};
-
-var softblock5_2 = {
-  id: "softblock5@tests.mozilla.org",
-  version: "2.0",
-  name: "Softblocked add-on",
-  updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update2.rdf",
-  internalName: "test/1.0",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "3"
-  }]
-};
-
-var softblock5_3 = {
-  id: "softblock5@tests.mozilla.org",
-  version: "3.0",
-  name: "Softblocked add-on",
-  updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update3.rdf",
-  internalName: "test/1.0",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "3"
-  }]
-};
-
 var hardblock_1 = {
   id: "hardblock@tests.mozilla.org",
   version: "1.0",
   name: "Hardblocked add-on",
   updateURL: "http://localhost:" + gPort + "/data/blocklistchange/addon_update1.rdf",
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
@@ -322,17 +267,16 @@ var regexpblock_3 = {
     maxVersion: "3"
   }]
 };
 
 const ADDON_IDS = ["softblock1@tests.mozilla.org",
                    "softblock2@tests.mozilla.org",
                    "softblock3@tests.mozilla.org",
                    "softblock4@tests.mozilla.org",
-                   "softblock5@tests.mozilla.org",
                    "hardblock@tests.mozilla.org",
                    "regexpblock@tests.mozilla.org"];
 
 // Don't need the full interface, attempts to call other methods will just
 // throw which is just fine
 var WindowWatcher = {
   openWindow(parent, url, name, features, openArgs) {
     // Should be called to list the newly blocklisted items
@@ -453,17 +397,17 @@ function Pbackground_update() {
 
   AddonManagerPrivate.backgroundUpdateCheck();
   return updated;
 }
 
 // Manually updates the test add-ons to the given version
 function Pmanual_update(aVersion) {
   let Pinstalls = [];
-  for (let name of ["soft1", "soft2", "soft3", "soft4", "soft5", "hard1", "regexp1"]) {
+  for (let name of ["soft1", "soft2", "soft3", "soft4", "hard1", "regexp1"]) {
     Pinstalls.push(
       AddonManager.getInstallForURL(
         `http://localhost:${gPort}/addons/blocklist_${name}_${aVersion}.xpi`,
         null, "application/x-xpinstall"));
   }
 
   return Promise.all(Pinstalls).then(installs => {
     let completePromises = [];
@@ -531,331 +475,293 @@ function check_addon(aAddon, aExpectedVe
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
   run_next_test();
 }
 
 add_task(async function init() {
-  writeInstallRDFForExtension(default_theme, profileDir);
   writeInstallRDFForExtension(softblock1_1, profileDir);
   writeInstallRDFForExtension(softblock2_1, profileDir);
   writeInstallRDFForExtension(softblock3_1, profileDir);
   writeInstallRDFForExtension(softblock4_1, profileDir);
-  writeInstallRDFForExtension(softblock5_1, profileDir);
   writeInstallRDFForExtension(hardblock_1, profileDir);
   writeInstallRDFForExtension(regexpblock_1, profileDir);
   startupManager();
 
-  let [/* s1 */, /* s2 */, /* s3 */, s4, s5, /* h, r */] = await promiseAddonsByIDs(ADDON_IDS);
+  let [/* s1 */, /* s2 */, /* s3 */, s4, /* h, r */] = await promiseAddonsByIDs(ADDON_IDS);
   s4.userDisabled = true;
-  s5.userDisabled = false;
 });
 
 // Starts with add-ons unblocked and then switches application versions to
 // change add-ons to blocked and back
 add_task(async function run_app_update_test() {
   await promiseRestartManager();
   await Pload_blocklist("app_update.xml");
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "test/1.0");
 });
 
 add_task(async function app_update_step_2() {
   await promiseRestartManager("2");
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s2.userDisabled = false;
   s2.userDisabled = true;
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 });
 
 add_task(async function app_update_step_3() {
   await promiseRestartManager();
 
   await promiseRestartManager("2.5");
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 });
 
 add_task(async function app_update_step_4() {
   await promiseRestartManager("1");
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s1.userDisabled = false;
   s2.userDisabled = false;
-  s5.userDisabled = false;
 });
 
 // Starts with add-ons unblocked and then switches application versions to
 // change add-ons to blocked and back. A DB schema change is faked to force a
 // rebuild when the application version changes
 add_task(async function run_app_update_schema_test() {
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "test/1.0");
 });
 
 add_task(async function update_schema_2() {
   await promiseShutdownManager();
 
   changeXPIDBVersion(100);
   gAppInfo.version = "2";
   startupManager(true);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s2.userDisabled = false;
   s2.userDisabled = true;
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 });
 
 add_task(async function update_schema_3() {
   await promiseRestartManager();
 
   await promiseShutdownManager();
   changeXPIDBVersion(100);
   gAppInfo.version = "2.5";
   startupManager(true);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 });
 
 add_task(async function update_schema_4() {
   await promiseShutdownManager();
 
   changeXPIDBVersion(100);
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 });
 
 add_task(async function update_schema_5() {
   await promiseShutdownManager();
 
   changeXPIDBVersion(100);
   gAppInfo.version = "1";
   startupManager(true);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s1.userDisabled = false;
   s2.userDisabled = false;
-  s5.userDisabled = false;
 });
 
 // Starts with add-ons unblocked and then loads new blocklists to change add-ons
 // to blocked and back again.
 add_task(async function run_blocklist_update_test() {
   await Pload_blocklist("blocklist_update1.xml");
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "test/1.0");
 
   await Pload_blocklist("blocklist_update2.xml");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s2.userDisabled = false;
   s2.userDisabled = true;
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 
   await promiseRestartManager();
 
   await Pload_blocklist("blocklist_update2.xml");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   await Pload_blocklist("blocklist_update1.xml");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s1.userDisabled = false;
   s2.userDisabled = false;
-  s5.userDisabled = false;
 });
 
 // Starts with add-ons unblocked and then new versions are installed outside of
 // the app to change them to blocked and back again.
 add_task(async function run_addon_change_test() {
   await Pload_blocklist("addon_change.xml");
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "test/1.0");
 });
 
 add_task(async function run_addon_change_2() {
   await promiseShutdownManager();
 
   writeInstallRDFForExtension(softblock1_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock1_2.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock2_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock2_2.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock3_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock3_2.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock4_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock4_2.id), Date.now() + 10000);
-  writeInstallRDFForExtension(softblock5_2, profileDir);
-  setExtensionModifiedTime(getFileForAddon(profileDir, softblock5_2.id), Date.now() + 10000);
   writeInstallRDFForExtension(hardblock_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, hardblock_2.id), Date.now() + 10000);
   writeInstallRDFForExtension(regexpblock_2, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, regexpblock_2.id), Date.now() + 10000);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "2.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "2.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s2.userDisabled = false;
   s2.userDisabled = true;
   check_addon(s2, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "2.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 });
 
@@ -867,100 +773,89 @@ add_task(async function run_addon_change
   writeInstallRDFForExtension(softblock1_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock1_3.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock2_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock2_3.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock3_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock3_3.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock4_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock4_3.id), Date.now() + 20000);
-  writeInstallRDFForExtension(softblock5_3, profileDir);
-  setExtensionModifiedTime(getFileForAddon(profileDir, softblock5_3.id), Date.now() + 20000);
   writeInstallRDFForExtension(hardblock_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, hardblock_3.id), Date.now() + 20000);
   writeInstallRDFForExtension(regexpblock_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, regexpblock_3.id), Date.now() + 20000);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "3.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "3.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "3.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "3.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "3.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 });
 
 add_task(async function run_addon_change_4() {
   await promiseShutdownManager();
 
   writeInstallRDFForExtension(softblock1_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock1_1.id), Date.now() + 30000);
   writeInstallRDFForExtension(softblock2_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock2_1.id), Date.now() + 30000);
   writeInstallRDFForExtension(softblock3_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock3_1.id), Date.now() + 30000);
   writeInstallRDFForExtension(softblock4_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock4_1.id), Date.now() + 30000);
-  writeInstallRDFForExtension(softblock5_1, profileDir);
-  setExtensionModifiedTime(getFileForAddon(profileDir, softblock5_1.id), Date.now() + 30000);
   writeInstallRDFForExtension(hardblock_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, hardblock_1.id), Date.now() + 30000);
   writeInstallRDFForExtension(regexpblock_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, regexpblock_1.id), Date.now() + 30000);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  do_check_eq(Services.prefs.getCharPref("general.skins.selectedSkin"), "classic/1.0");
 
   s1.userDisabled = false;
   s2.userDisabled = false;
-  s5.userDisabled = false;
 });
 
 // Starts with add-ons blocked and then new versions are installed outside of
 // the app to change them to unblocked.
 add_task(async function run_addon_change_2_test() {
   await promiseShutdownManager();
 
   getFileForAddon(profileDir, softblock1_1.id).remove(true);
   getFileForAddon(profileDir, softblock2_1.id).remove(true);
   getFileForAddon(profileDir, softblock3_1.id).remove(true);
   getFileForAddon(profileDir, softblock4_1.id).remove(true);
-  getFileForAddon(profileDir, softblock5_1.id).remove(true);
   getFileForAddon(profileDir, hardblock_1.id).remove(true);
   getFileForAddon(profileDir, regexpblock_1.id).remove(true);
 
   startupManager(false);
   await promiseShutdownManager();
 
   writeInstallRDFForExtension(softblock1_2, profileDir);
   writeInstallRDFForExtension(softblock2_2, profileDir);
   writeInstallRDFForExtension(softblock3_2, profileDir);
   writeInstallRDFForExtension(softblock4_2, profileDir);
-  writeInstallRDFForExtension(softblock5_2, profileDir);
   writeInstallRDFForExtension(hardblock_2, profileDir);
   writeInstallRDFForExtension(regexpblock_2, profileDir);
 
   startupManager(false);
 
-  let [s1, s2, s3, /* s4 */, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, /* s4 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "2.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "2.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   s2.userDisabled = false;
@@ -978,26 +873,24 @@ add_task(async function addon_change_2_t
   writeInstallRDFForExtension(softblock1_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock1_3.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock2_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock2_3.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock3_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock3_3.id), Date.now() + 10000);
   writeInstallRDFForExtension(softblock4_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock4_3.id), Date.now() + 10000);
-  writeInstallRDFForExtension(softblock5_3, profileDir);
-  setExtensionModifiedTime(getFileForAddon(profileDir, softblock5_3.id), Date.now() + 10000);
   writeInstallRDFForExtension(hardblock_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, hardblock_3.id), Date.now() + 10000);
   writeInstallRDFForExtension(regexpblock_3, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, regexpblock_3.id), Date.now() + 10000);
 
   startupManager(false);
 
-  let [s1, s2, s3, /* s4 */, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, /* s4 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "3.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "3.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "3.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 });
 
@@ -1007,95 +900,88 @@ add_task(async function addon_change_2_t
   writeInstallRDFForExtension(softblock1_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock1_1.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock2_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock2_1.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock3_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock3_1.id), Date.now() + 20000);
   writeInstallRDFForExtension(softblock4_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, softblock4_1.id), Date.now() + 20000);
-  writeInstallRDFForExtension(softblock5_1, profileDir);
-  setExtensionModifiedTime(getFileForAddon(profileDir, softblock5_1.id), Date.now() + 20000);
   writeInstallRDFForExtension(hardblock_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, hardblock_1.id), Date.now() + 20000);
   writeInstallRDFForExtension(regexpblock_1, profileDir);
   setExtensionModifiedTime(getFileForAddon(profileDir, regexpblock_1.id), Date.now() + 20000);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 
   s1.userDisabled = false;
   s2.userDisabled = false;
   s4.userDisabled = true;
-  s5.userDisabled = false;
 });
 
 // Add-ons are initially unblocked then attempts to upgrade to blocked versions
 // in the background which should fail
 add_task(async function run_background_update_test() {
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 
   await Pbackground_update();
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 });
 
 // Starts with add-ons blocked and then new versions are detected and installed
 // automatically for unblocked versions.
 add_task(async function run_background_update_2_test() {
   await promiseShutdownManager();
 
   getFileForAddon(profileDir, softblock1_1.id).remove(true);
   getFileForAddon(profileDir, softblock2_1.id).remove(true);
   getFileForAddon(profileDir, softblock3_1.id).remove(true);
   getFileForAddon(profileDir, softblock4_1.id).remove(true);
-  getFileForAddon(profileDir, softblock5_1.id).remove(true);
   getFileForAddon(profileDir, hardblock_1.id).remove(true);
   getFileForAddon(profileDir, regexpblock_1.id).remove(true);
 
   startupManager(false);
   await promiseShutdownManager();
 
   writeInstallRDFForExtension(softblock1_3, profileDir);
   writeInstallRDFForExtension(softblock2_3, profileDir);
   writeInstallRDFForExtension(softblock3_3, profileDir);
   writeInstallRDFForExtension(softblock4_3, profileDir);
-  writeInstallRDFForExtension(softblock5_3, profileDir);
   writeInstallRDFForExtension(hardblock_3, profileDir);
   writeInstallRDFForExtension(regexpblock_3, profileDir);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "3.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "3.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "3.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "3.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   s2.userDisabled = false;
@@ -1104,110 +990,104 @@ add_task(async function run_background_u
   s3.userDisabled = false;
   check_addon(s3, "3.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 
   await promiseRestartManager();
 
   await Pbackground_update();
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 
   s1.userDisabled = false;
   s2.userDisabled = false;
   s4.userDisabled = true;
-  s5.userDisabled = true;
 });
 
 // Starts with add-ons blocked and then simulates the user upgrading them to
 // unblocked versions.
 add_task(async function run_manual_update_test() {
   await promiseRestartManager();
   await Pload_blocklist("manual_update.xml");
   await promiseRestartManager();
 
-  let [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   s2.userDisabled = false;
   s2.userDisabled = true;
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
 
   await promiseRestartManager();
 
   await Pmanual_update("2");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "2.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s4, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
-  check_addon(s5, "2.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   // Can't manually update to a hardblocked add-on
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   await Pmanual_update("3");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, s5, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "3.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s4, "3.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
-  check_addon(s5, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 });
 
 // Starts with add-ons blocked and then new versions are installed outside of
 // the app to change them to unblocked.
 add_task(async function run_manual_update_2_test() {
   await promiseShutdownManager();
 
   getFileForAddon(profileDir, softblock1_1.id).remove(true);
   getFileForAddon(profileDir, softblock2_1.id).remove(true);
   getFileForAddon(profileDir, softblock3_1.id).remove(true);
   getFileForAddon(profileDir, softblock4_1.id).remove(true);
-  getFileForAddon(profileDir, softblock5_1.id).remove(true);
   getFileForAddon(profileDir, hardblock_1.id).remove(true);
   getFileForAddon(profileDir, regexpblock_1.id).remove(true);
 
   startupManager(false);
   await promiseShutdownManager();
 
   writeInstallRDFForExtension(softblock1_1, profileDir);
   writeInstallRDFForExtension(softblock2_1, profileDir);
   writeInstallRDFForExtension(softblock3_1, profileDir);
   writeInstallRDFForExtension(softblock4_1, profileDir);
-  writeInstallRDFForExtension(softblock5_1, profileDir);
   writeInstallRDFForExtension(hardblock_1, profileDir);
   writeInstallRDFForExtension(regexpblock_1, profileDir);
 
   startupManager(false);
 
-  let [s1, s2, s3, s4, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   s2.userDisabled = false;
@@ -1215,31 +1095,31 @@ add_task(async function run_manual_updat
   check_addon(s2, "1.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   s3.userDisabled = false;
   check_addon(s3, "1.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   await promiseRestartManager();
 
   await Pmanual_update("2");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "2.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "2.0", true, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "2.0", false, false, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   // Can't manually update to a hardblocked add-on
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 
   await promiseRestartManager();
 
   await Pmanual_update("3");
   await promiseRestartManager();
 
-  [s1, s2, s3, s4, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  [s1, s2, s3, s4, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s2, "3.0", true, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(s3, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(h, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
   check_addon(r, "3.0", false, false, Ci.nsIBlocklistService.STATE_NOT_BLOCKED);
 
   s1.userDisabled = false;
@@ -1250,36 +1130,34 @@ add_task(async function run_manual_updat
 // Uses the API to install blocked add-ons from the local filesystem
 add_task(async function run_local_install_test() {
   await promiseShutdownManager();
 
   getFileForAddon(profileDir, softblock1_1.id).remove(true);
   getFileForAddon(profileDir, softblock2_1.id).remove(true);
   getFileForAddon(profileDir, softblock3_1.id).remove(true);
   getFileForAddon(profileDir, softblock4_1.id).remove(true);
-  getFileForAddon(profileDir, softblock5_1.id).remove(true);
   getFileForAddon(profileDir, hardblock_1.id).remove(true);
   getFileForAddon(profileDir, regexpblock_1.id).remove(true);
 
   startupManager(false);
 
   await promiseInstallAllFiles([
     do_get_file("addons/blocklist_soft1_1.xpi"),
     do_get_file("addons/blocklist_soft2_1.xpi"),
     do_get_file("addons/blocklist_soft3_1.xpi"),
     do_get_file("addons/blocklist_soft4_1.xpi"),
-    do_get_file("addons/blocklist_soft5_1.xpi"),
     do_get_file("addons/blocklist_hard1_1.xpi"),
     do_get_file("addons/blocklist_regexp1_1.xpi")
   ]);
 
   let aInstalls = await AddonManager.getAllInstalls();
   // Should have finished all installs without needing to restart
   do_check_eq(aInstalls.length, 0);
 
-  let [s1, s2, s3, /* s4 */, /* s5 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
+  let [s1, s2, s3, /* s4 */, h, r] = await promiseAddonsByIDs(ADDON_IDS);
 
   check_addon(s1, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s2, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(s3, "1.0", true, true, Ci.nsIBlocklistService.STATE_SOFTBLOCKED);
   check_addon(h, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
   check_addon(r, "1.0", false, false, Ci.nsIBlocklistService.STATE_BLOCKED);
 });
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js
+++ /dev/null
@@ -1,259 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// This verifies that the themes switch as expected
-
-const PREF_GENERAL_SKINS_SELECTEDSKIN = "general.skins.selectedSkin";
-
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
-
-async function run_test() {
-  do_test_pending();
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-
-  writeInstallRDFForExtension({
-    id: "default@tests.mozilla.org",
-    version: "1.0",
-    name: "Default",
-    internalName: "classic/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
-  writeInstallRDFForExtension({
-    id: "alternate@tests.mozilla.org",
-    version: "1.0",
-    name: "Test 1",
-    type: 4,
-    internalName: "alternate/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
-  await promiseStartupManager();
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "alternate@tests.mozilla.org"], function([d, a]) {
-    do_check_neq(d, null);
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_neq(a, null);
-    do_check_true(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_false(a.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    run_test_1(d, a);
-  });
-}
-
-function end_test() {
-  do_execute_soon(do_test_finished);
-}
-
-// Checks switching to a different theme and back again leaves everything the
-// same
-function run_test_1(d, a) {
-  a.userDisabled = false;
-
-  do_check_true(d.userDisabled);
-  do_check_false(d.appDisabled);
-  do_check_true(d.isActive);
-  do_check_true(isThemeInAddonsList(profileDir, d.id));
-  do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-  do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-  do_check_false(a.userDisabled);
-  do_check_false(a.appDisabled);
-  do_check_false(a.isActive);
-  do_check_false(isThemeInAddonsList(profileDir, a.id));
-  do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-  do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  d.userDisabled = false;
-
-  do_check_false(d.userDisabled);
-  do_check_false(d.appDisabled);
-  do_check_true(d.isActive);
-  do_check_true(isThemeInAddonsList(profileDir, d.id));
-  do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-  do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-  do_check_true(a.userDisabled);
-  do_check_false(a.appDisabled);
-  do_check_false(a.isActive);
-  do_check_false(isThemeInAddonsList(profileDir, a.id));
-  do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-  do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  do_execute_soon(run_test_2);
-}
-
-// Tests that after the restart themes can be changed as expected
-function run_test_2() {
-  restartManager();
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "alternate@tests.mozilla.org"], function([d, a]) {
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    do_check_neq(d, null);
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_neq(a, null);
-    do_check_true(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_false(a.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    a.userDisabled = false;
-
-    do_check_true(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_false(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_false(a.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    d.userDisabled = false;
-
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_true(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_false(a.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    a.userDisabled = false;
-
-    do_check_true(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_false(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_false(a.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    do_execute_soon(check_test_2);
-  });
-}
-
-function check_test_2() {
-  restartManager();
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "alternate@tests.mozilla.org"], callback_soon(function([d, a]) {
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "alternate/1.0");
-
-    do_check_true(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_false(d.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_false(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_true(a.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    d.userDisabled = false;
-
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_false(d.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, d.id));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_true(a.userDisabled);
-    do_check_false(a.appDisabled);
-    do_check_true(a.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, a.id));
-    do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "alternate/1.0");
-
-    restartManager();
-
-    do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-    AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                 "alternate@tests.mozilla.org"], function([d2, a2]) {
-      do_check_neq(d2, null);
-      do_check_false(d2.userDisabled);
-      do_check_false(d2.appDisabled);
-      do_check_true(d2.isActive);
-      do_check_true(isThemeInAddonsList(profileDir, d2.id));
-      do_check_false(hasFlag(d2.permissions, AddonManager.PERM_CAN_DISABLE));
-      do_check_false(hasFlag(d2.permissions, AddonManager.PERM_CAN_ENABLE));
-
-      do_check_neq(a2, null);
-      do_check_true(a2.userDisabled);
-      do_check_false(a2.appDisabled);
-      do_check_false(a2.isActive);
-      do_check_false(isThemeInAddonsList(profileDir, a2.id));
-      do_check_false(hasFlag(a2.permissions, AddonManager.PERM_CAN_DISABLE));
-      do_check_true(hasFlag(a2.permissions, AddonManager.PERM_CAN_ENABLE));
-
-      end_test();
-    });
-  }));
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_theme.js
+++ /dev/null
@@ -1,1138 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-
-// The maximum allowable time since install. If an add-on claims to have been
-// installed longer ago than this the the test will fail.
-const MAX_INSTALL_TIME = 10000;
-
-// This verifies that themes behave as expected
-
-const PREF_GENERAL_SKINS_SELECTEDSKIN = "general.skins.selectedSkin";
-
-Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm");
-
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
-
-// Observer to ensure a "lightweight-theme-styling-update" notification is sent
-// when expected
-var gLWThemeChanged = false;
-var LightweightThemeObserver = {
-  observe(aSubject, aTopic, aData) {
-    if (aTopic != "lightweight-theme-styling-update")
-      return;
-
-    gLWThemeChanged = true;
-  }
-};
-
-AM_Cc["@mozilla.org/observer-service;1"]
-     .getService(Components.interfaces.nsIObserverService)
-     .addObserver(LightweightThemeObserver, "lightweight-theme-styling-update");
-
-
-async function run_test() {
-  do_test_pending();
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-
-  Services.prefs.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN, "theme1/1.0");
-  writeInstallRDFForExtension({
-    id: "theme1@tests.mozilla.org",
-    version: "1.0",
-    name: "Test 1",
-    type: 4,
-    skinnable: true,
-    internalName: "theme1/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
-  writeInstallRDFForExtension({
-    id: "theme2@tests.mozilla.org",
-    version: "1.0",
-    name: "Test 1",
-    skinnable: false,
-    internalName: "theme2/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
-  // We need a default theme for some of these things to work but we have hidden
-  // the one in the application directory.
-  writeInstallRDFForExtension({
-    id: "default@tests.mozilla.org",
-    version: "1.0",
-    name: "Default",
-    internalName: "classic/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
-  await promiseStartupManager();
-  // Make sure we only register once despite multiple calls
-  AddonManager.addInstallListener(InstallListener);
-  AddonManager.addAddonListener(AddonListener);
-  AddonManager.addInstallListener(InstallListener);
-  AddonManager.addAddonListener(AddonListener);
-  AddonManager.addInstallListener(InstallListener);
-
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "theme1@tests.mozilla.org",
-                               "theme2@tests.mozilla.org"],
-                               function([d, t1, t2]) {
-    do_check_neq(d, null);
-    do_check_false(d.skinnable);
-    do_check_false(d.foreignInstall);
-    do_check_eq(d.signedState, undefined);
-
-    do_check_neq(t1, null);
-    do_check_false(t1.userDisabled);
-    do_check_false(t1.appDisabled);
-    do_check_eq(t1.signedState, undefined);
-    do_check_true(t1.isActive);
-    do_check_true(t1.skinnable);
-    do_check_true(t1.foreignInstall);
-    do_check_eq(t1.screenshots, null);
-    do_check_true(isThemeInAddonsList(profileDir, t1.id));
-    do_check_false(hasFlag(t1.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(t1.permissions, AddonManager.PERM_CAN_ENABLE));
-    do_check_eq(t1.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_UNINSTALL |
-                                               AddonManager.OP_NEEDS_RESTART_DISABLE);
-
-    do_check_neq(t2, null);
-    do_check_true(t2.userDisabled);
-    do_check_false(t2.appDisabled);
-    do_check_eq(t2.signedState, undefined);
-    do_check_false(t2.isActive);
-    do_check_false(t2.skinnable);
-    do_check_true(t2.foreignInstall);
-    do_check_eq(t2.screenshots, null);
-    do_check_false(isThemeInAddonsList(profileDir, t2.id));
-    do_check_false(hasFlag(t2.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(t2.permissions, AddonManager.PERM_CAN_ENABLE));
-    do_check_eq(t2.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_ENABLE);
-
-    do_execute_soon(run_test_1);
-  });
-}
-
-function end_test() {
-  do_execute_soon(do_test_finished);
-}
-
-// Checks enabling one theme disables the others
-function run_test_1() {
-  prepare_test({
-    "theme1@tests.mozilla.org": [
-      "onDisabling"
-    ],
-    "theme2@tests.mozilla.org": [
-      "onEnabling"
-    ]
-  });
-  AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([t1, t2]) {
-    t2.userDisabled = false;
-
-    ensure_test_completed();
-    do_check_false(hasFlag(t2.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(t2.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_true(t1.userDisabled);
-    do_check_false(hasFlag(t1.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(t1.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_execute_soon(check_test_1);
-  });
-}
-
-async function check_test_1() {
-  await promiseRestartManager();
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme2/1.0");
-
-  AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([t1, t2]) {
-    do_check_neq(t1, null);
-    do_check_true(t1.userDisabled);
-    do_check_false(t1.appDisabled);
-    do_check_false(t1.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, t1.id));
-    do_check_false(hasFlag(t1.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(t1.permissions, AddonManager.PERM_CAN_ENABLE));
-    do_check_eq(t1.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_ENABLE);
-
-    do_check_neq(t2, null);
-    do_check_false(t2.userDisabled);
-    do_check_false(t2.appDisabled);
-    do_check_true(t2.isActive);
-    do_check_true(isThemeInAddonsList(profileDir, t2.id));
-    do_check_false(hasFlag(t2.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_false(hasFlag(t2.permissions, AddonManager.PERM_CAN_ENABLE));
-    do_check_eq(t2.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_UNINSTALL |
-                                               AddonManager.OP_NEEDS_RESTART_DISABLE);
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(run_test_2);
-  });
-}
-
-// Removing the active theme should fall back to the default (not ideal in this
-// case since we don't have the default theme installed)
-async function run_test_2() {
-  var dest = profileDir.clone();
-  dest.append(do_get_expected_addon_name("theme2@tests.mozilla.org"));
-  dest.remove(true);
-
-  await promiseRestartManager();
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([t1, t2]) {
-    do_check_neq(t1, null);
-    do_check_true(t1.userDisabled);
-    do_check_false(t1.appDisabled);
-    do_check_false(t1.isActive);
-    do_check_false(isThemeInAddonsList(profileDir, t1.id));
-    do_check_false(hasFlag(t1.permissions, AddonManager.PERM_CAN_DISABLE));
-    do_check_true(hasFlag(t1.permissions, AddonManager.PERM_CAN_ENABLE));
-
-    do_check_eq(t2, null);
-    do_check_false(isThemeInAddonsList(profileDir, "theme2@tests.mozilla.org"));
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(run_test_3);
-  });
-}
-
-// Installing a lightweight theme should happen instantly and disable the default theme
-function run_test_3() {
-  writeInstallRDFForExtension({
-    id: "theme2@tests.mozilla.org",
-    version: "1.0",
-    name: "Test 1",
-    internalName: "theme2/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-  restartManager();
-
-  prepare_test({
-    "1@personas.mozilla.org": [
-      ["onInstalling", false],
-      "onInstalled",
-      ["onEnabling", false],
-      "onEnabled"
-    ],
-    "default@tests.mozilla.org": [
-      ["onDisabling", false],
-      "onDisabled",
-    ]
-  }, [
-    "onExternalInstall"
-  ]);
-
-  LightweightThemeManager.currentTheme = {
-    id: "1",
-    version: "1",
-    name: "Test LW Theme",
-    description: "A test theme",
-    author: "Mozilla",
-    homepageURL: "http://localhost/data/index.html",
-    headerURL: "http://localhost/data/header.png",
-    footerURL: "http://localhost/data/footer.png",
-    previewURL: "http://localhost/data/preview.png",
-    iconURL: "http://localhost/data/icon.png"
-  };
-
-  ensure_test_completed();
-
-  AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
-    do_check_neq(null, p1);
-    do_check_eq(p1.name, "Test LW Theme");
-    do_check_eq(p1.version, "1");
-    do_check_eq(p1.type, "theme");
-    do_check_eq(p1.description, "A test theme");
-    do_check_eq(p1.creator, "Mozilla");
-    do_check_eq(p1.homepageURL, "http://localhost/data/index.html");
-    do_check_eq(p1.iconURL, "http://localhost/data/icon.png");
-    do_check_eq(p1.screenshots.length, 1);
-    do_check_eq(p1.screenshots[0], "http://localhost/data/preview.png");
-    do_check_false(p1.appDisabled);
-    do_check_false(p1.userDisabled);
-    do_check_true(p1.isCompatible);
-    do_check_true(p1.providesUpdatesSecurely);
-    do_check_eq(p1.blocklistState, 0);
-    do_check_true(p1.isActive);
-    do_check_eq(p1.pendingOperations, 0);
-    do_check_eq(p1.permissions, AddonManager.PERM_CAN_UNINSTALL | AddonManager.PERM_CAN_DISABLE);
-    do_check_eq(p1.scope, AddonManager.SCOPE_PROFILE);
-    do_check_true("isCompatibleWith" in p1);
-    do_check_true("findUpdates" in p1);
-    do_check_eq(p1.installDate.getTime(), p1.updateDate.getTime());
-
-    // Should have been installed sometime in the last few seconds.
-    let difference = Date.now() - p1.installDate.getTime();
-    if (difference > MAX_INSTALL_TIME)
-      do_throw("Add-on was installed " + difference + "ms ago");
-    else if (difference < 0)
-      do_throw("Add-on was installed " + difference + "ms in the future");
-
-    AddonManager.getAddonsByTypes(["theme"], function(addons) {
-      let seen = false;
-      addons.forEach(function(a) {
-        if (a.id == "1@personas.mozilla.org") {
-          seen = true;
-        } else {
-          dump("Checking theme " + a.id + "\n");
-          do_check_false(a.isActive);
-          do_check_true(a.userDisabled);
-        }
-      });
-      do_check_true(seen);
-
-      do_check_true(gLWThemeChanged);
-      gLWThemeChanged = false;
-
-      do_execute_soon(run_test_4);
-    });
-  });
-}
-
-// Installing a second lightweight theme should disable the first with no restart
-function run_test_4() {
-  prepare_test({
-    "1@personas.mozilla.org": [
-      ["onDisabling", false],
-      "onDisabled",
-    ],
-    "2@personas.mozilla.org": [
-      ["onInstalling", false],
-      "onInstalled",
-      ["onEnabling", false],
-      "onEnabled"
-    ]
-  }, [
-    "onExternalInstall"
-  ]);
-
-  LightweightThemeManager.currentTheme = {
-    id: "2",
-    version: "1",
-    name: "Test LW Theme",
-    description: "A second test theme",
-    author: "Mozilla",
-    homepageURL: "http://localhost/data/index.html",
-    headerURL: "http://localhost/data/header.png",
-    footerURL: "http://localhost/data/footer.png",
-    previewURL: "http://localhost/data/preview.png",
-    iconURL: "http://localhost/data/icon.png"
-  };
-
-  ensure_test_completed();
-
-  AddonManager.getAddonsByIDs(["1@personas.mozilla.org",
-                               "2@personas.mozilla.org"], function([p1, p2]) {
-    do_check_neq(null, p2);
-    do_check_false(p2.appDisabled);
-    do_check_false(p2.userDisabled);
-    do_check_true(p2.isActive);
-    do_check_eq(p2.pendingOperations, 0);
-    do_check_eq(p2.permissions, AddonManager.PERM_CAN_UNINSTALL | AddonManager.PERM_CAN_DISABLE);
-    do_check_eq(p2.installDate.getTime(), p2.updateDate.getTime());
-
-    // Should have been installed sometime in the last few seconds.
-    let difference = Date.now() - p2.installDate.getTime();
-    if (difference > MAX_INSTALL_TIME)
-      do_throw("Add-on was installed " + difference + "ms ago");
-    else if (difference < 0)
-      do_throw("Add-on was installed " + difference + "ms in the future");
-
-    do_check_neq(null, p1);
-    do_check_false(p1.appDisabled);
-    do_check_true(p1.userDisabled);
-    do_check_false(p1.isActive);
-    do_check_eq(p1.pendingOperations, 0);
-    do_check_eq(p1.permissions, AddonManager.PERM_CAN_UNINSTALL | AddonManager.PERM_CAN_ENABLE);
-
-    AddonManager.getAddonsByTypes(["theme"], function(addons) {
-      let seen = false;
-      addons.forEach(function(a) {
-        if (a.id == "2@personas.mozilla.org") {
-          seen = true;
-        } else {
-          dump("Checking theme " + a.id + "\n");
-          do_check_false(a.isActive);
-          do_check_true(a.userDisabled);
-        }
-      });
-      do_check_true(seen);
-
-      do_check_true(gLWThemeChanged);
-      gLWThemeChanged = false;
-
-      do_execute_soon(run_test_5);
-    });
-  });
-}
-
-// Switching to a custom theme should disable the lightweight theme and require
-// a restart. Cancelling that should also be possible.
-function run_test_5() {
-  prepare_test({
-    "2@personas.mozilla.org": [
-      "onDisabling",
-    ],
-    "theme2@tests.mozilla.org": [
-      "onEnabling"
-    ]
-  });
-
-  AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([p2, t2]) {
-    t2.userDisabled = false;
-
-    ensure_test_completed();
-
-    prepare_test({
-      "2@personas.mozilla.org": [
-        "onOperationCancelled",
-      ],
-      "theme2@tests.mozilla.org": [
-        "onOperationCancelled"
-      ]
-    });
-
-    p2.userDisabled = false;
-
-    ensure_test_completed();
-
-    prepare_test({
-      "2@personas.mozilla.org": [
-        "onDisabling",
-      ],
-      "theme2@tests.mozilla.org": [
-        "onEnabling"
-      ]
-    });
-
-    t2.userDisabled = false;
-
-    ensure_test_completed();
-
-    do_check_false(t2.isActive);
-    do_check_false(t2.userDisabled);
-    do_check_true(hasFlag(AddonManager.PENDING_ENABLE, t2.pendingOperations));
-    do_check_true(p2.isActive);
-    do_check_true(p2.userDisabled);
-    do_check_true(hasFlag(AddonManager.PENDING_DISABLE, p2.pendingOperations));
-    do_check_true(hasFlag(AddonManager.PERM_CAN_ENABLE, p2.permissions));
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(check_test_5);
-  });
-}
-
-function check_test_5() {
-  restartManager();
-
-  AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([p2, t2]) {
-    do_check_true(t2.isActive);
-    do_check_false(t2.userDisabled);
-    do_check_false(hasFlag(AddonManager.PENDING_ENABLE, t2.pendingOperations));
-    do_check_false(p2.isActive);
-    do_check_true(p2.userDisabled);
-    do_check_false(hasFlag(AddonManager.PENDING_DISABLE, p2.pendingOperations));
-
-    do_check_true(gLWThemeChanged);
-    gLWThemeChanged = false;
-
-    do_execute_soon(run_test_6);
-  });
-}
-
-// Switching from a custom theme to a lightweight theme should require a restart
-function run_test_6() {
-  prepare_test({
-    "2@personas.mozilla.org": [
-      "onEnabling",
-    ],
-    "theme2@tests.mozilla.org": [
-      "onDisabling"
-    ]
-  });
-
-  AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([p2, t2]) {
-    p2.userDisabled = false;
-
-    ensure_test_completed();
-
-    prepare_test({
-      "2@personas.mozilla.org": [
-        "onOperationCancelled",
-      ],
-      "theme2@tests.mozilla.org": [
-        "onOperationCancelled"
-      ]
-    });
-
-    t2.userDisabled = false;
-
-    ensure_test_completed();
-
-    prepare_test({
-      "2@personas.mozilla.org": [
-        "onEnabling",
-      ],
-      "theme2@tests.mozilla.org": [
-        "onDisabling"
-      ]
-    });
-
-    p2.userDisabled = false;
-
-    ensure_test_completed();
-
-    do_check_false(p2.isActive);
-    do_check_false(p2.userDisabled);
-    do_check_true(hasFlag(AddonManager.PENDING_ENABLE, p2.pendingOperations));
-    do_check_true(t2.isActive);
-    do_check_true(t2.userDisabled);
-    do_check_true(hasFlag(AddonManager.PENDING_DISABLE, t2.pendingOperations));
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(check_test_6);
-  });
-}
-
-function check_test_6() {
-  restartManager();
-
-  AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
-                               "theme2@tests.mozilla.org"], function([p2, t2]) {
-    do_check_true(p2.isActive);
-    do_check_false(p2.userDisabled);
-    do_check_false(hasFlag(AddonManager.PENDING_ENABLE, p2.pendingOperations));
-    do_check_false(t2.isActive);
-    do_check_true(t2.userDisabled);
-    do_check_false(hasFlag(AddonManager.PENDING_DISABLE, t2.pendingOperations));
-
-    do_check_true(gLWThemeChanged);
-    gLWThemeChanged = false;
-
-    do_execute_soon(run_test_7);
-  });
-}
-
-// Uninstalling a lightweight theme should not require a restart
-function run_test_7() {
-  prepare_test({
-    "1@personas.mozilla.org": [
-      ["onUninstalling", false],
-      "onUninstalled"
-    ]
-  });
-
-  AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
-    p1.uninstall();
-
-    ensure_test_completed();
-    do_check_eq(LightweightThemeManager.usedThemes.length, 1);
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(run_test_8);
-  });
-}
-
-// Uninstalling a lightweight theme in use should not require a restart and it
-// should reactivate the default theme
-// Also, uninstalling a lightweight theme in use should send a
-// "lightweight-theme-styling-update" notification through the observer service
-function run_test_8() {
-  prepare_test({
-    "2@personas.mozilla.org": [
-      ["onUninstalling", false],
-      "onUninstalled"
-    ],
-    "default@tests.mozilla.org": [
-      ["onEnabling", false],
-      "onEnabled"
-    ]
-  });
-
-  AddonManager.getAddonByID("2@personas.mozilla.org", function(p2) {
-    p2.uninstall();
-
-    ensure_test_completed();
-    do_check_eq(LightweightThemeManager.usedThemes.length, 0);
-
-    do_check_true(gLWThemeChanged);
-    gLWThemeChanged = false;
-
-    do_execute_soon(run_test_9);
-  });
-}
-
-// Uninstalling a theme not in use should not require a restart
-function run_test_9() {
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
-    prepare_test({
-      "theme1@tests.mozilla.org": [
-        ["onUninstalling", false],
-        "onUninstalled"
-      ]
-    });
-
-    t1.uninstall();
-
-    ensure_test_completed();
-
-    AddonManager.getAddonByID("theme1@tests.mozilla.org", function(newt1) {
-      do_check_eq(newt1, null);
-      do_check_false(gLWThemeChanged);
-
-      do_execute_soon(run_test_10);
-    });
-  });
-}
-
-// Uninstalling a custom theme in use should require a restart
-function run_test_10() {
-  AddonManager.getAddonByID("theme2@tests.mozilla.org", callback_soon(function(oldt2) {
-    prepare_test({
-      "theme2@tests.mozilla.org": [
-        "onEnabling",
-      ],
-      "default@tests.mozilla.org": [
-        "onDisabling"
-      ]
-    });
-
-    oldt2.userDisabled = false;
-
-    ensure_test_completed();
-
-    restartManager();
-
-    AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                 "theme2@tests.mozilla.org"], function([d, t2]) {
-      do_check_true(t2.isActive);
-      do_check_false(t2.userDisabled);
-      do_check_false(t2.appDisabled);
-      do_check_false(d.isActive);
-      do_check_true(d.userDisabled);
-      do_check_false(d.appDisabled);
-
-      prepare_test({
-        "theme2@tests.mozilla.org": [
-          "onUninstalling",
-        ],
-        "default@tests.mozilla.org": [
-          "onEnabling"
-        ]
-      });
-
-      t2.uninstall();
-
-      ensure_test_completed();
-      do_check_false(gLWThemeChanged);
-
-      do_execute_soon(run_test_11);
-    });
-  }));
-}
-
-// Installing a custom theme not in use should not require a restart
-function run_test_11() {
-  restartManager();
-
-  prepare_test({ }, [
-    "onNewInstall"
-  ]);
-
-  AddonManager.getInstallForFile(do_get_addon("test_theme"), function(install) {
-    ensure_test_completed();
-
-    do_check_neq(install, null);
-    do_check_eq(install.type, "theme");
-    do_check_eq(install.version, "1.0");
-    do_check_eq(install.name, "Test Theme 1");
-    do_check_eq(install.state, AddonManager.STATE_DOWNLOADED);
-    do_check_true(install.addon.skinnable, true);
-    do_check_false(hasFlag(install.addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_INSTALL));
-
-    prepare_test({
-      "theme1@tests.mozilla.org": [
-        ["onInstalling", false],
-        "onInstalled"
-      ]
-    }, [
-      "onInstallStarted",
-      "onInstallEnded",
-    ], check_test_11);
-    install.install();
-  });
-}
-
-function check_test_11() {
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
-    do_check_neq(t1, null);
-    var previewSpec = do_get_addon_root_uri(profileDir, "theme1@tests.mozilla.org") + "preview.png";
-    do_check_eq(t1.screenshots.length, 1);
-    do_check_eq(t1.screenshots[0], previewSpec);
-    do_check_true(t1.skinnable);
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(run_test_12);
-  });
-}
-
-// Updating a custom theme not in use should not require a restart
-function run_test_12() {
-  prepare_test({ }, [
-    "onNewInstall"
-  ]);
-
-  AddonManager.getInstallForFile(do_get_addon("test_theme"), function(install) {
-    ensure_test_completed();
-
-    do_check_neq(install, null);
-    do_check_eq(install.type, "theme");
-    do_check_eq(install.version, "1.0");
-    do_check_eq(install.name, "Test Theme 1");
-    do_check_eq(install.state, AddonManager.STATE_DOWNLOADED);
-    do_check_false(hasFlag(install.addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_INSTALL));
-
-    prepare_test({
-      "theme1@tests.mozilla.org": [
-        ["onInstalling", false],
-        "onInstalled"
-      ]
-    }, [
-      "onInstallStarted",
-      "onInstallEnded",
-    ], check_test_12);
-    install.install();
-  });
-}
-
-function check_test_12() {
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
-    do_check_neq(t1, null);
-    do_check_false(gLWThemeChanged);
-
-    do_execute_soon(run_test_13);
-  });
-}
-
-// Updating a custom theme in use should require a restart
-function run_test_13() {
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
-    prepare_test({
-      "theme1@tests.mozilla.org": [
-        "onEnabling",
-      ],
-      "default@tests.mozilla.org": [
-        "onDisabling"
-      ]
-    });
-
-    t1.userDisabled = false;
-    ensure_test_completed();
-    restartManager();
-
-    prepare_test({ }, [
-      "onNewInstall"
-    ]);
-
-    AddonManager.getInstallForFile(do_get_addon("test_theme"), function(install) {
-      ensure_test_completed();
-
-      do_check_neq(install, null);
-      do_check_eq(install.type, "theme");
-      do_check_eq(install.version, "1.0");
-      do_check_eq(install.name, "Test Theme 1");
-      do_check_eq(install.state, AddonManager.STATE_DOWNLOADED);
-      do_check_true(hasFlag(install.addon.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_INSTALL));
-
-      prepare_test({
-        "theme1@tests.mozilla.org": [
-          "onInstalling",
-        ]
-      }, [
-        "onInstallStarted",
-        "onInstallEnded",
-      ], callback_soon(check_test_13));
-      install.install();
-    });
-  }));
-}
-
-function check_test_13() {
-  restartManager();
-
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
-    do_check_neq(t1, null);
-    do_check_true(t1.isActive);
-    do_check_false(gLWThemeChanged);
-    t1.uninstall();
-    restartManager();
-
-    do_execute_soon(run_test_14);
-  }));
-}
-
-// Switching from a lightweight theme to the default theme should not require
-// a restart
-function run_test_14() {
-  LightweightThemeManager.currentTheme = {
-    id: "1",
-    version: "1",
-    name: "Test LW Theme",
-    description: "A test theme",
-    author: "Mozilla",
-    homepageURL: "http://localhost/data/index.html",
-    headerURL: "http://localhost/data/header.png",
-    footerURL: "http://localhost/data/footer.png",
-    previewURL: "http://localhost/data/preview.png",
-    iconURL: "http://localhost/data/icon.png"
-  };
-
-  AddonManager.getAddonByID("default@tests.mozilla.org", function(d) {
-    do_check_true(d.userDisabled);
-    do_check_false(d.isActive);
-
-    prepare_test({
-      "1@personas.mozilla.org": [
-        ["onDisabling", false],
-        "onDisabled"
-      ],
-      "default@tests.mozilla.org": [
-        ["onEnabling", false],
-        "onEnabled"
-      ]
-    });
-
-    d.userDisabled = false;
-    ensure_test_completed();
-
-    do_check_false(d.userDisabled);
-    do_check_true(d.isActive);
-
-    do_check_true(gLWThemeChanged);
-    gLWThemeChanged = false;
-
-    do_execute_soon(run_test_15);
-  });
-}
-
-// Upgrading the application with a custom theme in use should not disable it
-function run_test_15() {
-  restartManager();
-
-  installAllFiles([do_get_addon("test_theme")], function() {
-    AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
-      t1.userDisabled = false;
-
-      restartManager();
-
-      do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1/1.0");
-      AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                   "theme1@tests.mozilla.org"],
-                                   callback_soon(function([d_2, t1_2]) {
-        do_check_true(d_2.userDisabled);
-        do_check_false(d_2.appDisabled);
-        do_check_false(d_2.isActive);
-
-        do_check_false(t1_2.userDisabled);
-        do_check_false(t1_2.appDisabled);
-        do_check_true(t1_2.isActive);
-
-        restartManager("2");
-
-        do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1/1.0");
-        AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                     "theme1@tests.mozilla.org"], function([d_3, t1_3]) {
-          do_check_true(d_3.userDisabled);
-          do_check_false(d_3.appDisabled);
-          do_check_false(d_3.isActive);
-
-          do_check_false(t1_3.userDisabled);
-          do_check_false(t1_3.appDisabled);
-          do_check_true(t1_3.isActive);
-
-          do_execute_soon(run_test_16);
-        });
-      }));
-    }));
-  });
-}
-
-// Upgrading the application with a custom theme in use should disable it if it
-// is no longer compatible
-function run_test_16() {
-  restartManager("3");
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "theme1@tests.mozilla.org"], function([d, t1]) {
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-
-    do_check_true(t1.userDisabled);
-    do_check_true(t1.appDisabled);
-    do_check_false(t1.isActive);
-
-    do_execute_soon(run_test_17);
-  });
-}
-
-// Verifies that if the selected theme pref is changed by a different version
-// of the application that we correctly reset it when it points to an
-// incompatible theme
-function run_test_17() {
-  restartManager("2");
-  shutdownManager();
-
-  Services.prefs.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN, "theme1/1.0");
-
-  restartManager("3");
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "theme1@tests.mozilla.org"], function([d, t1]) {
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-
-    do_check_true(t1.userDisabled);
-    do_check_true(t1.appDisabled);
-    do_check_false(t1.isActive);
-
-    do_execute_soon(run_test_18);
-  });
-}
-
-// Disabling the active theme should switch back to the default theme
-function run_test_18() {
-  restartManager(2);
-
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
-    t1.userDisabled = false;
-
-    restartManager();
-
-    AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                 "theme1@tests.mozilla.org"],
-                                 callback_soon(function([d_2, t1_2]) {
-      do_check_true(d_2.userDisabled);
-      do_check_false(d_2.appDisabled);
-      do_check_false(d_2.isActive);
-
-      do_check_false(t1_2.userDisabled);
-      do_check_false(t1_2.appDisabled);
-      do_check_true(t1_2.isActive);
-
-      prepare_test({
-        "theme1@tests.mozilla.org": [
-          "onDisabling",
-        ],
-        "default@tests.mozilla.org": [
-          "onEnabling",
-        ]
-      });
-      t1_2.userDisabled = true;
-      ensure_test_completed();
-
-      do_check_false(d_2.userDisabled);
-      do_check_false(d_2.appDisabled);
-      do_check_false(d_2.isActive);
-
-      do_check_true(t1_2.userDisabled);
-      do_check_false(t1_2.appDisabled);
-      do_check_true(t1_2.isActive);
-
-      restartManager();
-
-      AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                   "theme1@tests.mozilla.org"], function([d_3, t1_3]) {
-        do_check_false(d_3.userDisabled);
-        do_check_false(d_3.appDisabled);
-        do_check_true(d_3.isActive);
-
-        do_check_true(t1_3.userDisabled);
-        do_check_false(t1_3.appDisabled);
-        do_check_false(t1_3.isActive);
-
-        do_execute_soon(run_test_19);
-      });
-    }));
-  }));
-}
-
-// Disabling the active persona should switch back to the default theme
-function run_test_19() {
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "1@personas.mozilla.org"], function([d, p1]) {
-    p1.userDisabled = false;
-
-    do_check_true(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_false(d.isActive);
-
-    do_check_false(p1.userDisabled);
-    do_check_false(p1.appDisabled);
-    do_check_true(p1.isActive);
-
-    prepare_test({
-      "1@personas.mozilla.org": [
-        ["onDisabling", false],
-        "onDisabled"
-      ],
-      "default@tests.mozilla.org": [
-        ["onEnabling", false],
-        "onEnabled"
-      ]
-    });
-    p1.userDisabled = true;
-    ensure_test_completed();
-
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-
-    do_check_true(p1.userDisabled);
-    do_check_false(p1.appDisabled);
-    do_check_false(p1.isActive);
-
-    do_execute_soon(run_test_20);
-  });
-}
-
-// Tests that you cannot disable the default theme
-function run_test_20() {
-  AddonManager.getAddonByID("default@tests.mozilla.org", function(d) {
-    do_check_false(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_true(d.isActive);
-
-    try {
-      d.userDisabled = true;
-      do_throw("Disabling the default theme should throw an exception");
-    } catch (e) {
-    }
-
-    do_execute_soon(run_test_21);
-  });
-}
-
-// Tests that cached copies of a lightweight theme have the right permissions
-// and pendingOperations during the onEnabling event
-function run_test_21() {
-  AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
-    // Switch to a custom theme so we can test pendingOperations properly.
-
-    prepare_test({
-      "theme1@tests.mozilla.org": [
-        "onEnabling"
-      ],
-      "default@tests.mozilla.org": [
-        "onDisabling"
-      ]
-    });
-
-    t1.userDisabled = false;
-    ensure_test_completed();
-
-    restartManager();
-
-    AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
-      AddonManager.addAddonListener({
-        onEnabling(aAddon) {
-          do_check_false(hasFlag(aAddon.permissions, AddonManager.PERM_CAN_ENABLE));
-          do_check_true(hasFlag(aAddon.pendingOperations, AddonManager.PENDING_ENABLE));
-
-          do_check_eq(aAddon.permissions, p1.permissions);
-          do_check_eq(aAddon.pendingOperations, p1.pendingOperations);
-        }
-      });
-
-      prepare_test({
-        "1@personas.mozilla.org": [
-          "onEnabling"
-        ],
-        "theme1@tests.mozilla.org": [
-          "onDisabling"
-        ]
-      });
-
-      p1.userDisabled = false;
-      ensure_test_completed();
-
-      run_test_22();
-    });
-  }));
-}
-
-// Detecting a new add-on during the startup file check should not disable an
-// active lightweight theme
-function run_test_22() {
-  restartManager();
-
-  AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                               "1@personas.mozilla.org"], function([d, p1]) {
-    do_check_true(d.userDisabled);
-    do_check_false(d.appDisabled);
-    do_check_false(d.isActive);
-
-    do_check_false(p1.userDisabled);
-    do_check_false(p1.appDisabled);
-    do_check_true(p1.isActive);
-
-    writeInstallRDFForExtension({
-      id: "theme3@tests.mozilla.org",
-      version: "1.0",
-      name: "Test 3",
-      internalName: "theme3/1.0",
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "2"
-      }]
-    }, profileDir);
-
-    restartManager();
-
-    AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
-                                 "1@personas.mozilla.org"], function([d_2, p1_2]) {
-      do_check_true(d_2.userDisabled);
-      do_check_false(d_2.appDisabled);
-      do_check_false(d_2.isActive);
-
-      do_check_false(p1_2.userDisabled);
-      do_check_false(p1_2.appDisabled);
-      do_check_true(p1_2.isActive);
-
-      end_test();
-    });
-  });
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_undothemeuninstall.js
+++ /dev/null
@@ -1,479 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// This verifies that forcing undo for uninstall works for themes
-Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm");
-
-const PREF_GENERAL_SKINS_SELECTEDSKIN = "general.skins.selectedSkin";
-
-var defaultTheme = {
-  id: "default@tests.mozilla.org",
-  version: "1.0",
-  name: "Test 1",
-  internalName: "classic/1.0",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "1"
-  }]
-};
-
-var theme1 = {
-  id: "theme1@tests.mozilla.org",
-  version: "1.0",
-  name: "Test 1",
-  internalName: "theme1",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1",
-    maxVersion: "1"
-  }]
-};
-
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
-
-// Sets up the profile by installing an add-on.
-function run_test() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-
-  startupManager();
-  do_register_cleanup(promiseShutdownManager);
-
-  run_next_test();
-}
-
-add_task(async function checkDefault() {
-  writeInstallRDFForExtension(defaultTheme, profileDir);
-  await promiseRestartManager();
-
-  let d = await promiseAddonByID("default@tests.mozilla.org");
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-});
-
-// Tests that uninstalling an enabled theme offers the option to undo
-add_task(async function uninstallEnabledOffersUndo() {
-  writeInstallRDFForExtension(theme1, profileDir);
-
-  await promiseRestartManager();
-
-  let t1 = await promiseAddonByID("theme1@tests.mozilla.org");
-
-  do_check_neq(t1, null);
-  do_check_true(t1.userDisabled);
-
-  t1.userDisabled = false;
-
-  await promiseRestartManager();
-
-  let d = null;
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_true(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1");
-
-  prepare_test({
-    "default@tests.mozilla.org": [
-      "onEnabling"
-    ],
-    "theme1@tests.mozilla.org": [
-      "onUninstalling"
-    ]
-  });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_ENABLE);
-
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_true(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1");
-
-  await promiseRestartManager();
-
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(t1, null);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-});
-
-// Tests that uninstalling an enabled theme can be undone
-add_task(async function canUndoUninstallEnabled() {
-  writeInstallRDFForExtension(theme1, profileDir);
-
-  await promiseRestartManager();
-
-  let t1 = await promiseAddonByID("theme1@tests.mozilla.org");
-
-  do_check_neq(t1, null);
-  do_check_true(t1.userDisabled);
-
-  t1.userDisabled = false;
-
-  await promiseRestartManager();
-
-  let d = null;
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_true(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1");
-
-  prepare_test({
-    "default@tests.mozilla.org": [
-      "onEnabling"
-    ],
-    "theme1@tests.mozilla.org": [
-      "onUninstalling"
-    ]
-  });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_ENABLE);
-
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_true(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1");
-
-  prepare_test({
-    "default@tests.mozilla.org": [
-      "onOperationCancelled"
-    ],
-    "theme1@tests.mozilla.org": [
-      "onOperationCancelled"
-    ]
-  });
-  t1.cancelUninstall();
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_true(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  await promiseRestartManager();
-
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_true(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1");
-
-  t1.uninstall();
-  await promiseRestartManager();
-});
-
-// Tests that uninstalling a disabled theme offers the option to undo
-add_task(async function uninstallDisabledOffersUndo() {
-  writeInstallRDFForExtension(theme1, profileDir);
-
-  await promiseRestartManager();
-
-  let [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                            "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({
-    "theme1@tests.mozilla.org": [
-      "onUninstalling"
-    ]
-  });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_true(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  await promiseRestartManager();
-
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(t1, null);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-});
-
-// Tests that uninstalling a disabled theme can be undone
-add_task(async function canUndoUninstallDisabled() {
-  writeInstallRDFForExtension(theme1, profileDir);
-
-  await promiseRestartManager();
-
-  let [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                            "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({
-    "theme1@tests.mozilla.org": [
-      "onUninstalling"
-    ]
-  });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_true(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({
-    "theme1@tests.mozilla.org": [
-      "onOperationCancelled"
-    ]
-  });
-  t1.cancelUninstall();
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  await promiseRestartManager();
-
-  [ t1, d ] = await promiseAddonsByIDs(["theme1@tests.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_false(t1.isActive);
-  do_check_true(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  t1.uninstall();
-  await promiseRestartManager();
-});
-
-add_task(async function uninstallWebExtensionOffersUndo() {
-  let { id: addonId } = await promiseInstallWebExtension({
-    manifest: {
-      "author": "Some author",
-      manifest_version: 2,
-      name: "Web Extension Name",
-      version: "1.0",
-      theme: { images: { headerURL: "example.png" } },
-    }
-  });
-
-  let [ t1, d ] = await promiseAddonsByIDs([addonId, "default@tests.mozilla.org"]);
-
-  Assert.ok(t1, "Addon should be there");
-  Assert.ok(!t1.isActive);
-  Assert.ok(t1.userDisabled);
-  Assert.equal(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  Assert.ok(d, "Addon should be there");
-  Assert.ok(d.isActive);
-  Assert.ok(!d.userDisabled);
-  Assert.equal(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  Assert.equal(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({ [addonId]: [ "onUninstalling" ] });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  Assert.ok(!t1.isActive);
-  Assert.ok(t1.userDisabled);
-  Assert.ok(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  Assert.equal(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({
-    [addonId]: [
-      "onOperationCancelled"
-    ]
-  });
-  t1.cancelUninstall();
-  ensure_test_completed();
-
-  Assert.ok(!t1.isActive);
-  Assert.ok(t1.userDisabled);
-  Assert.equal(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  await promiseRestartManager();
-
-  [ t1, d ] = await promiseAddonsByIDs([addonId, "default@tests.mozilla.org"]);
-
-  Assert.ok(d);
-  Assert.ok(d.isActive);
-  Assert.ok(!d.userDisabled);
-  Assert.equal(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  Assert.ok(t1);
-  Assert.ok(!t1.isActive);
-  Assert.ok(t1.userDisabled);
-  Assert.equal(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  Assert.equal(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  t1.uninstall();
-  await promiseRestartManager();
-});
-
-// Tests that uninstalling an enabled lightweight theme offers the option to undo
-add_task(async function uninstallLWTOffersUndo() {
-  // skipped since lightweight themes don't support undoable uninstall yet
-
-  /*
-  LightweightThemeManager.currentTheme = dummyLWTheme("theme1");
-
-  let [ t1, d ] = yield promiseAddonsByIDs(["theme1@personas.mozilla.org",
-                                            "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_true(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_neq(t1, null);
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  prepare_test({
-    "default@tests.mozilla.org": [
-      "onEnabling"
-    ],
-    "theme1@personas.mozilla.org": [
-      "onUninstalling"
-    ]
-  });
-  t1.uninstall(true);
-  ensure_test_completed();
-
-  do_check_neq(d, null);
-  do_check_false(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_ENABLE);
-
-  do_check_true(t1.isActive);
-  do_check_false(t1.userDisabled);
-  do_check_true(hasFlag(t1.pendingOperations, AddonManager.PENDING_UNINSTALL));
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-
-  yield promiseRestartManager();
-
-  [ t1, d ] = yield promiseAddonsByIDs(["theme1@personas.mozilla.org",
-                                        "default@tests.mozilla.org"]);
-
-  do_check_neq(d, null);
-  do_check_true(d.isActive);
-  do_check_false(d.userDisabled);
-  do_check_eq(d.pendingOperations, AddonManager.PENDING_NONE);
-
-  do_check_eq(t1, null);
-
-  do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
-  */
-});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_theme.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_theme.js
@@ -4,57 +4,44 @@
  * This file contains test for 'theme' type WebExtension addons. Tests focus mostly
  * on interoperability between the different theme formats (XUL and LWT) and
  * Addon Manager integration.
  *
  * Coverage may overlap with other tests in this folder.
  */
 
 const {LightweightThemeManager} = AM_Cu.import("resource://gre/modules/LightweightThemeManager.jsm", {});
-const THEME_IDS = ["theme1@tests.mozilla.org", "theme3@tests.mozilla.org",
-  "theme2@personas.mozilla.org", "default@tests.mozilla.org"];
-const REQUIRE_RESTART = { [THEME_IDS[0]]: 1 };
-const DEFAULT_THEME = THEME_IDS[3];
+const THEME_IDS = [
+  "theme3@tests.mozilla.org",
+  "theme2@personas.mozilla.org",
+  "default@tests.mozilla.org"
+];
+const DEFAULT_THEME = THEME_IDS[2];
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 // We remember the last/ currently active theme for tracking events.
 var gActiveTheme = null;
 
 add_task(async function setup_to_default_browserish_state() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
-  writeInstallRDFForExtension({
-    id: THEME_IDS[0],
-    version: "1.0",
-    name: "Test 1",
-    type: 4,
-    skinnable: true,
-    internalName: "theme1/1.0",
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "2"
-    }]
-  }, profileDir);
-
   await promiseWriteWebManifestForExtension({
     author: "Some author",
     manifest_version: 2,
     name: "Web Extension Name",
     version: "1.0",
     theme: { images: { headerURL: "example.png" } },
     applications: {
       gecko: {
-        id: THEME_IDS[1]
+        id: THEME_IDS[0]
       }
     }
   }, profileDir);
-
   // We need a default theme for some of these things to work but we have hidden
   // the one in the application directory.
   writeInstallRDFForExtension({
     id: DEFAULT_THEME,
     version: "1.0",
     name: "Default",
     internalName: "classic/1.0",
     targetApplications: [{
@@ -63,47 +50,44 @@ add_task(async function setup_to_default
       maxVersion: "2"
     }]
   }, profileDir);
 
   startupManager();
 
   // We can add an LWT only after the Addon Manager was started.
   LightweightThemeManager.currentTheme = {
-    id: THEME_IDS[2].substr(0, THEME_IDS[2].indexOf("@")),
+    id: THEME_IDS[1].substr(0, THEME_IDS[1].indexOf("@")),
     version: "1",
     name: "Bling",
     description: "SO MUCH BLING!",
     author: "Pixel Pusher",
     homepageURL: "http://mochi.test:8888/data/index.html",
     headerURL: "http://mochi.test:8888/data/header.png",
     previewURL: "http://mochi.test:8888/data/preview.png",
     iconURL: "http://mochi.test:8888/data/icon.png",
     textcolor: Math.random().toString(),
     accentcolor: Math.random().toString()
   };
 
-  let [ t1, t2, t3, d ] = await promiseAddonsByIDs(THEME_IDS);
+  let [ t1, t2, d ] = await promiseAddonsByIDs(THEME_IDS);
   Assert.ok(t1, "Theme addon should exist");
   Assert.ok(t2, "Theme addon should exist");
-  Assert.ok(t3, "Theme addon should exist");
   Assert.ok(d, "Theme addon should exist");
 
-  t1.userDisabled = t2.userDisabled = t3.userDisabled = true;
+  t1.userDisabled = t2.userDisabled = true;
   Assert.ok(!t1.isActive, "Theme should be disabled");
   Assert.ok(!t2.isActive, "Theme should be disabled");
-  Assert.ok(!t3.isActive, "Theme should be disabled");
   Assert.ok(d.isActive, "Default theme should be active");
 
   await promiseRestartManager();
 
-  [ t1, t2, t3, d ] = await promiseAddonsByIDs(THEME_IDS);
+  [ t1, t2, d ] = await promiseAddonsByIDs(THEME_IDS);
   Assert.ok(!t1.isActive, "Theme should still be disabled");
   Assert.ok(!t2.isActive, "Theme should still be disabled");
-  Assert.ok(!t3.isActive, "Theme should still be disabled");
   Assert.ok(d.isActive, "Default theme should still be active");
 
   gActiveTheme = d.id;
 });
 
 /**
  * Set the `userDisabled` property of one specific theme and check if the theme
  * switching works as expected by checking the state of all installed themes.
@@ -112,52 +96,46 @@ add_task(async function setup_to_default
  * @param {Boolean} disabled Flag value to switch to
  */
 async function setDisabledStateAndCheck(which, disabled = false) {
   if (disabled)
     Assert.equal(which, gActiveTheme, "Only the active theme can be disabled");
 
   let themeToDisable = disabled ? which : gActiveTheme;
   let themeToEnable = disabled ? DEFAULT_THEME : which;
-  let expectRestart = !!(REQUIRE_RESTART[themeToDisable] || REQUIRE_RESTART[themeToEnable]);
 
   let expectedStates = {
     [themeToDisable]: true,
     [themeToEnable]: false
   };
   let expectedEvents = {
-    [themeToDisable]: [ [ "onDisabling", expectRestart ] ],
-    [themeToEnable]: [ [ "onEnabling", expectRestart ] ]
+    [themeToDisable]: [
+      [ "onDisabling", false ],
+      [ "onDisabled", false ],
+    ],
+    [themeToEnable]: [
+      [ "onEnabling", false ],
+      [ "onEnabled", false ],
+    ]
   };
-  if (!expectRestart) {
-    expectedEvents[themeToDisable].push([ "onDisabled", false ]);
-    expectedEvents[themeToEnable].push([ "onEnabled", false ]);
-  }
 
   // Set the state of the theme to change.
   let theme = await promiseAddonByID(which);
   prepare_test(expectedEvents);
   theme.userDisabled = disabled;
 
   let isDisabled;
   for (theme of await promiseAddonsByIDs(THEME_IDS)) {
     isDisabled = (theme.id in expectedStates) ? expectedStates[theme.id] : true;
     Assert.equal(theme.userDisabled, isDisabled,
       `Theme '${theme.id}' should be ${isDisabled ? "dis" : "en"}abled`);
-    // Some themes need a restart to get their act together.
-    if (expectRestart && (theme.id == themeToEnable || theme.id == themeToDisable)) {
-      let expectedFlag = theme.id == themeToEnable ? AddonManager.PENDING_ENABLE : AddonManager.PENDING_DISABLE;
-      Assert.ok(hasFlag(theme.pendingOperations, expectedFlag),
-        "When expecting a restart, the pending operation flags should match");
-    } else {
-      Assert.equal(theme.pendingOperations, AddonManager.PENDING_NONE,
-        "There should be no pending operations when no restart is expected");
-      Assert.equal(theme.isActive, !isDisabled,
-        `Theme '${theme.id} should be ${isDisabled ? "in" : ""}active`);
-    }
+    Assert.equal(theme.pendingOperations, AddonManager.PENDING_NONE,
+      "There should be no pending operations when no restart is expected");
+    Assert.equal(theme.isActive, !isDisabled,
+      `Theme '${theme.id} should be ${isDisabled ? "in" : ""}active`);
   }
 
   await promiseRestartManager();
 
   // All should still be good after a restart of the Addon Manager.
   for (theme of await promiseAddonsByIDs(THEME_IDS)) {
     isDisabled = (theme.id in expectedStates) ? expectedStates[theme.id] : true;
     Assert.equal(theme.userDisabled, isDisabled,
@@ -168,69 +146,93 @@ async function setDisabledStateAndCheck(
       "There should be no pending operations left");
     if (!isDisabled)
       gActiveTheme = theme.id;
   }
 
   ensure_test_completed();
 }
 
-add_task(async function test_complete_themes() {
-  // Enable the complete theme.
+add_task(async function test_WebExtension_themes() {
+  // Enable the WebExtension theme.
   await setDisabledStateAndCheck(THEME_IDS[0]);
 
-  // Disabling the complete theme should revert to the default theme.
+  // Disabling WebExtension should revert to the default theme.
   await setDisabledStateAndCheck(THEME_IDS[0], true);
 
   // Enable it again.
   await setDisabledStateAndCheck(THEME_IDS[0]);
 
-  // Enabling a WebExtension theme should disable the active theme.
+  // Enabling an LWT should disable the active theme.
   await setDisabledStateAndCheck(THEME_IDS[1]);
 
-  // Switching back should disable the WebExtension theme.
+  // Switching back should disable the LWT.
   await setDisabledStateAndCheck(THEME_IDS[0]);
 });
 
-add_task(async function test_WebExtension_themes() {
-  // Enable the WebExtension theme.
+add_task(async function test_LWTs() {
+  // Start with enabling an LWT.
   await setDisabledStateAndCheck(THEME_IDS[1]);
 
-  // Disabling WebExtension should revert to the default theme.
+  // Disabling LWT should revert to the default theme.
   await setDisabledStateAndCheck(THEME_IDS[1], true);
 
   // Enable it again.
   await setDisabledStateAndCheck(THEME_IDS[1]);
 
-  // Enabling an LWT should disable the active theme.
-  await setDisabledStateAndCheck(THEME_IDS[2]);
+  // Enabling a WebExtension theme should disable the active theme.
+  await setDisabledStateAndCheck(THEME_IDS[0]);
 
   // Switching back should disable the LWT.
   await setDisabledStateAndCheck(THEME_IDS[1]);
 });
 
-add_task(async function test_LWTs() {
-  // Start with enabling an LWT.
-  await setDisabledStateAndCheck(THEME_IDS[2]);
-
-  // Disabling LWT should revert to the default theme.
-  await setDisabledStateAndCheck(THEME_IDS[2], true);
-
-  // Enable it again.
-  await setDisabledStateAndCheck(THEME_IDS[2]);
-
-  // Enabling a WebExtension theme should disable the active theme.
-  await setDisabledStateAndCheck(THEME_IDS[1]);
-
-  // Switching back should disable the LWT.
-  await setDisabledStateAndCheck(THEME_IDS[2]);
-});
-
 add_task(async function test_default_theme() {
   // Explicitly enable the default theme.
   await setDisabledStateAndCheck(DEFAULT_THEME);
 
   // Swith to the WebExtension theme.
-  await setDisabledStateAndCheck(THEME_IDS[1]);
+  await setDisabledStateAndCheck(THEME_IDS[0]);
 
   // Enable it again.
   await setDisabledStateAndCheck(DEFAULT_THEME);
 });
+
+add_task(async function uninstall_offers_undo() {
+  const ID = THEME_IDS[0];
+  let theme = await promiseAddonByID(ID);
+
+  Assert.ok(theme, "Webextension theme is present");
+  Assert.ok(!theme.isActive, "Webextension theme is not active");
+
+  function promiseAddonEvent(event, id) {
+    return new Promise(resolve => {
+      let listener = {
+        // eslint-disable-next-line object-shorthand
+        [event]: function(addon) {
+          if (id) {
+            Assert.equal(addon.id, id, "Got event for expected addon");
+          }
+          AddonManager.removeAddonListener(listener);
+          resolve();
+        }
+      };
+      AddonManager.addAddonListener(listener);
+    });
+  }
+
+  let uninstallingPromise = promiseAddonEvent("onUninstalling", ID);
+  theme.uninstall(true);
+  await uninstallingPromise;
+
+  Assert.ok(hasFlag(theme.pendingOperations, AddonManager.PENDING_UNINSTALL),
+            "Theme being uninstalled has PENDING_UNINSTALL flag");
+
+  let cancelPromise = promiseAddonEvent("onOperationCancelled", ID);
+  theme.cancelUninstall();
+  await cancelPromise;
+
+  Assert.equal(theme.pendingOperations, AddonManager.PENDING_NONE,
+               "PENDING_UNINSTALL flag is cleared when uninstall is canceled");
+
+  theme.uninstall();
+  await promiseRestartManager();
+});
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
@@ -136,19 +136,16 @@ skip-if = os == "android"
 tags = blocklist
 [test_bug521905.js]
 [test_bug526598.js]
 [test_bug541420.js]
 [test_bug542391.js]
 run-sequentially = Uses hardcoded ports in xpi files.
 [test_bug554133.js]
 [test_bug559800.js]
-[test_bug563256.js]
-# Bug 676992: test consistently fails on Android
-fail-if = os == "android"
 [test_bug564030.js]
 [test_bug566626.js]
 [test_bug567184.js]
 [test_bug569138.js]
 [test_bug570173.js]
 [test_bug576735.js]
 [test_bug587088.js]
 skip-if = os == "win" # Bug 1358846
@@ -278,22 +275,17 @@ run-if = addon_signing
 [test_signed_migrate.js]
 run-if = addon_signing
 [test_startup.js]
 # Bug 676992: test consistently fails on Android
 fail-if = os == "android"
 [test_syncGUID.js]
 [test_strictcompatibility.js]
 [test_targetPlatforms.js]
-[test_theme.js]
-# Bug 676992: test consistently fails on Android
-fail-if = os == "android"
 [test_types.js]
-[test_undothemeuninstall.js]
-skip-if = appname == "thunderbird"
 [test_undouninstall.js]
 skip-if = os == "win" # Bug 1358846
 [test_uninstall.js]
 [test_update.js]
 # Bug 676992: test consistently hangs on Android
 skip-if = os == "android"
 [test_update_webextensions.js]
 tags = webextensions