Bug 1464720: Remove remaining in-tree fixture add-ons. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 27 May 2018 16:50:02 -0700
changeset 800431 dd29643b819732d154b739a7e2538c8dd776230a
parent 800401 33f0db96230914ac1d52cf3f6e7a8baa0a8019b8
push id111349
push usermaglione.k@gmail.com
push dateMon, 28 May 2018 03:54:37 +0000
reviewersaswan
bugs1464720
milestone62.0a1
Bug 1464720: Remove remaining in-tree fixture add-ons. r?aswan MozReview-Commit-ID: FIcqimDnlm5
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
toolkit/mozapps/extensions/test/Makefile.in
toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js
toolkit/mozapps/extensions/test/addons/bootstrap_globals/install.rdf
toolkit/mozapps/extensions/test/addons/langpack_1/browser/localization/und/browser.ftl
toolkit/mozapps/extensions/test/addons/langpack_1/chrome/und/locale/und/global/test.properties
toolkit/mozapps/extensions/test/addons/langpack_1/localization/und/toolkit_test.ftl
toolkit/mozapps/extensions/test/addons/langpack_1/manifest.json
toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/install.rdf
toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm
toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm
toolkit/mozapps/extensions/test/addons/test_bootstrap_const/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_bootstrap_const/install.rdf
toolkit/mozapps/extensions/test/addons/test_bug567173/install.rdf
toolkit/mozapps/extensions/test/addons/test_cache_certdb/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_cache_certdb/install.rdf
toolkit/mozapps/extensions/test/addons/test_delay_update_complete_v2/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_delay_update_complete_v2/install.rdf
toolkit/mozapps/extensions/test/addons/test_delay_update_complete_webextension_v2/manifest.json
toolkit/mozapps/extensions/test/addons/test_delay_update_defer_v2/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_delay_update_defer_v2/install.rdf
toolkit/mozapps/extensions/test/addons/test_delay_update_defer_webextension_v2/manifest.json
toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_v2/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_v2/install.rdf
toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_webextension_v2/manifest.json
toolkit/mozapps/extensions/test/addons/test_dictionary/chrome.manifest
toolkit/mozapps/extensions/test/addons/test_dictionary/dictionaries/ab-CD.dic
toolkit/mozapps/extensions/test/addons/test_dictionary/install.rdf
toolkit/mozapps/extensions/test/addons/test_dictionary_3/install.rdf
toolkit/mozapps/extensions/test/addons/test_dictionary_4/install.rdf
toolkit/mozapps/extensions/test/addons/test_dictionary_5/install.rdf
toolkit/mozapps/extensions/test/addons/test_distribution1_2/install.rdf
toolkit/mozapps/extensions/test/addons/test_getresource/icon.png
toolkit/mozapps/extensions/test/addons/test_getresource/install.rdf
toolkit/mozapps/extensions/test/addons/test_getresource/subdir/subfile.txt
toolkit/mozapps/extensions/test/addons/test_install1/icon.png
toolkit/mozapps/extensions/test/addons/test_install1/icon64.png
toolkit/mozapps/extensions/test/addons/test_install1/install.rdf
toolkit/mozapps/extensions/test/addons/test_locale/install.rdf
toolkit/mozapps/extensions/test/addons/test_symbol/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_symbol/install.rdf
toolkit/mozapps/extensions/test/addons/test_undoincompatible/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_undoincompatible/install.rdf
toolkit/mozapps/extensions/test/addons/test_undouninstall1/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_undouninstall1/install.rdf
toolkit/mozapps/extensions/test/addons/test_updateid1/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_updateid1/install.rdf
toolkit/mozapps/extensions/test/addons/test_updateid2/bootstrap.js
toolkit/mozapps/extensions/test/addons/test_updateid2/install.rdf
toolkit/mozapps/extensions/test/addons/webextension_1/chrome.manifest
toolkit/mozapps/extensions/test/addons/webextension_1/manifest.json
toolkit/mozapps/extensions/test/addons/webextension_3/_locales/en/messages.json
toolkit/mozapps/extensions/test/addons/webextension_3/_locales/fr/messages.json
toolkit/mozapps/extensions/test/addons/webextension_3/manifest.json
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js
toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js
toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js
toolkit/mozapps/extensions/test/xpcshell/test_bootstrapped_chrome_manifest.js
toolkit/mozapps/extensions/test/xpcshell/test_cache_certdb.js
toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
toolkit/mozapps/extensions/test/xpcshell/test_delay_update.js
toolkit/mozapps/extensions/test/xpcshell/test_delay_update_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
toolkit/mozapps/extensions/test/xpcshell/test_error.js
toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
toolkit/mozapps/extensions/test/xpcshell/test_getresource.js
toolkit/mozapps/extensions/test/xpcshell/test_install.js
toolkit/mozapps/extensions/test/xpcshell/test_invalid_install_rdf.js
toolkit/mozapps/extensions/test/xpcshell/test_locale.js
toolkit/mozapps/extensions/test/xpcshell/test_pass_symbol.js
toolkit/mozapps/extensions/test/xpcshell/test_proxy.js
toolkit/mozapps/extensions/test/xpcshell/test_reload.js
toolkit/mozapps/extensions/test/xpcshell/test_seen.js
toolkit/mozapps/extensions/test/xpcshell/test_startup.js
toolkit/mozapps/extensions/test/xpcshell/test_switch_os.js
toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js
toolkit/mozapps/extensions/test/xpcshell/test_undouninstall.js
toolkit/mozapps/extensions/test/xpcshell/test_update.js
toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck_errors.js
toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_embedded.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_langpack.js
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -889,17 +889,17 @@ var AddonTestUtils = {
     rdf += "</RDF>\n";
 
     return rdf;
   },
 
   _writeProps(obj, props, indent = "  ") {
     let items = [];
     for (let prop of props) {
-      if (prop in obj)
+      if (obj[prop] !== undefined)
         items.push(escaped`${indent}<em:${prop}>${obj[prop]}</em:${prop}>\n`);
     }
     return items.join("");
   },
 
   _writeArrayProps(obj, props, indent = "  ") {
     let items = [];
     for (let prop of props) {
@@ -914,22 +914,37 @@ var AddonTestUtils = {
 
     items.push(this._writeProps(data, ["name", "description", "creator", "homepageURL"]));
     items.push(this._writeArrayProps(data, ["developer", "translator", "contributor"]));
 
     return items.join("");
   },
 
   createInstallRDF(data) {
+    let defaults = {
+      bootstrap: true,
+      version: "1.0",
+      name: `Test Extension ${data.id}`,
+      targetApplications: [
+        {
+          "id": "xpcshell@tests.mozilla.org",
+          "minVersion": "1",
+          "maxVersion": "64.*",
+        },
+      ],
+    };
+
     var rdf = '<?xml version="1.0"?>\n';
     rdf += '<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' +
            '     xmlns:em="http://www.mozilla.org/2004/em-rdf#">\n';
 
     rdf += '<Description about="urn:mozilla:install-manifest">\n';
 
+    data = Object.assign({}, defaults, data);
+
     let props = ["id", "version", "type", "internalName", "updateURL",
                  "optionsURL", "optionsType", "aboutURL", "iconURL", "icon64URL",
                  "skinnable", "bootstrap", "strictCompatibility",
                  "hasEmbeddedWebExtension"];
     rdf += this._writeProps(data, props);
 
     rdf += this._writeLocaleStrings(data);
 
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ADDONSRC = $(srcdir)/addons
-TESTROOT = $(CURDIR)/$(DEPTH)/_tests/xpcshell/$(relativesrcdir)
-TESTXPI = $(TESTROOT)/xpcshell/addons
-
-include $(topsrcdir)/config/rules.mk
-
-libs::
-	rm -rf $(TESTXPI)
-	$(NSINSTALL) -D $(TESTXPI)
-	if [ -d $(ADDONSRC) ]; then \
-		$(EXIT_ON_ERROR) \
-		for dir in $(ADDONSRC)/*; do \
-			base=`basename $$dir` ; \
-			(cd $$dir && zip -qr $(TESTXPI)/$$base.xpi *) \
-		done \
-	fi
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/bootstrap_globals/bootstrap.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* exported startup, shutdown, install, uninstall */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var seenGlobals = new Set();
-var scope = this;
-function checkGlobal(name, type) {
-  if (scope[name] && typeof(scope[name]) == type)
-    seenGlobals.add(name);
-}
-
-var wrapped = {};
-Services.obs.notifyObservers({ wrappedJSObject: wrapped }, "bootstrap-request-globals");
-for (let [name, type] of wrapped.expectedGlobals) {
-  checkGlobal(name, type);
-}
-
-function install(data, reason) {
-}
-
-function startup(data, reason) {
-  Services.obs.notifyObservers({
-    wrappedJSObject: seenGlobals
-  }, "bootstrap-seen-globals");
-}
-
-function shutdown(data, reason) {
-}
-
-function uninstall(data, reason) {
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/bootstrap_globals/install.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bootstrap_globals@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap Globals</em:name>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/langpack_1/browser/localization/und/browser.ftl
+++ /dev/null
@@ -1,1 +0,0 @@
-message-browser = Value from Browser
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/langpack_1/chrome/und/locale/und/global/test.properties
+++ /dev/null
@@ -1,1 +0,0 @@
-message = Value from .properties
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/langpack_1/localization/und/toolkit_test.ftl
+++ /dev/null
@@ -1,1 +0,0 @@
-message-id1 = Value 1
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/langpack_1/manifest.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-  "name": "und Language Pack",
-  "version": "1.0",
-  "manifest_version": 2,
-  "applications": {
-    "gecko": {
-      "id": "langpack-und@test.mozilla.org",
-      "strict_min_version": "58.0",
-      "strict_max_version": "58.*"
-    }
-  },
-  "sources": {
-    "browser": {
-      "base_path": "browser/"
-    }
-  },
-  "langpack_id": "und",
-  "version": "1",
-  "languages": {
-    "und": {
-      "chrome_resources": {
-        "global": "chrome/und/locale/und/global/"
-      },
-      "version": "20171001190118"
-    }
-  },
-  "author": "Mozilla Localization Task Force",
-  "description": "Language pack for Testy for und"
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/bootstrap.js
+++ /dev/null
@@ -1,1 +0,0 @@
-ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/install.rdf
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bootstrap1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-    <em:multiprocessCompatible>true</em:multiprocessCompatible>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap 1</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm
+++ /dev/null
@@ -1,3 +0,0 @@
-var EXPORTED_SYMBOLS = ["VERSION"];
-
-var VERSION = 1;
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/bootstrap.js
+++ /dev/null
@@ -1,1 +0,0 @@
-ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bootstrap1@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap 1</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm
+++ /dev/null
@@ -1,3 +0,0 @@
-var EXPORTED_SYMBOLS = ["VERSION"];
-
-var VERSION = 2;
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/bootstrap.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* exported install */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-const install = function() {
-  Services.obs.notifyObservers(null, "addon-install");
-};
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bootstrap@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_bug567173/install.rdf
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bug567173</em:id>
-    <em:version>1.0</em:version>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    
-    <!-- Front End MetaData -->
-    <em:name>Test Bug 567173</em:name>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_cache_certdb/bootstrap.js
+++ /dev/null
@@ -1,70 +0,0 @@
-const CERTDB_CONTRACTID = "@mozilla.org/security/x509certdb;1";
-const CERTDB_CID = Components.ID("{fb0bbc5c-452e-4783-b32c-80124693d871}");
-
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const CERT = `MIIDITCCAgmgAwIBAgIJALAv8fydd6nBMA0GCSqGSIb3DQEBBQUAMCcxJTAjBgNV
-BAMMHGJvb3RzdHJhcDFAdGVzdHMubW96aWxsYS5vcmcwHhcNMTYwMjAyMjMxNjUy
-WhcNMjYwMTMwMjMxNjUyWjAnMSUwIwYDVQQDDBxib290c3RyYXAxQHRlc3RzLm1v
-emlsbGEub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5caNuLTu
-H8dEqNntLlhKi4y09hrgcF3cb6n5Xx9DIHA8CKiZxt9qGXKeeiDwEiiQ8ibJYzdc
-jLkbzJUyPVUaH9ygrWynSpSTOvv/Ys3+ERrCo9W7Zuzwdmzt6TTEjFMS4lVx06us
-3uUqkdp3JMgCqCEbOFZiztICiSKrp8QFJkAfApZzBqmJOPOWH0yZ2CRRzvbQZ6af
-hqQDUalJQjWfsenyUWphhbREqExetxHJFR3OrmJt/shXVyz6dD7TBuE3PPUh1RpE
-3ejVufcTzjV3XmK79PxsKLM9V2+ww9e9V3OET57kyvn+bpSWdUYm3X4DA8dxNW6+
-kTFWRnQNZ+zQVQIDAQABo1AwTjAdBgNVHQ4EFgQUac36ccv+99N5HxYa8dCDYRaF
-HNQwHwYDVR0jBBgwFoAUac36ccv+99N5HxYa8dCDYRaFHNQwDAYDVR0TBAUwAwEB
-/zANBgkqhkiG9w0BAQUFAAOCAQEAFfu3MN8EtY5wcxOFdGShOmGQPm2MJJVE6MG+
-p4RqHrukHZSgKOyWjkRk7t6NXzNcnHco9HFv7FQRAXSJ5zObmyu+TMZlu4jHHCav
-GMcV3C/4SUGtlipZbgNe00UAIm6tM3Wh8dr38W7VYg4KGAwXou5XhQ9gCAnSn90o
-H/42NqHTjJsR4v18izX2aO25ARQdMby7Lsr5j9RqweHywiSlPusFcKRseqOnIP0d
-JT3+qh78LeMbNBO2mYD3SP/zu0TAmkAVNcj2KPw0+a0kVZ15rvslPC/K3xn9msMk
-fQthv3rDAcsWvi9YO7T+vylgZBgJfn1ZqpQqy58xN96uh6nPOw==`;
-
-function overrideCertDB() {
-  // Unregister the real database.
-  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-  let factory = registrar.getClassObject(CERTDB_CID, Ci.nsIFactory);
-  registrar.unregisterFactory(CERTDB_CID, factory);
-
-  // Get the real DB
-  let realCertDB = factory.createInstance(null, Ci.nsIX509CertDB);
-
-  let fakeCert = realCertDB.constructX509FromBase64(CERT.replace(/\n/g, ""));
-
-  let fakeCertDB = {
-    openSignedAppFileAsync(root, file, callback) {
-      callback.openSignedAppFileFinished(Cr.NS_OK, null, fakeCert);
-    },
-
-    QueryInterface: ChromeUtils.generateQI([Ci.nsIX509CertDB])
-  };
-
-  for (let property of Object.keys(realCertDB)) {
-    if (property in fakeCertDB) {
-      continue;
-    }
-
-    if (typeof realCertDB[property] == "function") {
-      fakeCertDB[property] = realCertDB[property].bind(realCertDB);
-    }
-  }
-
-  let certDBFactory = {
-    createInstance(outer, iid) {
-      if (outer != null) {
-        throw Cr.NS_ERROR_NO_AGGREGATION;
-      }
-      return fakeCertDB.QueryInterface(iid);
-    }
-  };
-  registrar.registerFactory(CERTDB_CID, "CertDB",
-                            CERTDB_CONTRACTID, certDBFactory);
-
-  const scope = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
-  scope.gCertDB = fakeCertDB;
-}
-
-function install() { // eslint-disable-line no-unused-vars
-  overrideCertDB();
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_cache_certdb/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>bootstrap1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-    <em:multiprocessCompatible>true</em:multiprocessCompatible>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap 1</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_complete_v2/bootstrap.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* exported startup, shutdown, install, ADDON_ID */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-
-const ADDON_ID = "test_delay_update_complete@tests.mozilla.org";
-
-function install(data, reason) {}
-
-function startup(data, reason) {}
-
-function shutdown(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_complete_v2/install.rdf
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_delay_update_complete@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Delay Update Complete</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_complete_webextension_v2/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "manifest_version": 2,
-  "name": "Delay Upgrade",
-  "version": "2.0",
-  "applications": {
-    "gecko": {
-      "id": "test_delay_update_complete_webext@tests.mozilla.org"
-    }
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_defer_v2/bootstrap.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* exported startup, shutdown, install, ADDON_ID */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-
-const ADDON_ID = "test_delay_update_defer@tests.mozilla.org";
-
-function install(data, reason) {}
-
-function startup(data, reason) {}
-
-function shutdown(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_defer_v2/install.rdf
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_delay_update_defer@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Delay Update Defer</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_defer_webextension_v2/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "manifest_version": 2,
-  "name": "Delay Upgrade",
-  "version": "2.0",
-  "applications": {
-    "gecko": {
-      "id": "test_delay_update_defer_webext@tests.mozilla.org"
-    }
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_v2/bootstrap.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* exported startup, shutdown, install */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-
-function install(data, reason) {}
-
-function startup(data, reason) {}
-
-function shutdown(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_v2/install.rdf
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_delay_update_ignore@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Delay Update Ignore</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-    <em:updateURL>http://localhost:4444/data/test_delay_updates_ignore.rdf</em:updateURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_delay_update_ignore_webextension_v2/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "manifest_version": 2,
-  "name": "Delay Upgrade",
-  "version": "2.0",
-  "applications": {
-    "gecko": {
-      "id": "test_delay_update_ignore_webext@tests.mozilla.org"
-    }
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content dict ./
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary/dictionaries/ab-CD.dic
+++ /dev/null
@@ -1,2 +0,0 @@
-1
-test1
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>ab-CD@dictionaries.addons.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:type>64</em:type>
-    <em:unpack>true</em:unpack>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Dictionary</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary_3/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>ab-CD@dictionaries.addons.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:type>64</em:type>
-    <em:unpack>true</em:unpack>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Dictionary</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary_4/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>ef@dictionaries.addons.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:unpack>true</em:unpack>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Dictionary ef</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_dictionary_5/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>gh@dictionaries.addons.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:type>64</em:type>
-    <em:unpack>true</em:unpack>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Dictionary gh</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_distribution1_2/install.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>addon1@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-
-    <!-- Front End MetaData -->
-    <em:name>Distributed add-ons test</em:name>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>5</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_getresource/icon.png
+++ /dev/null
@@ -1,1 +0,0 @@
-Dummy icon file
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_getresource/install.rdf
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>addon1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-
-    <!-- Front End MetaData -->
-    <em:name>Test 1</em:name>
-    <em:description>Test Description</em:description>
-    <em:bootstrap>true</em:bootstrap>
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_getresource/subdir/subfile.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-Dummy file in subdirectory
\ No newline at end of file
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_install1/icon.png
+++ /dev/null
@@ -1,1 +0,0 @@
-Fake icon image
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_install1/icon64.png
+++ /dev/null
@@ -1,1 +0,0 @@
-Fake icon image
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_install1/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- An extension that is compatible with the XPCShell test suite -->
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>addon1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-
-    <!-- Front End MetaData -->
-    <em:name>Test 1</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_locale/install.rdf
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>addon1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:localized>
-      <Description em:locale="fr-FR">
-        <em:locale/>                    <!-- Should be ignored and not fail -->
-        <em:name>fr-FR Name</em:name>
-        <em:description>fr-FR Description</em:description>
-        <em:contributor>Fr Contributor 1</em:contributor>
-        <em:contributor>Fr Contributor 2</em:contributor>
-        <em:contributor>Fr Contributor 3</em:contributor>
-      </Description>
-    </em:localized>
-
-    <em:localized>
-      <Description em:locale="de-DE">
-        <em:name>de-DE Name</em:name>
-      </Description>
-    </em:localized>
-
-    <em:localized>
-      <Description em:locale="es-ES">
-        <em:name>es-ES Name</em:name>
-        <em:description>es-ES Description</em:description>
-      </Description>
-    </em:localized>
-
-    <!-- Subsequent definitions for the same locale should be ignored -->
-    <em:localized>
-      <Description em:locale="fr-FR">
-        <em:name>Repeated locale</em:name>
-      </Description>
-    </em:localized>
-
-    <!-- Properties with no listed locale should be ignored -->
-    <em:localized>
-      <Description>
-        <em:name>Missing locale</em:name>
-      </Description>
-    </em:localized>
-
-    <!-- Front End MetaData -->
-    <em:name>Fallback Name</em:name>
-    <em:description>Fallback Description</em:description>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_symbol/bootstrap.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* exported startup, shutdown, install, uninstall, ADDON_ID */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-
-const PASS_PREF = "symboltest.instanceid.pass";
-const FAIL_BOGUS_PREF = "symboltest.instanceid.fail_bogus";
-const FAIL_ID_PREF = "symboltest.instanceid.fail_bogus";
-const ADDON_ID = "test_symbol@tests.mozilla.org";
-
-function install(data, reason) {}
-
-// normally we would use BootstrapMonitor here, but we need a reference to
-// the symbol inside `XPIProvider.jsm`.
-function startup(data, reason) {
-  Services.prefs.setBoolPref(PASS_PREF, false);
-  Services.prefs.setBoolPref(FAIL_BOGUS_PREF, false);
-  Services.prefs.setBoolPref(FAIL_ID_PREF, false);
-
-  // test with the correct symbol
-  if (data.hasOwnProperty("instanceID") && data.instanceID) {
-    AddonManager.getAddonByInstanceID(data.instanceID)
-      .then(addon => {
-        if (addon.id == ADDON_ID) {
-          Services.prefs.setBoolPref(PASS_PREF, true);
-        }
-      }).catch(err => {
-        throw Error("no addon found for symbol");
-      });
-
-  }
-
-  // test with a totally bogus symbol
-  AddonManager.getAddonByInstanceID(Symbol("bad symbol"))
-    .then(addon => {
-      // there is no symbol by this name, so null should be returned
-      if (addon == null) {
-        Services.prefs.setBoolPref(FAIL_BOGUS_PREF, true);
-      } else {
-        throw Error("bad symbol should not match:", addon);
-      }
-    }).catch(err => {
-      throw Error("promise should not have rejected: " + err);
-    });
-
-  // try to make a matching symbol - this should fail because it's not a
-  // reference to the same symbol stored inside the addons manager.
-  AddonManager.getAddonByInstanceID(Symbol(ADDON_ID))
-    .then(addon => {
-      // there is no symbol by this name, so null should be returned
-      if (addon == null) {
-        Services.prefs.setBoolPref(FAIL_ID_PREF, true);
-      } else {
-        throw Error("bad symbol should not match:", addon);
-      }
-    }).catch(err => {
-      throw Error("promise should not have rejected: " + err);
-    });
-
-}
-
-function shutdown(data, reason) {}
-
-function uninstall(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_symbol/install.rdf
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>test_symbol@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Symbol</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_undoincompatible/bootstrap.js
+++ /dev/null
@@ -1,1 +0,0 @@
-ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_undoincompatible/install.rdf
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>incompatible@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Incompatible Addon</em:name>
-    <em:description>I am incompatible</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>2</em:minVersion>
-        <em:maxVersion>2</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_undouninstall1/bootstrap.js
+++ /dev/null
@@ -1,1 +0,0 @@
-ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_undouninstall1/install.rdf
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>undouninstall1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Front End MetaData -->
-    <em:name>Test Bootstrap 1</em:name>
-    <em:description>Test Description</em:description>
-
-    <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
-    <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
-    <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>xpcshell@tests.mozilla.org</em:id>
-        <em:minVersion>1</em:minVersion>
-        <em:maxVersion>1</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_updateid1/bootstrap.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* exported startup, shutdown, install, uninstall */
-
-function install(data, reason) {}
-function startup(data, reason) {}
-function shutdown(data, reason) {}
-function uninstall(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_updateid1/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-<Description about="urn:mozilla:install-manifest">
-  <em:id>addon1@tests.mozilla.org</em:id>
-  <em:version>1.0</em:version>
-  <em:updateURL>http://example.com/data/test_updateid.rdf</em:updateURL>
-  <em:bootstrap>true</em:bootstrap>
-  <em:name>Test Addon 1</em:name>
-<em:targetApplication><Description>
-  <em:id>xpcshell@tests.mozilla.org</em:id>
-  <em:minVersion>1</em:minVersion>
-  <em:maxVersion>1</em:maxVersion>
-</Description></em:targetApplication>
-</Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_updateid2/bootstrap.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* exported startup, shutdown, install, uninstall */
-
-function install(data, reason) {}
-function startup(data, reason) {}
-function shutdown(data, reason) {}
-function uninstall(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/test_updateid2/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-<Description about="urn:mozilla:install-manifest">
-  <em:id>addon1.changed@tests.mozilla.org</em:id>
-  <em:version>2.0</em:version>
-  <em:updateURL>http://localhost:4444/data/test_updateid.rdf</em:updateURL>
-  <em:bootstrap>true</em:bootstrap>
-  <em:name>Test Addon 1</em:name>
-<em:targetApplication><Description>
-  <em:id>xpcshell@tests.mozilla.org</em:id>
-  <em:minVersion>1</em:minVersion>
-  <em:maxVersion>1</em:maxVersion>
-</Description></em:targetApplication>
-</Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/webextension_1/chrome.manifest
+++ /dev/null
@@ -1,1 +0,0 @@
-content webex ./
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/webextension_1/manifest.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "name": "Web Extension Name",
-  "version": "1.0",
-  "manifest_version": 2,
-  "applications": {
-    "gecko": {
-      "id": "webextension1@tests.mozilla.org"
-    }
-  },
-  "icons": {
-    "48": "icon48.png",
-    "64": "icon64.png"
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/webextension_3/_locales/en/messages.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "name": {
-    "message": "foo ☹",
-    "description": "foo"
-  },
-  "desc": {
-    "message": "bar ☹",
-    "description": "bar"
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/webextension_3/_locales/fr/messages.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "name": {
-    "message": "le foo ☺",
-    "description": "foo"
-  },
-  "desc": {
-    "message": "le bar ☺",
-    "description": "bar"
-  }
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/addons/webextension_3/manifest.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "name": "Web Extensiøn __MSG_name__",
-  "description": "Descriptïon __MSG_desc__ of add-on",
-  "version": "1.0",
-  "manifest_version": 2,
-  "default_locale": "en",
-  "applications": {
-    "gecko": {
-      "id": "webextension3@tests.mozilla.org"
-    }
-  }
-}
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -197,16 +197,20 @@ function isManifestRegistered(file) {
     }
 
     if (manifest.equals(file))
       return true;
   }
   return false;
 }
 
+const BOOTSTRAP_MONITOR_BOOTSTRAP_JS = `
+  ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
+`;
+
 // Listens to messages from bootstrap.js telling us what add-ons were started
 // and stopped etc. and performs some sanity checks that only installed add-ons
 // are started etc.
 this.BootstrapMonitor = {
   inited: false,
 
   // Contain the current state of add-ons in the system
   installed: new Map(),
@@ -590,32 +594,16 @@ function do_check_not_in_crash_annotatio
     Assert.ok(true);
     return;
   }
 
   let addons = gAppInfo.annotations["Add-ons"].split(",");
   Assert.ok(!addons.includes(`${encodeURIComponent(aId)}:${encodeURIComponent(aVersion)}`));
 }
 
-/**
- * Returns a testcase xpi
- *
- * @param  aName
- *         The name of the testcase (without extension)
- * @return an nsIFile pointing to the testcase xpi
- */
-function do_get_addon(aName) {
-  return do_get_file("addons/" + aName + ".xpi");
-}
-
-function do_get_addon_hash(aName, aAlgorithm) {
-  let file = do_get_addon(aName);
-  return do_get_file_hash(file);
-}
-
 function do_get_file_hash(aFile, aAlgorithm) {
   if (!aAlgorithm)
     aAlgorithm = "sha1";
 
   let crypto = Cc["@mozilla.org/security/hash;1"].
                createInstance(Ci.nsICryptoHash);
   crypto.initWithString(aAlgorithm);
   let fis = Cc["@mozilla.org/network/file-input-stream;1"].
--- a/toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js
@@ -5,51 +5,47 @@
 // Test that we only check manifest age for disabled extensions
 
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
+const ADDONS = {
+  test_bootstrap1_1: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
 /* We want one add-on installed packed, and one installed unpacked
  */
 
 function run_test() {
   // Shut down the add-on manager after all tests run.
   registerCleanupFunction(promiseShutdownManager);
   // Kick off the task-based tests...
   run_next_test();
 }
 
 // Use bootstrap extensions so the changes will be immediate.
 // A packed extension, to be enabled
 add_task(async function setup() {
   await promiseWriteInstallRDFToXPI({
     id: "packed-enabled@tests.mozilla.org",
-    version: "1.0",
-    bootstrap: true,
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "1"
-    }],
     name: "Packed, Enabled",
   }, profileDir);
 
   // Packed, will be disabled
   await promiseWriteInstallRDFToXPI({
     id: "packed-disabled@tests.mozilla.org",
-    version: "1.0",
-    bootstrap: true,
-    targetApplications: [{
-      id: "xpcshell@tests.mozilla.org",
-      minVersion: "1",
-      maxVersion: "1"
-    }],
     name: "Packed, Disabled",
   }, profileDir);
 });
 
 // Keep track of the last time stamp we've used, so that we can keep moving
 // it forward (if we touch two different files in the same add-on with the same
 // timestamp we may not consider the change significant)
 var lastTimestamp = Date.now();
@@ -132,18 +128,16 @@ add_task(async function uninstall_bootst
 });
 
 /*
  * Installing a restartless add-on should immediately add it to XPIState
  */
 add_task(async function install_bootstrap() {
   let XS = getXS();
 
-  let installer = await promiseInstallFile(
-    do_get_addon("test_bootstrap1_1"));
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
 
-  let newAddon = installer.addon;
-  let xState = XS.getAddon("app-profile", newAddon.id);
+  let xState = XS.getAddon("app-profile", addon.id);
   Assert.ok(!!xState);
   Assert.ok(xState.enabled);
-  Assert.equal(xState.mtime, newAddon.updateDate.getTime());
-  await newAddon.uninstall();
+  Assert.equal(xState.mtime, addon.updateDate.getTime());
+  await addon.uninstall();
 });
--- a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
@@ -9,17 +9,16 @@ Services.prefs.setBoolPref(PREF_EM_CHECK
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
-  testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
 
   await promiseStartupManager();
 
   do_test_pending();
   run_test_1();
 });
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
@@ -2,17 +2,16 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a database with a bad schema
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 
 // register files with server
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 testserver.registerDirectory("/data/", do_get_file("data"));
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 
 const ADDONS = {
   "addon1@tests.mozilla.org": {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
@@ -28,94 +28,57 @@ createAppInfo("xpcshell@tests.mozilla.or
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 const userExtDir = gProfD.clone();
 userExtDir.append("extensions2");
 userExtDir.append(gAppInfo.ID);
 registerDirectory("XREUSysExt", userExtDir.parent);
 
 
-const BOOTSTRAP = `
-  ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
-`;
-
 const ADDONS = {
   test_bootstrap1_1: {
     "install.rdf": {
       id: "bootstrap1@tests.mozilla.org",
-      version: "1.0",
-      bootstrap: "true",
-      multiprocessCompatible: "true",
 
       name: "Test Bootstrap 1",
-      description: "Test Description",
 
       iconURL: "chrome://foo/skin/icon.png",
       aboutURL: "chrome://foo/content/about.xul",
       optionsURL: "chrome://foo/content/options.xul",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   },
   test_bootstrap1_2: {
     "install.rdf": {
       id: "bootstrap1@tests.mozilla.org",
       version: "2.0",
-      bootstrap: "true",
 
       name: "Test Bootstrap 1",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   },
   test_bootstrap1_3: {
     "install.rdf": {
       id: "bootstrap1@tests.mozilla.org",
       version: "3.0",
-      bootstrap: "true",
 
       name: "Test Bootstrap 1",
-      description: "Test Description",
 
       targetApplications: [{
         id: "undefined",
         minVersion: "1",
         maxVersion: "1"}],
     },
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   },
   test_bootstrap2_1: {
     "install.rdf": {
       id: "bootstrap2@tests.mozilla.org",
-      version: "1.0",
-      bootstrap: "true",
-      multiprocessCompatible: "true",
-
-      name: "Test Bootstrap 2",
-      description: "Test Description",
-
-      iconURL: "chrome://foo/skin/icon.png",
-      aboutURL: "chrome://foo/content/about.xul",
-      optionsURL: "chrome://foo/content/options.xul",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   },
 };
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 
 const XPIS = {};
 for (let [name, addon] of Object.entries(ADDONS)) {
   XPIS[name] = AddonTestUtils.createTempXPIFile(addon);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js
@@ -1,18 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
+const ADDONS = {
+  test_bootstrap_const: {
+    "install.rdf": {
+      "id": "bootstrap@tests.mozilla.org",
+    },
+    "bootstrap.js": "ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\n\nconst install = function() {\n  Services.obs.notifyObservers(null, \"addon-install\");\n};\n"
+  },
+};
+
 add_task(async function() {
   await promiseStartupManager();
 
   let sawInstall = false;
   Services.obs.addObserver(function() {
     sawInstall = true;
   }, "addon-install");
 
-  await promiseInstallAllFiles([do_get_addon("test_bootstrap_const")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap_const);
 
   ok(sawInstall);
 });
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_globals.js
@@ -2,16 +2,48 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that bootstrap.js has the expected globals defined
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
+const ADDONS = {
+  bootstrap_globals: {
+    "install.rdf": {
+      "id": "bootstrap_globals@tests.mozilla.org",
+    },
+    "bootstrap.js": String.raw`ChromeUtils.import("resource://gre/modules/Services.jsm");
+
+var seenGlobals = new Set();
+var scope = this;
+function checkGlobal(name, type) {
+  if (scope[name] && typeof(scope[name]) == type)
+    seenGlobals.add(name);
+}
+
+var wrapped = {};
+Services.obs.notifyObservers({ wrappedJSObject: wrapped }, "bootstrap-request-globals");
+for (let [name, type] of wrapped.expectedGlobals) {
+  checkGlobal(name, type);
+}
+
+function startup(data, reason) {
+  Services.obs.notifyObservers({ wrappedJSObject: seenGlobals }, "bootstrap-seen-globals");
+}
+
+function install(data, reason) {}
+function shutdown(data, reason) {}
+function uninstall(data, reason) {}
+`,
+  },
+};
+
+
 const EXPECTED_GLOBALS = [
   ["console", "object"]
 ];
 
 async function run_test() {
   do_test_pending();
   await promiseStartupManager();
   let sawGlobals = false;
@@ -22,13 +54,13 @@ async function run_test() {
 
   Services.obs.addObserver(function({ wrappedJSObject: seenGlobals }) {
     for (let [name, ] of EXPECTED_GLOBALS)
       Assert.ok(seenGlobals.has(name));
 
     sawGlobals = true;
   }, "bootstrap-seen-globals");
 
-  await promiseInstallAllFiles([do_get_addon("bootstrap_globals")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.bootstrap_globals);
   Assert.ok(sawGlobals);
   await promiseShutdownManager();
   do_test_finished();
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrapped_chrome_manifest.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrapped_chrome_manifest.js
@@ -1,26 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const ADDON = {
   "install.rdf": {
     "id": "bug675371@tests.mozilla.org",
-    "version": "1.0",
-    "bootstrap": "true",
-    "name": "Bug 675371 Test",
-    "description": "Test Description",
-    "targetApplications": [
-      {
-        "id": "xpcshell@tests.mozilla.org",
-        "minVersion": "1",
-        "maxVersion": "1"
-      }
-    ]
   },
   "chrome.manifest": `content bug675371 .`,
   "test.js": `var active = true;`,
 };
 
 add_task(async function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   await promiseStartupManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_cache_certdb.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_cache_certdb.js
@@ -6,20 +6,100 @@
 Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_REQUIRED, true);
 gUseRealCertChecks = true;
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 const ID = "bootstrap1@tests.mozilla.org";
 
+const ADDONS = {
+  test_cache_certdb: {
+    "install.rdf": {
+      "id": ID,
+    },
+    "bootstrap.js": String.raw`const CERTDB_CONTRACTID = "@mozilla.org/security/x509certdb;1";
+const CERTDB_CID = Components.ID("{fb0bbc5c-452e-4783-b32c-80124693d871}");
+
+ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const CERT = "MIIDITCCAgmgAwIBAgIJALAv8fydd6nBMA0GCSqGSIb3DQEBBQUAMCcxJTAjBgNV\
+BAMMHGJvb3RzdHJhcDFAdGVzdHMubW96aWxsYS5vcmcwHhcNMTYwMjAyMjMxNjUy\
+WhcNMjYwMTMwMjMxNjUyWjAnMSUwIwYDVQQDDBxib290c3RyYXAxQHRlc3RzLm1v\
+emlsbGEub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5caNuLTu\
+H8dEqNntLlhKi4y09hrgcF3cb6n5Xx9DIHA8CKiZxt9qGXKeeiDwEiiQ8ibJYzdc\
+jLkbzJUyPVUaH9ygrWynSpSTOvv/Ys3+ERrCo9W7Zuzwdmzt6TTEjFMS4lVx06us\
+3uUqkdp3JMgCqCEbOFZiztICiSKrp8QFJkAfApZzBqmJOPOWH0yZ2CRRzvbQZ6af\
+hqQDUalJQjWfsenyUWphhbREqExetxHJFR3OrmJt/shXVyz6dD7TBuE3PPUh1RpE\
+3ejVufcTzjV3XmK79PxsKLM9V2+ww9e9V3OET57kyvn+bpSWdUYm3X4DA8dxNW6+\
+kTFWRnQNZ+zQVQIDAQABo1AwTjAdBgNVHQ4EFgQUac36ccv+99N5HxYa8dCDYRaF\
+HNQwHwYDVR0jBBgwFoAUac36ccv+99N5HxYa8dCDYRaFHNQwDAYDVR0TBAUwAwEB\
+/zANBgkqhkiG9w0BAQUFAAOCAQEAFfu3MN8EtY5wcxOFdGShOmGQPm2MJJVE6MG+\
+p4RqHrukHZSgKOyWjkRk7t6NXzNcnHco9HFv7FQRAXSJ5zObmyu+TMZlu4jHHCav\
+GMcV3C/4SUGtlipZbgNe00UAIm6tM3Wh8dr38W7VYg4KGAwXou5XhQ9gCAnSn90o\
+H/42NqHTjJsR4v18izX2aO25ARQdMby7Lsr5j9RqweHywiSlPusFcKRseqOnIP0d\
+JT3+qh78LeMbNBO2mYD3SP/zu0TAmkAVNcj2KPw0+a0kVZ15rvslPC/K3xn9msMk\
+fQthv3rDAcsWvi9YO7T+vylgZBgJfn1ZqpQqy58xN96uh6nPOw==";
+
+function overrideCertDB() {
+  // Unregister the real database.
+  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
+  let factory = registrar.getClassObject(CERTDB_CID, Ci.nsIFactory);
+  registrar.unregisterFactory(CERTDB_CID, factory);
+
+  // Get the real DB
+  let realCertDB = factory.createInstance(null, Ci.nsIX509CertDB);
+
+  let fakeCert = realCertDB.constructX509FromBase64(CERT.replace(/\n/g, ""));
+
+  let fakeCertDB = {
+    openSignedAppFileAsync(root, file, callback) {
+      callback.openSignedAppFileFinished(Cr.NS_OK, null, fakeCert);
+    },
+
+    QueryInterface: ChromeUtils.generateQI([Ci.nsIX509CertDB])
+  };
+
+  for (let property of Object.keys(realCertDB)) {
+    if (property in fakeCertDB) {
+      continue;
+    }
+
+    if (typeof realCertDB[property] == "function") {
+      fakeCertDB[property] = realCertDB[property].bind(realCertDB);
+    }
+  }
+
+  let certDBFactory = {
+    createInstance(outer, iid) {
+      if (outer != null) {
+        throw Cr.NS_ERROR_NO_AGGREGATION;
+      }
+      return fakeCertDB.QueryInterface(iid);
+    }
+  };
+  registrar.registerFactory(CERTDB_CID, "CertDB",
+                            CERTDB_CONTRACTID, certDBFactory);
+
+  const scope = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
+  scope.gCertDB = fakeCertDB;
+}
+
+function install() { // eslint-disable-line no-unused-vars
+  overrideCertDB();
+}
+`,
+  },
+};
+
+
 add_task(async function() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
-  AddonTestUtils.manuallyInstall(do_get_addon("test_cache_certdb"), profileDir, ID);
+  AddonTestUtils.manuallyInstall(AddonTestUtils.createTempXPIFile(ADDONS.test_cache_certdb), profileDir, ID);
 
   await promiseStartupManager();
 
   // Force a rescan of signatures
   const { XPIDatabase } = ChromeUtils.import("resource://gre/modules/addons/XPIDatabase.jsm", {});
   await XPIDatabase.verifySignatures();
 
   let addon = await AddonManager.getAddonByID(ID);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
@@ -4,17 +4,16 @@
 
 // Checks that we rebuild something sensible from a corrupt database
 
 
 // Create and configure the HTTP server.
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 
 // register files with server
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 testserver.registerDirectory("/data/", do_get_file("data"));
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 
 const ADDONS = {
   // Will get a compatibility update and stay enabled
--- a/toolkit/mozapps/extensions/test/xpcshell/test_delay_update.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_delay_update.js
@@ -20,17 +20,50 @@ const TEST_IGNORE_PREF = "delaytest.igno
 // the objects in `data` to be serializable, and we need a real reference to the
 // `instanceID` symbol to test.
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
 // Create and configure the HTTP server.
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
-testserver.registerDirectory("/addons/", do_get_file("addons"));
+
+
+const ADDONS = {
+  test_delay_update_complete_v2: {
+    "install.rdf": {
+      "id": "test_delay_update_complete@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Test Delay Update Complete",
+    },
+    "bootstrap.js": "ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\nChromeUtils.import(\"resource://gre/modules/AddonManager.jsm\");\n\nconst ADDON_ID = \"test_delay_update_complete@tests.mozilla.org\";\n\nfunction install(data, reason) {}\n\nfunction startup(data, reason) {}\n\nfunction shutdown(data, reason) {}\n"
+  },
+  test_delay_update_defer_v2: {
+    "install.rdf": {
+      "id": "test_delay_update_defer@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Test Delay Update Defer",
+    },
+    "bootstrap.js": "ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\nChromeUtils.import(\"resource://gre/modules/AddonManager.jsm\");\n\nconst ADDON_ID = \"test_delay_update_defer@tests.mozilla.org\";\n\nfunction install(data, reason) {}\n\nfunction startup(data, reason) {}\n\nfunction shutdown(data, reason) {}\n"
+  },
+  test_delay_update_ignore_v2: {
+    "install.rdf": {
+      "id": "test_delay_update_ignore@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Test Delay Update Ignore",
+    },
+    "bootstrap.js": "ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\nChromeUtils.import(\"resource://gre/modules/AddonManager.jsm\");\n\nfunction install(data, reason) {}\n\nfunction startup(data, reason) {}\n\nfunction shutdown(data, reason) {}\n"
+  },
+};
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+  testserver.registerFile(`/addons/${name}.xpi`, XPIS[name]);
+}
 
 async function createIgnoreAddon() {
   await promiseWriteInstallRDFToXPI({
     id: IGNORE_ID,
     version: "1.0",
     bootstrap: true,
     unpack: true,
     updateURL: `http://example.com/data/test_delay_updates_ignore_legacy.json`,
--- a/toolkit/mozapps/extensions/test/xpcshell/test_delay_update_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_delay_update_webextension.js
@@ -28,20 +28,58 @@ stageDir.append("staged");
 const IGNORE_ID = "test_delay_update_ignore_webext@tests.mozilla.org";
 const COMPLETE_ID = "test_delay_update_complete_webext@tests.mozilla.org";
 const DEFER_ID = "test_delay_update_defer_webext@tests.mozilla.org";
 const NOUPDATE_ID = "test_no_update_webext@tests.mozilla.org";
 
 // Create and configure the HTTP server.
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "42", "42");
 
+const ADDONS = {
+  test_delay_update_complete_webextension_v2: {
+    "manifest.json": {
+      "manifest_version": 2,
+      "name": "Delay Upgrade",
+      "version": "2.0",
+      "applications": {
+        "gecko": {id: COMPLETE_ID}
+      }
+    }
+  },
+  test_delay_update_defer_webextension_v2: {
+    "manifest.json": {
+      "manifest_version": 2,
+      "name": "Delay Upgrade",
+      "version": "2.0",
+      "applications": {
+        "gecko": {id: DEFER_ID}
+      }
+    }
+  },
+  test_delay_update_ignore_webextension_v2: {
+    "manifest.json": {
+      "manifest_version": 2,
+      "name": "Delay Upgrade",
+      "version": "2.0",
+      "applications": {
+        "gecko": {id: IGNORE_ID}
+      }
+    }
+  },
+};
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+  testserver.registerFile(`/addons/${name}.xpi`, XPIS[name]);
+}
+
 // add-on registers upgrade listener, and ignores update.
 add_task(async function delay_updates_ignore() {
   await promiseStartupManager();
 
   let extension = ExtensionTestUtils.loadExtension({
     useAddonManager: "permanent",
     manifest: {
       "version": "1.0",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
@@ -12,37 +12,77 @@ PromiseTestUtils.whitelistRejectionsGlob
 
 // Enable loading extensions from the user scopes
 Services.prefs.setIntPref("extensions.enabledScopes",
                           AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_USER);
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
-const ID_DICT = "ab-CD@dictionaries.addons.mozilla.org";
-const XPI_DICT = do_get_addon("test_dictionary");
-
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 const userExtDir = gProfD.clone();
 userExtDir.append("extensions2");
 userExtDir.append(gAppInfo.ID);
 
 registerDirectory("XREUSysExt", userExtDir.parent);
 
 // Create and configure the HTTP server.
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 
 // register files with server
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 testserver.registerDirectory("/data/", do_get_file("data"));
 
+const ADDONS = {
+  test_dictionary: {
+    "install.rdf": {
+      "id": "ab-CD@dictionaries.addons.mozilla.org",
+      "type": "64",
+      "name": "Test Dictionary",
+    },
+    "dictionaries/ab-CD.dic": "1\ntest1\n",
+    "chrome.manifest": "content dict ./\n"
+  },
+  test_dictionary_3: {
+    "install.rdf": {
+      "id": "ab-CD@dictionaries.addons.mozilla.org",
+      "version": "2.0",
+      "type": "64",
+      "name": "Test Dictionary",
+    }
+  },
+  test_dictionary_4: {
+    "install.rdf": {
+      "id": "ef@dictionaries.addons.mozilla.org",
+      "version": "2.0",
+      "name": "Test Dictionary ef",
+    }
+  },
+  test_dictionary_5: {
+    "install.rdf": {
+      "id": "gh@dictionaries.addons.mozilla.org",
+      "version": "2.0",
+      "type": "64",
+      "name": "Test Dictionary gh",
+    }
+  },
+};
+
+const ID_DICT = "ab-CD@dictionaries.addons.mozilla.org";
+const XPI_DICT = AddonTestUtils.createTempXPIFile(ADDONS.test_dictionary);
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+  testserver.registerFile(`/addons/${name}.xpi`, XPIS[name]);
+}
+
 /**
  * This object is both a factory and an mozISpellCheckingEngine implementation (so, it
  * is de-facto a service). It's also an interface requestor that gives out
  * itself when asked for mozISpellCheckingEngine.
  */
 var HunspellEngine = {
   dictionaryURIs: new Map(),
   listener: null,
@@ -121,18 +161,17 @@ add_task(async function setup() {
 // Tests that installing doesn't require a restart
 add_task(async function test_1() {
   prepare_test({ }, [
     "onNewInstall"
   ]);
 
   HunspellEngine.activate();
 
-  let install = await AddonManager.getInstallForFile(
-    do_get_addon("test_dictionary"));
+  let install = await AddonManager.getInstallForFile(XPI_DICT);
   ensure_test_completed();
 
   notEqual(install, null);
   equal(install.type, "dictionary");
   equal(install.version, "1.0");
   equal(install.name, "Test Dictionary");
   equal(install.state, AddonManager.STATE_DOWNLOADED);
   equal(install.addon.operationsRequiringRestart &
@@ -358,17 +397,17 @@ add_task(async function test_12() {
 
   await addon.uninstall();
 });
 
 
 // Tests that bootstrapped extensions don't get loaded when in safe mode
 add_task(async function test_16() {
   await promiseRestartManager();
-  await promiseInstallFile(do_get_addon("test_dictionary"));
+  await promiseInstallFile(XPI_DICT);
 
   let addon = await AddonManager.getAddonByID(ID_DICT);
   // Should have installed and started
   ok(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
 
   await promiseShutdownManager();
 
   // We don't unregister dictionaries at app shutdown, so the dictionary
--- a/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
@@ -12,16 +12,26 @@ createAppInfo("xpcshell@tests.mozilla.or
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 const distroDir = gProfD.clone();
 distroDir.append("distribution");
 distroDir.append("extensions");
 registerDirectory("XREAppDist", distroDir.parent);
 
+const ADDONS = {
+  test_distribution1_2: {
+    "install.rdf": {
+      "id": "addon1@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Distributed add-ons test",
+    }
+  },
+};
+
 var addon1_1 = {
   id: "addon1@tests.mozilla.org",
   version: "1.0",
   name: "Test version 1",
   bootstrap: true,
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
@@ -170,17 +180,17 @@ async function run_test_6() {
   executeSoon(run_test_7);
 }
 
 // Tests that a pending install of a newer version of a distributed add-on
 // at app change still gets applied
 async function run_test_7() {
   Services.prefs.clearUserPref("extensions.installedDistroAddon.addon1@tests.mozilla.org");
 
-  await promiseInstallAllFiles([do_get_addon("test_distribution1_2")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_distribution1_2);
   await promiseRestartManager(2);
 
   let a1 = await AddonManager.getAddonByID("addon1@tests.mozilla.org");
   Assert.notEqual(a1, null);
   Assert.equal(a1.version, "2.0");
   Assert.ok(a1.isActive);
   Assert.equal(a1.scope, AddonManager.SCOPE_PROFILE);
 
@@ -190,17 +200,17 @@ async function run_test_7() {
 
 // Tests that a pending install of a older version of a distributed add-on
 // at app change gets replaced by the distributed version
 async function run_test_8() {
   await promiseRestartManager();
 
   await promiseWriteInstallRDFForExtension(addon1_3, distroDir);
 
-  await promiseInstallAllFiles([do_get_addon("test_distribution1_2")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_distribution1_2);
   await promiseRestartManager(3);
 
   let a1 = await AddonManager.getAddonByID("addon1@tests.mozilla.org");
   Assert.notEqual(a1, null);
   Assert.equal(a1.version, "3.0");
   Assert.ok(a1.isActive);
   Assert.equal(a1.scope, AddonManager.SCOPE_PROFILE);
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_error.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_error.js
@@ -4,16 +4,24 @@
 
 // Tests that various error conditions are handled correctly
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
+const ADDONS = {
+  test_bug567173: {
+    "install.rdf": {
+      "id": "bug567173",
+    }
+  },
+};
+
 async function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   await promiseStartupManager();
 
   run_test_1();
 }
@@ -70,15 +78,16 @@ async function run_test_5() {
   Assert.equal(install.state, AddonManager.STATE_DOWNLOAD_FAILED);
   Assert.equal(install.error, AddonManager.ERROR_NETWORK_FAILURE);
 
   run_test_6();
 }
 
 // Checks that an add-on with an illegal ID shows an error
 async function run_test_6() {
-  let install = await AddonManager.getInstallForFile(do_get_addon("test_bug567173"));
+  let xpi = await AddonTestUtils.createTempXPIFile(ADDONS.test_bug567173);
+  let install = await AddonManager.getInstallForFile(xpi);
   Assert.notEqual(install, null);
   Assert.equal(install.state, AddonManager.STATE_DOWNLOAD_FAILED);
   Assert.equal(install.error, AddonManager.ERROR_CORRUPT_FILE);
 
   executeSoon(do_test_finished);
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
@@ -45,17 +45,16 @@ const profileDir = gProfD.clone();
 profileDir.append("extensions");
 profileDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
 
 const sourceDir = gProfD.clone();
 sourceDir.append("source");
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 gPort = testserver.identity.primaryPort;
 
 function promiseWritePointer(aId, aName) {
   let path = OS.Path.join(profileDir.path, aName || aId);
 
   let target = OS.Path.join(sourceDir.path,
                             do_get_expected_addon_name(aId));
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_getresource.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_getresource.js
@@ -1,23 +1,35 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies the functionality of getResourceURI
 // There are two cases - with a filename it returns an nsIFileURL to the filename
 // and with no parameters, it returns an nsIFileURL to the root of the addon
 
+const ADDONS = {
+  test_getresource: {
+    "install.rdf": {
+      "id": "addon1@tests.mozilla.org",
+      "name": "Test 1",
+    },
+    "icon.png": "Dummy icon file",
+    "subdir/subfile.txt": "Dummy file in subdirectory"
+  },
+};
+
 async function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
   await promiseStartupManager();
 
-  let aInstall = await AddonManager.getInstallForFile(do_get_addon("test_getresource"));
+  let xpi = AddonTestUtils.createTempXPIFile(ADDONS.test_getresource);
+  let aInstall = await AddonManager.getInstallForFile(xpi);
   Assert.equal(aInstall.addon.getResourceURI().spec, aInstall.sourceURI.spec);
 
   Assert.equal(aInstall.addon.getResourceURI("icon.png").spec,
                "jar:" + aInstall.sourceURI.spec + "!/icon.png");
 
   Assert.equal(aInstall.addon.getResourceURI("subdir/subfile.txt").spec,
                "jar:" + aInstall.sourceURI.spec + "!/subdir/subfile.txt");
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js
@@ -10,85 +10,54 @@ var testserver = AddonTestUtils.createHt
 var gInstallDate;
 
 const ADDONS = {
   test_install1: {
     "install.rdf": {
       id: "addon1@tests.mozilla.org",
       version: "1.0",
       name: "Test 1",
-      description: "Test Description",
-      bootstrap: true,
-
-      targetApplications: [{
-          id: "xpcshell@tests.mozilla.org",
-          minVersion: "1",
-          maxVersion: "1"}],
     },
     "icon.png": "Fake icon image",
     "icon64.png": "Fake icon image",
   },
   test_install2_1: {
     "install.rdf": {
       id: "addon2@tests.mozilla.org",
       version: "2.0",
       name: "Real Test 2",
-      description: "Test Description",
-      bootstrap: true,
-
-      targetApplications: [{
-          id: "xpcshell@tests.mozilla.org",
-          minVersion: "1",
-          maxVersion: "1"}],
-
     },
     "icon.png": "Fake icon image",
   },
   test_install2_2: {
     "install.rdf": {
       id: "addon2@tests.mozilla.org",
       version: "3.0",
       name: "Real Test 3",
-      description: "Test Description",
-      bootstrap: true,
-
-      targetApplications: [{
-          id: "xpcshell@tests.mozilla.org",
-          minVersion: "1",
-          maxVersion: "1"}],
     },
   },
   test_install3: {
     "install.rdf": {
       id: "addon3@tests.mozilla.org",
       version: "1.0",
       name: "Real Test 4",
-      description: "Test Description",
-      bootstrap: true,
 
       updateURL: "http://example.com/data/test_install.rdf",
 
       targetApplications: [{
           id: "xpcshell@tests.mozilla.org",
           minVersion: "0",
           maxVersion: "0"}],
     },
   },
   test_install6: {
     "install.rdf": {
       id: "addon6@tests.mozilla.org",
       version: "1.0",
       name: "Addon Test 6",
-      description: "Test Description",
-      bootstrap: true,
-
-      targetApplications: [{
-          id: "xpcshell@tests.mozilla.org",
-          minVersion: "1",
-          maxVersion: "1"}],
     },
   },
   test_install7: {
     "install.rdf": {
       type: "32",
     },
   },
 };
--- a/toolkit/mozapps/extensions/test/xpcshell/test_invalid_install_rdf.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_invalid_install_rdf.js
@@ -64,16 +64,17 @@ add_task(async function() {
     "chrome.manifest": `
       content foo ./
     `,
   });
 
   await promiseWriteInstallRDFToXPI({
     id: "foo-legacy-legacy@addons.mozilla.org",
     version: "1.0",
+    bootstrap: false,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1"
     }],
     name: "Invalid install.rdf extension",
   }, userExtensions, undefined, {
     "chrome.manifest": `
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locale.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locale.js
@@ -1,23 +1,71 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+const ADDONS = {
+  test_locale: {
+    "install.rdf": {
+      "id": "addon1@tests.mozilla.org",
+      "name": "Fallback Name",
+      "description": "Fallback Description",
+      "localized": [
+        {
+          "name": "fr-FR Name",
+          "description": "fr-FR Description",
+          "locale": [
+            "fr-FR",
+            ""
+          ],
+          "contributor": [
+            "Fr Contributor 1",
+            "Fr Contributor 2",
+            "Fr Contributor 3"
+          ]
+        },
+        {
+          "name": "de-DE Name",
+          "locale": [
+            "de-DE"
+          ]
+        },
+        {
+          "name": "es-ES Name",
+          "description": "es-ES Description",
+          "locale": [
+            "es-ES"
+          ]
+        },
+        {
+          "name": "Repeated locale",
+          "locale": [
+            "fr-FR"
+          ]
+        },
+        {
+          "name": "Missing locale"
+        }
+      ]
+    }
+  },
+};
+
 add_task(async function setup() {
   // Setup for test
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   await promiseStartupManager();
 });
 
 // Tests that the localized properties are visible before installation
 add_task(async function test_1() {
   await restartWithLocales(["fr-FR"]);
 
-  let install = await AddonManager.getInstallForFile(do_get_addon("test_locale"));
+  let xpi = AddonTestUtils.createTempXPIFile(ADDONS.test_locale);
+  let install = await AddonManager.getInstallForFile(xpi);
   Assert.equal(install.addon.name, "fr-FR Name");
   Assert.equal(install.addon.description, "fr-FR Description");
 
   await new Promise(resolve => {
     prepare_test({
       "addon1@tests.mozilla.org": [
         ["onInstalling", false],
         ["onInstalled", false],
--- a/toolkit/mozapps/extensions/test/xpcshell/test_pass_symbol.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_pass_symbol.js
@@ -6,26 +6,96 @@ const PASS_PREF = "symboltest.instanceid
 const FAIL_BOGUS_PREF = "symboltest.instanceid.fail_bogus";
 const FAIL_ID_PREF = "symboltest.instanceid.fail_bogus";
 const ADDON_ID = "test_symbol@tests.mozilla.org";
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
 BootstrapMonitor.init();
 
+const ADDONS = {
+  test_symbol: {
+    "install.rdf": {
+      "id": "test_symbol@tests.mozilla.org",
+      "name": "Test Symbol",
+    },
+    "bootstrap.js": String.raw`ChromeUtils.import("resource://gre/modules/Services.jsm");
+ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
+
+const PASS_PREF = "symboltest.instanceid.pass";
+const FAIL_BOGUS_PREF = "symboltest.instanceid.fail_bogus";
+const FAIL_ID_PREF = "symboltest.instanceid.fail_bogus";
+const ADDON_ID = "test_symbol@tests.mozilla.org";
+
+// normally we would use BootstrapMonitor here, but we need a reference to
+// the symbol inside XPIProvider.jsm.
+function startup(data, reason) {
+  Services.prefs.setBoolPref(PASS_PREF, false);
+  Services.prefs.setBoolPref(FAIL_BOGUS_PREF, false);
+  Services.prefs.setBoolPref(FAIL_ID_PREF, false);
+
+  // test with the correct symbol
+  if (data.hasOwnProperty("instanceID") && data.instanceID) {
+    AddonManager.getAddonByInstanceID(data.instanceID)
+      .then(addon => {
+        if (addon.id == ADDON_ID) {
+          Services.prefs.setBoolPref(PASS_PREF, true);
+        }
+      }).catch(err => {
+        throw Error("no addon found for symbol");
+      });
+
+  }
+
+  // test with a totally bogus symbol
+  AddonManager.getAddonByInstanceID(Symbol("bad symbol"))
+    .then(addon => {
+      // there is no symbol by this name, so null should be returned
+      if (addon == null) {
+        Services.prefs.setBoolPref(FAIL_BOGUS_PREF, true);
+      } else {
+        throw Error("bad symbol should not match:", addon);
+      }
+    }).catch(err => {
+      throw Error("promise should not have rejected: " + err);
+    });
+
+  // try to make a matching symbol - this should fail because it's not a
+  // reference to the same symbol stored inside the addons manager.
+  AddonManager.getAddonByInstanceID(Symbol(ADDON_ID))
+    .then(addon => {
+      // there is no symbol by this name, so null should be returned
+      if (addon == null) {
+        Services.prefs.setBoolPref(FAIL_ID_PREF, true);
+      } else {
+        throw Error("bad symbol should not match:", addon);
+      }
+    }).catch(err => {
+      throw Error("promise should not have rejected: " + err);
+    });
+
+}
+
+function install(data, reason) {}
+function shutdown(data, reason) {}
+function uninstall(data, reason) {}
+`,
+  },
+};
+
 // symbol is passed when add-on is installed
 add_task(async function() {
   await promiseStartupManager();
 
   PromiseTestUtils.expectUncaughtRejection(/no addon found for symbol/);
 
   for (let pref of [PASS_PREF, FAIL_BOGUS_PREF, FAIL_ID_PREF])
     Services.prefs.clearUserPref(pref);
 
-  await promiseInstallAllFiles([do_get_addon("test_symbol")], true);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_symbol);
 
   let addon = await promiseAddonByID(ADDON_ID);
 
   Assert.notEqual(addon, null);
   Assert.equal(addon.version, "1.0");
   Assert.equal(addon.name, "Test Symbol");
   Assert.ok(addon.isCompatible);
   Assert.ok(!addon.appDisabled);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_proxy.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_proxy.js
@@ -3,18 +3,16 @@
  */
 
 const ID = "proxy1@tests.mozilla.org";
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
 BootstrapMonitor.init();
 
-const BOOTSTRAP_JS = `ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);`;
-
 // Ensure that a proxy file to an add-on with a valid manifest works.
 add_task(async function() {
   Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_REQUIRED, false);
 
   await promiseStartupManager();
 
   let tempdir = gTmpD.clone();
   let unpackedAddon = await promiseWriteInstallRDFToDir({
@@ -24,17 +22,17 @@ add_task(async function() {
     unpack: true,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1"
     }],
     name: "Test Bootstrap 1 (proxy)",
   }, tempdir, ID, {
-    "bootstrap.js": BOOTSTRAP_JS,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   });
 
   // create proxy file in profile/extensions dir
   let extensionsDir = gProfD.clone();
   extensionsDir.append("extensions");
   let proxyFile = await promiseWriteProxyFileToDir(extensionsDir, unpackedAddon, ID);
 
   await promiseRestartManager();
@@ -82,17 +80,17 @@ add_task(async function() {
     unpack: true,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1"
     }],
     name: "Test Bootstrap 1 (proxy)",
   }, tempdir, ID, {
-    "bootstrap.js": BOOTSTRAP_JS,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   });
 
   // create proxy file in profile/extensions dir
   let extensionsDir = gProfD.clone();
   extensionsDir.append("extensions");
   let proxyFile = await promiseWriteProxyFileToDir(extensionsDir, unpackedAddon, ID);
 
   await promiseRestartManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_reload.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_reload.js
@@ -1,72 +1,84 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
-const sampleAddon = {
-  id: "webextension1@tests.mozilla.org",
-  name: "webextension_1",
+const ID = "webextension1@tests.mozilla.org";
+
+const ADDONS = {
+  webextension_1: {
+    "manifest.json": {
+      "name": "Web Extension Name",
+      "version": "1.0",
+      "manifest_version": 2,
+      "applications": {
+        "gecko": {
+          "id": ID
+        }
+      },
+      "icons": {
+        "48": "icon48.png",
+        "64": "icon64.png"
+      }
+    },
+    "chrome.manifest": "content webex ./\n"
+  },
 };
 
 const manifestSample = {
   id: "bootstrap1@tests.mozilla.org",
   version: "1.0",
   bootstrap: true,
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
     maxVersion: "1"
   }],
 };
 
-async function installAddon(fixtureName, addonID) {
-  await promiseInstallAllFiles([do_get_addon(fixtureName)]);
-  return promiseAddonByID(addonID);
-}
-
 async function tearDownAddon(addon) {
   await addon.uninstall();
   await promiseShutdownManager();
 }
 
 add_task(async function test_reloading_a_temp_addon() {
   if (AppConstants.MOZ_APP_NAME == "thunderbird")
     return;
   await promiseRestartManager();
-  await AddonManager.installTemporaryAddon(do_get_addon(sampleAddon.name));
-  const addon = await promiseAddonByID(sampleAddon.id);
+  let xpi = AddonTestUtils.createTempXPIFile(ADDONS.webextension_1);
+  const addon = await AddonManager.installTemporaryAddon(xpi);
 
   var receivedOnUninstalled = false;
   var receivedOnUninstalling = false;
   var receivedOnInstalled = false;
   var receivedOnInstalling = false;
 
   const onReload = new Promise(resolve => {
     const listener = {
       onUninstalling: (addonObj) => {
-        if (addonObj.id === sampleAddon.id) {
+        if (addonObj.id === ID) {
           receivedOnUninstalling = true;
         }
       },
       onUninstalled: (addonObj) => {
-        if (addonObj.id === sampleAddon.id) {
+        if (addonObj.id === ID) {
           receivedOnUninstalled = true;
         }
       },
       onInstalling: (addonObj) => {
         receivedOnInstalling = true;
-        equal(addonObj.id, sampleAddon.id);
+        equal(addonObj.id, ID);
       },
       onInstalled: (addonObj) => {
         receivedOnInstalled = true;
-        equal(addonObj.id, sampleAddon.id);
+        equal(addonObj.id, ID);
         // This should be the last event called.
         AddonManager.removeAddonListener(listener);
         resolve();
       },
     };
     AddonManager.addAddonListener(listener);
   });
 
@@ -81,17 +93,17 @@ add_task(async function test_reloading_a
   equal(receivedOnInstalling, true, "reload should trigger onInstalling");
   equal(receivedOnInstalled, true, "reload should trigger onInstalled");
 
   await tearDownAddon(addon);
 });
 
 add_task(async function test_can_reload_permanent_addon() {
   await promiseRestartManager();
-  const addon = await installAddon(sampleAddon.name, sampleAddon.id);
+  const {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.webextension_1);
 
   let disabledCalled = false;
   let enabledCalled = false;
   AddonManager.addAddonListener({
     onDisabled: (aAddon) => {
       Assert.ok(!enabledCalled);
       disabledCalled = true;
     },
--- a/toolkit/mozapps/extensions/test/xpcshell/test_seen.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_seen.js
@@ -9,37 +9,61 @@ profileDir.append("extensions");
 
 // By default disable add-ons from the profile and the system-wide scope
 const SCOPES = AddonManager.SCOPE_PROFILE | AddonManager.SCOPE_SYSTEM;
 Services.prefs.setIntPref("extensions.enabledScopes", SCOPES);
 Services.prefs.setIntPref("extensions.autoDisableScopes", SCOPES);
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
+const ADDONS = {
+  test_bootstrap1_1: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+  test_bootstrap1_2: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+}
+
+
 // Installing an add-on through the API should mark it as seen
 add_task(async function() {
   await promiseStartupManager();
 
-  let install = await promiseInstallFile(do_get_addon("test_bootstrap1_1"));
+  let install = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
   Assert.equal(install.state, AddonManager.STATE_INSTALLED);
   Assert.ok(!hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
 
   let addon = install.addon;
   Assert.equal(addon.version, "1.0");
   Assert.ok(!addon.foreignInstall);
   Assert.ok(addon.seen);
 
   await promiseRestartManager();
 
   addon = await promiseAddonByID(ID);
   Assert.ok(!addon.foreignInstall);
   Assert.ok(addon.seen);
 
   // Installing an update should retain that
-  install = await promiseInstallFile(do_get_addon("test_bootstrap1_2"));
+  install = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_2);
   Assert.equal(install.state, AddonManager.STATE_INSTALLED);
   Assert.ok(!hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
 
   addon = install.addon;
   Assert.equal(addon.version, "2.0");
   Assert.ok(!addon.foreignInstall);
   Assert.ok(addon.seen);
 
@@ -64,17 +88,17 @@ add_task(async function() {
   registerDirectory("XRESysSExtPD", systemParentDir.clone());
   registerCleanupFunction(() => {
     systemParentDir.remove(true);
   });
 
   let systemDir = systemParentDir.clone();
   systemDir.append(Services.appinfo.ID);
 
-  let path = await manuallyInstall(do_get_addon("test_bootstrap1_1"), systemDir, ID);
+  let path = await manuallyInstall(XPIS.test_bootstrap1_1, systemDir, ID);
   // Make sure the startup code will detect sideloaded updates
   setExtensionModifiedTime(path, Date.now() - 10000);
 
   await promiseStartupManager();
   await AddonManagerPrivate.getNewSideloads();
 
   let addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "1.0");
@@ -92,17 +116,17 @@ add_task(async function() {
   path.remove(true);
 
   Services.prefs.setIntPref("extensions.startupScanScopes", savedStartupScanScopes);
 });
 
 // Sideloading an add-on in the profile should mark it as unseen and it should
 // remain unseen after an update is sideloaded.
 add_task(async function() {
-  let path = await manuallyInstall(do_get_addon("test_bootstrap1_1"), profileDir, ID);
+  let path = await manuallyInstall(XPIS.test_bootstrap1_1, profileDir, ID);
   // Make sure the startup code will detect sideloaded updates
   setExtensionModifiedTime(path, Date.now() - 10000);
 
   await promiseStartupManager();
 
   let addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "1.0");
   Assert.ok(addon.foreignInstall);
@@ -113,34 +137,34 @@ add_task(async function() {
   addon = await promiseAddonByID(ID);
   Assert.ok(addon.foreignInstall);
   Assert.ok(!addon.seen);
 
   await promiseShutdownManager();
 
   // Sideloading an update shouldn't change the state
   manuallyUninstall(profileDir, ID);
-  await manuallyInstall(do_get_addon("test_bootstrap1_2"), profileDir, ID);
+  await manuallyInstall(XPIS.test_bootstrap1_2, profileDir, ID);
   setExtensionModifiedTime(path, Date.now());
 
   await promiseStartupManager();
 
   addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "2.0");
   Assert.ok(addon.foreignInstall);
   Assert.ok(!addon.seen);
 
   await addon.uninstall();
   await promiseShutdownManager();
 });
 
 // Sideloading an add-on in the profile should mark it as unseen and it should
 // remain unseen after a regular update.
 add_task(async function() {
-  let path = await manuallyInstall(do_get_addon("test_bootstrap1_1"), profileDir, ID);
+  let path = await manuallyInstall(XPIS.test_bootstrap1_1, profileDir, ID);
   // Make sure the startup code will detect sideloaded updates
   setExtensionModifiedTime(path, Date.now() - 10000);
 
   await promiseStartupManager();
 
   let addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "1.0");
   Assert.ok(addon.foreignInstall);
@@ -148,17 +172,17 @@ add_task(async function() {
 
   await promiseRestartManager();
 
   addon = await promiseAddonByID(ID);
   Assert.ok(addon.foreignInstall);
   Assert.ok(!addon.seen);
 
   // Updating through the API shouldn't change the state
-  let install = await promiseInstallFile(do_get_addon("test_bootstrap1_2"));
+  let install = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_2);
   Assert.equal(install.state, AddonManager.STATE_INSTALLED);
   Assert.ok(!hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
 
   addon = install.addon;
   Assert.ok(addon.foreignInstall);
   Assert.ok(!addon.seen);
 
   await promiseRestartManager();
@@ -170,17 +194,17 @@ add_task(async function() {
 
   await addon.uninstall();
   await promiseShutdownManager();
 });
 
 // After a sideloaded addon has been seen, sideloading an update should
 // not reset it to unseen.
 add_task(async function() {
-  let path = await manuallyInstall(do_get_addon("test_bootstrap1_1"), profileDir, ID);
+  let path = await manuallyInstall(XPIS.test_bootstrap1_1, profileDir, ID);
   // Make sure the startup code will detect sideloaded updates
   setExtensionModifiedTime(path, Date.now() - 10000);
 
   await promiseStartupManager();
 
   let addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "1.0");
   Assert.ok(addon.foreignInstall);
@@ -193,34 +217,34 @@ add_task(async function() {
   addon = await promiseAddonByID(ID);
   Assert.ok(addon.foreignInstall);
   Assert.ok(addon.seen);
 
   await promiseShutdownManager();
 
   // Sideloading an update shouldn't change the state
   manuallyUninstall(profileDir, ID);
-  await manuallyInstall(do_get_addon("test_bootstrap1_2"), profileDir, ID);
+  await manuallyInstall(XPIS.test_bootstrap1_2, profileDir, ID);
   setExtensionModifiedTime(path, Date.now());
 
   await promiseStartupManager();
 
   addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "2.0");
   Assert.ok(addon.foreignInstall);
   Assert.ok(addon.seen);
 
   await addon.uninstall();
   await promiseShutdownManager();
 });
 
 // After a sideloaded addon has been seen, manually applying an update should
 // not reset it to unseen.
 add_task(async function() {
-  let path = await manuallyInstall(do_get_addon("test_bootstrap1_1"), profileDir, ID);
+  let path = await manuallyInstall(XPIS.test_bootstrap1_1, profileDir, ID);
   // Make sure the startup code will detect sideloaded updates
   setExtensionModifiedTime(path, Date.now() - 10000);
 
   await promiseStartupManager();
 
   let addon = await promiseAddonByID(ID);
   Assert.equal(addon.version, "1.0");
   Assert.ok(addon.foreignInstall);
@@ -230,17 +254,17 @@ add_task(async function() {
 
   await promiseRestartManager();
 
   addon = await promiseAddonByID(ID);
   Assert.ok(addon.foreignInstall);
   Assert.ok(addon.seen);
 
   // Updating through the API shouldn't change the state
-  let install = await promiseInstallFile(do_get_addon("test_bootstrap1_2"));
+  let install = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_2);
   Assert.equal(install.state, AddonManager.STATE_INSTALLED);
   Assert.ok(!hasFlag(install.addon.pendingOperations, AddonManager.PENDING_INSTALL));
 
   addon = install.addon;
   Assert.ok(addon.foreignInstall);
   Assert.ok(addon.seen);
 
   await promiseRestartManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js
@@ -63,16 +63,17 @@ var addon4 = {
     minVersion: "1",
     maxVersion: "1"
   }]
 };
 
 // Should be ignored because it has no version
 var addon5 = {
   id: "addon5@tests.mozilla.org",
+  version: undefined,
   name: "Test 5",
   bootstrap: true,
   targetApplications: [{
     id: "xpcshell@tests.mozilla.org",
     minVersion: "1",
     maxVersion: "1"
   }]
 };
--- a/toolkit/mozapps/extensions/test/xpcshell/test_switch_os.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_switch_os.js
@@ -8,20 +8,31 @@ const ID = "bootstrap1@tests.mozilla.org
 
 BootstrapMonitor.init();
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
+const ADDONS = {
+  test_bootstrap1_1: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "version": "1.0",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
 add_task(async function() {
   await promiseStartupManager();
 
-  await promiseInstallFile(do_get_addon("test_bootstrap1_1"));
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
 
   let addon = await promiseAddonByID(ID);
   Assert.notEqual(addon, null);
 
   BootstrapMonitor.checkAddonStarted(ID);
   Assert.ok(!addon.userDisabled);
   Assert.ok(addon.isActive);
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
@@ -3,16 +3,39 @@
  */
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 const ID = "bootstrap1@tests.mozilla.org";
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
+const ADDONS = {
+  test_bootstrap1_1: {
+    "install.rdf": {
+      "id": ID,
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+  test_bootstrap1_2: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "version": "2.0",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+}
+
 function waitForBootstrapEvent(expectedEvent, addonId) {
   return new Promise(resolve => {
     function listener(msg, {method, params, reason}) {
       if (params.id === addonId && method === expectedEvent) {
         resolve({params, method, reason});
         AddonTestUtils.off("bootstrap-method", listener);
       } else {
         info(`Ignoring bootstrap event: ${method} for ${params.id}`);
@@ -64,17 +87,17 @@ add_task(async function() {
       Assert.equal(aInstall.version, "1.0");
       installedCalled = true;
     },
     onInstallStarted: (aInstall) => {
       do_throw("onInstallStarted called unexpectedly");
     }
   });
 
-  await AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
+  await AddonManager.installTemporaryAddon(XPIS.test_bootstrap1_1);
 
   Assert.ok(extInstallCalled);
   Assert.ok(installingCalled);
   Assert.ok(installedCalled);
 
   const install = Monitor.checkInstalled(ID, "1.0");
   equal(install.reason, BOOTSTRAP_REASONS.ADDON_INSTALL);
 
@@ -113,17 +136,17 @@ add_task(async function() {
   Assert.equal(addon, null);
 
   await promiseRestartManager();
 });
 
 // Install a temporary add-on over the top of an existing add-on.
 // Restart and make sure the existing add-on comes back.
 add_task(async function() {
-  let {addon} = await promiseInstallFile(do_get_addon("test_bootstrap1_2"), true);
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_2);
 
   Monitor.checkInstalled(ID, "2.0");
   Monitor.checkStarted(ID, "2.0");
 
   checkAddon(ID, addon, {
     version: "2.0",
     name: "Test Bootstrap 1",
     isCompatible: true,
@@ -143,22 +166,16 @@ add_task(async function() {
       if (packed && AppConstants.platform == "win") {
         continue;
       }
 
       let files = {
         "install.rdf": AddonTestUtils.createInstallRDF({
           id: ID,
           version: newversion,
-          bootstrap: true,
-          targetApplications: [{
-            id: "xpcshell@tests.mozilla.org",
-            minVersion: "1",
-            maxVersion: "1"
-          }],
           name: "Test Bootstrap 1 (temporary)",
         }),
         "bootstrap.js": bootstrapJS,
       };
 
       let target;
       if (!packed) {
         // Unpacked extensions don't support signing, which means that
@@ -655,17 +672,17 @@ add_task(async function() {
 
   unpackedAddon.remove(true);
   await promiseRestartManager();
 });
 
 // Install a temporary add-on over the top of an existing disabled add-on.
 // After restart, the existing add-on should continue to be installed and disabled.
 add_task(async function() {
-  let {addon} = await promiseInstallFile(do_get_addon("test_bootstrap1_1"), true);
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
 
   Monitor.checkInstalled(ID, "1.0");
   Monitor.checkStarted(ID, "1.0");
 
   await addon.disable();
 
   Monitor.checkInstalled(ID, "1.0");
   Monitor.checkNotStarted(ID);
@@ -733,17 +750,17 @@ add_task(async function() {
   Monitor.checkNotStarted(ID);
 
   await promiseRestartManager();
 });
 
 // Installing a temporary add-on when there is already a temporary
 // add-on should fail.
 add_task(async function() {
-  await AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
+  await AddonManager.installTemporaryAddon(XPIS.test_bootstrap1_1);
 
   let addon = await promiseAddonByID(ID);
 
   Monitor.checkInstalled(ID, "1.0");
   Monitor.checkStarted(ID, "1.0");
 
   checkAddon(ID, addon, {
     version: "1.0",
@@ -751,42 +768,42 @@ add_task(async function() {
     isCompatible: true,
     appDisabled: false,
     isActive: true,
     type: "extension",
     isWebExtension: false,
     signedState: mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_PRIVILEGED : AddonManager.SIGNEDSTATE_NOT_REQUIRED,
   });
 
-  await AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
+  await AddonManager.installTemporaryAddon(XPIS.test_bootstrap1_1);
 
   Monitor.checkInstalled(ID, "1.0");
   Monitor.checkStarted(ID, "1.0");
 
   await promiseRestartManager();
 
   Monitor.checkNotInstalled(ID);
   Monitor.checkNotStarted(ID);
 });
 
 // Check that a temporary add-on is marked as such.
 add_task(async function() {
-  await AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
+  await AddonManager.installTemporaryAddon(XPIS.test_bootstrap1_1);
   const addon = await promiseAddonByID(ID);
 
   checkAddon(ID, addon, {
     temporarilyInstalled: true,
   });
 
   await promiseRestartManager();
 });
 
 // Check that a permanent add-on is not marked as temporarily installed.
 add_task(async function() {
-  let {addon} = await promiseInstallFile(do_get_addon("test_bootstrap1_1"), true);
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
 
   checkAddon(ID, addon, {
     temporarilyInstalled: false,
   });
 
   await promiseRestartManager();
 });
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js
@@ -1,12 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+const ADDONS = {
+  test_bootstrap1_1: {
+    "install.rdf": {
+      "id": "bootstrap1@tests.mozilla.org",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   await promiseStartupManager();
 });
 
 add_task(async function() {
   let profileDir = OS.Constants.Path.profileDir;
   let trashDir = OS.Path.join(profileDir, "extensions", "trash");
@@ -35,17 +45,17 @@ add_task(async function() {
         ok(true, "extension installation should not have failed");
         resolve();
       }
     };
 
     AddonManager.addInstallListener(listener);
   });
 
-  await promiseInstallAllFiles([do_get_addon("test_bootstrap1_1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1);
 
   // The testFile should still exist at this point because we have not
   // yet closed the file handle and as a result, Windows cannot remove it.
   fileExists = await OS.File.exists(testFile);
   ok(fileExists, "test.txt should still exist");
 
   // Wait for the AddonManager to tell us if the installation of the extension
   // succeeded or not.
--- a/toolkit/mozapps/extensions/test/xpcshell/test_undouninstall.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_undouninstall.js
@@ -13,16 +13,45 @@ const ADDON_UPGRADE                   = 
 
 const ID = "undouninstall1@tests.mozilla.org";
 const INCOMPAT_ID = "incompatible@tests.mozilla.org";
 
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
+const ADDONS = {
+  test_undoincompatible: {
+    "install.rdf": {
+      "id": "incompatible@tests.mozilla.org",
+      "name": "Incompatible Addon",
+      "targetApplications": [
+        {
+          "id": "xpcshell@tests.mozilla.org",
+          "minVersion": "2",
+          "maxVersion": "2"
+        }
+      ]
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+  test_undouninstall1: {
+    "install.rdf": {
+      "id": "undouninstall1@tests.mozilla.org",
+      "name": "Test Bootstrap 1",
+    },
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS
+  },
+};
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+}
+
 BootstrapMonitor.init();
 
 function getStartupReason(id) {
   let info = BootstrapMonitor.started.get(id);
   return info ? info.reason : undefined;
 }
 
 function getShutdownReason(id) {
@@ -61,17 +90,17 @@ add_task(async function uninstallRestart
       ["onInstalling", false],
       "onInstalled"
     ]
   }, [
     "onNewInstall",
     "onInstallStarted",
     "onInstallEnded"
   ]);
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
   ensure_test_completed();
 
   let a1 = await promiseAddonByID(ID);
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
@@ -120,17 +149,17 @@ add_task(async function cancelUninstallO
       ["onInstalling", false],
       "onInstalled"
     ]
   }, [
     "onNewInstall",
     "onInstallStarted",
     "onInstallEnded"
   ]);
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
   ensure_test_completed();
 
   let a1 = await promiseAddonByID(ID);
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
@@ -189,17 +218,17 @@ add_task(async function cancelUninstallO
   Assert.ok(!a1.userDisabled);
 
   await a1.uninstall();
 });
 
 // Tests that reinstalling an enabled restartless add-on waiting to be
 // uninstalled aborts the uninstall and leaves the add-on enabled
 add_task(async function reinstallAddonAwaitingUninstall() {
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
 
   let a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
   Assert.equal(getStartupReason(ID), ADDON_INSTALL);
@@ -231,17 +260,17 @@ add_task(async function reinstallAddonAw
       "onInstalled"
     ]
   }, [
     "onNewInstall",
     "onInstallStarted",
     "onInstallEnded"
   ]);
 
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
 
   a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   ensure_test_completed();
 
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getUninstallReason(ID), ADDON_UPGRADE);
@@ -267,17 +296,17 @@ add_task(async function reinstallAddonAw
   Assert.ok(!a1.userDisabled);
 
   await a1.uninstall();
 });
 
 // Tests that a disabled restartless add-on can be uninstalled and goes away
 // when the uninstall is committed
 add_task(async function uninstallDisabledRestartless() {
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
 
   let a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
   Assert.equal(getStartupReason(ID), ADDON_INSTALL);
@@ -332,17 +361,17 @@ add_task(async function cancelUninstallD
       ["onInstalling", false],
       "onInstalled"
     ]
   }, [
     "onNewInstall",
     "onInstallStarted",
     "onInstallEnded"
   ]);
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
   ensure_test_completed();
 
   let a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
@@ -409,17 +438,17 @@ add_task(async function cancelUninstallD
   Assert.ok(a1.userDisabled);
 
   await a1.uninstall();
 });
 
 // Tests that reinstalling a disabled restartless add-on waiting to be
 // uninstalled aborts the uninstall and leaves the add-on disabled
 add_task(async function reinstallDisabledAddonAwaitingUninstall() {
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
 
   let a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
   Assert.equal(getStartupReason(ID), ADDON_INSTALL);
@@ -456,17 +485,17 @@ add_task(async function reinstallDisable
       "onInstalled"
     ]
   }, [
     "onNewInstall",
     "onInstallStarted",
     "onInstallEnded"
   ]);
 
-  await promiseInstallAllFiles([do_get_addon("test_undouninstall1")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undouninstall1);
 
   a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
 
   ensure_test_completed();
 
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonNotStarted(ID, "1.0");
   Assert.equal(getUninstallReason(ID), ADDON_UPGRADE);
@@ -486,17 +515,17 @@ add_task(async function reinstallDisable
   Assert.ok(a1.userDisabled);
 
   await a1.uninstall();
 });
 
 
 // Test that uninstalling a temporary addon can be canceled
 add_task(async function cancelUninstallTemporary() {
-  await AddonManager.installTemporaryAddon(do_get_addon("test_undouninstall1"));
+  await AddonManager.installTemporaryAddon(XPIS.test_undouninstall1);
 
   let a1 = await promiseAddonByID("undouninstall1@tests.mozilla.org");
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonInstalled(ID, "1.0");
   BootstrapMonitor.checkAddonStarted(ID, "1.0");
   Assert.equal(getInstallReason(ID), ADDON_INSTALL);
   Assert.equal(getStartupReason(ID), ADDON_INSTALL);
   Assert.equal(a1.pendingOperations, AddonManager.PENDING_NONE);
@@ -529,17 +558,17 @@ add_task(async function cancelUninstallT
   Assert.equal(a1.pendingOperations, 0);
 
   await promiseRestartManager();
 });
 
 // Tests that cancelling the uninstall of an incompatible restartless addon
 // does not start the addon
 add_task(async function cancelUninstallIncompatibleRestartless() {
-  await promiseInstallAllFiles([do_get_addon("test_undoincompatible")]);
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_undoincompatible);
 
   let a1 = await promiseAddonByID(INCOMPAT_ID);
   Assert.notEqual(a1, null);
   BootstrapMonitor.checkAddonNotStarted(INCOMPAT_ID);
   Assert.ok(!a1.isActive);
 
   prepare_test({
     "incompatible@tests.mozilla.org": [
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update.js
@@ -27,80 +27,45 @@ profileDir.append("extensions");
 
 var originalSyncGUID;
 
 const ADDONS = {
   test_update: {
     "install.rdf": {
       id: "addon1@tests.mozilla.org",
       version: "2.0",
-      bootstrap: true,
       name: "Test 1",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
   },
   test_update8: {
     "install.rdf": {
       id: "addon8@tests.mozilla.org",
       version: "2.0",
-      bootstrap: true,
       name: "Test 8",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
   },
   test_update12: {
     "install.rdf": {
       id: "addon12@tests.mozilla.org",
       version: "2.0",
-      bootstrap: true,
       name: "Test 12",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
   },
   test_install2_1: {
     "install.rdf": {
       id: "addon2@tests.mozilla.org",
       version: "2.0",
-      bootstrap: true,
       name: "Real Test 2",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
   },
   test_install2_2: {
     "install.rdf": {
       id: "addon2@tests.mozilla.org",
       version: "3.0",
-      bootstrap: true,
       name: "Real Test 3",
-      description: "Test Description",
-
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
     },
   },
 };
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
 
 const XPIS = {};
@@ -116,44 +81,33 @@ add_task(async function setup() {
 });
 
 add_task(async function() {
   AddonTestUtils.updateReason = AddonManager.UPDATE_WHEN_USER_REQUESTED;
 
   await promiseStartupManager();
   await promiseInstallXPI({
     id: "addon1@tests.mozilla.org",
-    version: "1.0",
-    bootstrap: true,
     updateURL: "http://example.com/data/" + updateFile,
-    targetApplications: [{
-      id: appId,
-      minVersion: "1",
-      maxVersion: "1"
-    }],
     name: "Test Addon 1",
   });
 
   await promiseInstallXPI({
     id: "addon2@tests.mozilla.org",
-    version: "1.0",
-    bootstrap: true,
     updateURL: "http://example.com/data/" + updateFile,
     targetApplications: [{
       id: appId,
       minVersion: "0",
       maxVersion: "0"
     }],
     name: "Test Addon 2",
   });
 
   await promiseInstallXPI({
     id: "addon3@tests.mozilla.org",
-    version: "1.0",
-    bootstrap: true,
     updateURL: "http://example.com/data/" + updateFile,
     targetApplications: [{
       id: appId,
       minVersion: "5",
       maxVersion: "5"
     }],
     name: "Test Addon 3",
   });
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
@@ -45,17 +45,16 @@ function makeCancelListener() {
 
 // Set up the HTTP server so that we can control when it responds
 var httpReceived = PromiseUtils.defer();
 function dataHandler(aRequest, aResponse) {
   aResponse.processAsync();
   httpReceived.resolve([aRequest, aResponse]);
 }
 var testserver = new HttpServer();
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 testserver.registerPathHandler("/data/test_update.json", dataHandler);
 testserver.start(-1);
 gPort = testserver.identity.primaryPort;
 
 // Set up an add-on for update check
 add_task(async function setup() {
   await promiseWriteInstallRDFForExtension({
     id: "addon1@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
@@ -6,17 +6,16 @@
 // %COMPATIBILITY_MODE% token in the update URL.
 
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
 var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
-testserver.registerDirectory("/addons/", do_get_file("addons"));
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 async function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck_errors.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck_errors.js
@@ -12,17 +12,16 @@ const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
   testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
   testserver.registerDirectory("/data/", do_get_file("data"));
-  testserver.registerDirectory("/addons/", do_get_file("addons"));
 
   await promiseStartupManager();
 });
 
 // Verify that an update check returns the correct errors.
 add_task(async function() {
   let {addon} = await promiseInstallXPI({
     id: "addon1@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
@@ -5,16 +5,36 @@
 // This verifies that updating an add-on to a new ID works
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
+const ADDONS = {
+  test_updateid1: {
+    "install.rdf": {
+      "id": "addon1@tests.mozilla.org",
+      "updateURL": "http://example.com/data/test_updateid.rdf",
+      "name": "Test Addon 1",
+    },
+    "bootstrap.js": "function install(data, reason) {}\nfunction startup(data, reason) {}\nfunction shutdown(data, reason) {}\nfunction uninstall(data, reason) {}\n"
+  },
+  test_updateid2: {
+    "install.rdf": {
+      "id": "addon1.changed@tests.mozilla.org",
+      "version": "2.0",
+      "updateURL": "http://localhost:4444/data/test_updateid.rdf",
+      "name": "Test Addon 1",
+    },
+    "bootstrap.js": "function install(data, reason) {}\nfunction startup(data, reason) {}\nfunction shutdown(data, reason) {}\nfunction uninstall(data, reason) {}\n"
+  },
+};
+
 function promiseInstallUpdate(install) {
   return new Promise((resolve, reject) => {
     install.addListener({
       onDownloadFailed: () => {
         let err = new Error("download error");
         err.code = install.error;
         reject(err);
       },
@@ -28,26 +48,31 @@ function promiseInstallUpdate(install) {
 
     install.install();
   });
 }
 
 // Create and configure the HTTP server.
 let testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 testserver.registerDirectory("/data/", do_get_file("data"));
-testserver.registerDirectory("/addons/", do_get_file("addons"));
+
+const XPIS = {};
+for (let [name, files] of Object.entries(ADDONS)) {
+  XPIS[name] = AddonTestUtils.createTempXPIFile(files);
+  testserver.registerFile(`/addons/${name}.xpi`, XPIS[name]);
+}
 
 add_task(async function setup() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
   await promiseStartupManager();
 });
 
 // Verify that an update to an add-on with a new ID fails
 add_task(async function test_update_new_id() {
-  await promiseInstallFile(do_get_addon("test_updateid1"));
+  await AddonTestUtils.promiseInstallXPI(ADDONS.test_updateid1);
 
   let addon = await promiseAddonByID("addon1@tests.mozilla.org");
   Assert.notEqual(addon, null);
   Assert.equal(addon.version, "1.0");
 
   let update = await promiseFindAddonUpdates(addon, AddonManager.UPDATE_WHEN_USER_REQUESTED);
   let install = update.updateAvailable;
   Assert.equal(install.name, addon.name);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
@@ -4,28 +4,83 @@
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 const ID = "webextension1@tests.mozilla.org";
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
+const ADDONS = {
+  webextension_1: {
+    "manifest.json": {
+      "name": "Web Extension Name",
+      "version": "1.0",
+      "manifest_version": 2,
+      "applications": {
+        "gecko": {
+          "id": "webextension1@tests.mozilla.org"
+        }
+      },
+      "icons": {
+        "48": "icon48.png",
+        "64": "icon64.png"
+      }
+    },
+    "chrome.manifest": "content webex ./\n"
+  },
+  webextension_3: {
+    "manifest.json": {
+      "name": "Web Extensiøn __MSG_name__",
+      "description": "Descriptïon __MSG_desc__ of add-on",
+      "version": "1.0",
+      "manifest_version": 2,
+      "default_locale": "en",
+      "applications": {
+        "gecko": {
+          "id": "webextension3@tests.mozilla.org"
+        }
+      }
+    },
+    "_locales/en/messages.json": {
+      "name": {
+        "message": "foo ☹",
+        "description": "foo"
+      },
+      "desc": {
+        "message": "bar ☹",
+        "description": "bar"
+      }
+    },
+    "_locales/fr/messages.json": {
+      "name": {
+        "message": "le foo ☺",
+        "description": "foo"
+      },
+      "desc": {
+        "message": "le bar ☺",
+        "description": "bar"
+      }
+    }
+  },
+};
+
+
 let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
 
 const { GlobalManager } = ChromeUtils.import("resource://gre/modules/Extension.jsm", {});
 
 add_task(async function test_1() {
   await promiseStartupManager();
 
   equal(GlobalManager.extensionMap.size, 0);
 
-  let {addon} = await promiseInstallFile(do_get_addon("webextension_1"), true);
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.webextension_1);
 
   equal(GlobalManager.extensionMap.size, 1);
   ok(GlobalManager.extensionMap.has(ID));
 
   Assert.throws(() => chromeReg.convertChromeURL(Services.io.newURI("chrome://webex/content/webex.xul")),
                 error => error.result == Cr.NS_ERROR_FILE_NOT_FOUND,
                 "Chrome manifest should not have been registered");
 
@@ -119,17 +174,17 @@ add_task(async function test_2() {
   await addon.uninstall();
 
   await promiseRestartManager();
 });
 
 add_task(async function test_manifest_localization() {
   const extensionId = "webextension3@tests.mozilla.org";
 
-  let {addon} = await promiseInstallFile(do_get_addon("webextension_3"), true);
+  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDONS.webextension_3);
 
   await addon.disable();
 
   checkAddon(ID, addon, {
     name: "Web Extensiøn foo ☹",
     description: "Descriptïon bar ☹ of add-on",
   });
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_embedded.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_embedded.js
@@ -25,20 +25,16 @@ function promiseWebExtensionShutdown() {
       Management.off("shutdown", listener);
       resolve(extension);
     };
 
     Management.on("shutdown", listener);
   });
 }
 
-const BOOTSTRAP = String.raw`
-  Components.utils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
-`;
-
 const BOOTSTRAP_WITHOUT_SHUTDOWN = String.raw`
   Components.utils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this, [
     "install", "startup", "uninstall",
   ]);
 `;
 
 const EMBEDDED_WEBEXT_MANIFEST = JSON.stringify({
   name: "embedded webextension addon",
@@ -61,17 +57,17 @@ add_task(async function has_embedded_web
     bootstrap: true,
     hasEmbeddedWebExtension: true,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1.9.2"
     }]
   }, {
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
     "webextension/manifest.json": EMBEDDED_WEBEXT_MANIFEST,
   });
 
   await promiseInstallFile(xpiFile);
 
   let addon = await promiseAddonByID(ID);
 
   notEqual(addon, null, "Got an addon object as expected");
@@ -134,17 +130,17 @@ add_task(async function run_embedded_web
     bootstrap: true,
     hasEmbeddedWebExtension: true,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1.9.2"
     }]
   }, {
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
     "webextension/manifest.json": EMBEDDED_WEBEXT_MANIFEST,
   });
 
   await AddonManager.installTemporaryAddon(xpiFile);
 
   let addon = await promiseAddonByID(ID);
 
   notEqual(addon, null, "Got an addon object as expected");
@@ -219,17 +215,17 @@ add_task(async function reload_embedded_
     bootstrap: true,
     hasEmbeddedWebExtension: true,
     targetApplications: [{
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1.9.2"
     }]
   }, {
-    "bootstrap.js": BOOTSTRAP,
+    "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
     "webextension/manifest.json": EMBEDDED_WEBEXT_MANIFEST,
   });
 
   await AddonManager.installTemporaryAddon(xpiFile);
 
   let addon = await promiseAddonByID(ID);
 
   notEqual(addon, null, "Got an addon object as expected");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_langpack.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_langpack.js
@@ -9,16 +9,52 @@ const { L10nRegistry } = ChromeUtils.imp
 
 const ID = "langpack-und@test.mozilla.org";
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "58");
 
+const ADDONS = {
+  langpack_1: {
+    "browser/localization/und/browser.ftl": "message-browser = Value from Browser\n",
+    "localization/und/toolkit_test.ftl": "message-id1 = Value 1\n",
+    "chrome/und/locale/und/global/test.properties": "message = Value from .properties\n",
+    "manifest.json": {
+      "name": "und Language Pack",
+      "version": "1",
+      "manifest_version": 2,
+      "applications": {
+        "gecko": {
+          "id": "langpack-und@test.mozilla.org",
+          "strict_min_version": "58.0",
+          "strict_max_version": "58.*"
+        }
+      },
+      "sources": {
+        "browser": {
+          "base_path": "browser/"
+        }
+      },
+      "langpack_id": "und",
+      "languages": {
+        "und": {
+          "chrome_resources": {
+            "global": "chrome/und/locale/und/global/"
+          },
+          "version": "20171001190118"
+        }
+      },
+      "author": "Mozilla Localization Task Force",
+      "description": "Language pack for Testy for und"
+    }
+  },
+};
+
 function promiseLangpackStartup() {
   return new Promise(resolve => {
     const EVENT = "webextension-langpack-startup";
     Services.obs.addObserver(function observer() {
       Services.obs.removeObserver(observer, EVENT);
       resolve();
     }, EVENT);
   });
@@ -33,17 +69,17 @@ add_task(async function() {
   await promiseStartupManager();
 
   // Make sure that `und` locale is not installed.
   equal(L10nRegistry.getAvailableLocales().includes("und"), false);
   equal(Services.locale.getAvailableLocales().includes("und"), false);
 
   let [, {addon}] = await Promise.all([
     promiseLangpackStartup(),
-    promiseInstallFile(do_get_addon("langpack_1"), true),
+    AddonTestUtils.promiseInstallXPI(ADDONS.langpack_1),
   ]);
 
   // Now make sure that `und` locale is available.
   equal(L10nRegistry.getAvailableLocales().includes("und"), true);
   equal(Services.locale.getAvailableLocales().includes("und"), true);
 
   await addon.disable();
 
@@ -71,17 +107,17 @@ add_task(async function() {
 
 /**
  * This test verifies that registries are able to load and return
  * correct strings available in the language pack.
  */
 add_task(async function() {
   let [, {addon}] = await Promise.all([
     promiseLangpackStartup(),
-    promiseInstallFile(do_get_addon("langpack_1"), true),
+    AddonTestUtils.promiseInstallXPI(ADDONS.langpack_1),
   ]);
 
   {
     // Toolkit string
     let ctxs = L10nRegistry.generateContexts(["und"], ["toolkit_test.ftl"]);
     let ctx0 = (await ctxs.next()).value;
     equal(ctx0.hasMessage("message-id1"), true);
   }
@@ -112,17 +148,17 @@ add_task(async function() {
 
 /**
  * This test verifies that language pack will get disabled after app
  * gets upgraded.
  */
 add_task(async function() {
   let [, {addon}] = await Promise.all([
     promiseLangpackStartup(),
-    promiseInstallFile(do_get_addon("langpack_1"), true),
+    AddonTestUtils.promiseInstallXPI(ADDONS.langpack_1),
   ]);
   Assert.ok(addon.isActive);
 
   await promiseShutdownManager();
 
   gAppInfo.version = "59";
   gAppInfo.platformVersion = "59";