Bug 1451532 Clean up bootstrapped extensions in addon manager mochitests r=kmag
authorAndrew Swan <aswan@mozilla.com>
Mon, 19 Nov 2018 13:56:00 -0800
changeset 503585 77e400a477280361e26b3b2d2c72416e0861eb95
parent 503584 27ace8afa15d5379b503aaab800251adf1e90a4f
child 503586 c1d4918380adbf58e0fb231fb8de6940fce5f7c3
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1451532
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451532 Clean up bootstrapped extensions in addon manager mochitests r=kmag This is a quick pass to weed out some obsolete tests and update others. browser_doorhanger_installs.js still needs a more comprehensive pass to get rid of obsolete test cases.
browser/base/content/test/webextensions/browser_extension_sideloading.js
toolkit/mozapps/extensions/test/browser/addons/.hgignore
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/manifest.mf
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/mozilla.rsa
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/mozilla.sf
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/install.rdf
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/manifest.mf
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/mozilla.rsa
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/mozilla.sf
toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/install.rdf
toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/bootstrap.js
toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/frame-script.js
toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/install.rdf
toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/bootstrap.js
toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/frame-script.js
toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/install.rdf
toolkit/mozapps/extensions/test/browser/browser.ini
toolkit/mozapps/extensions/test/browser/browser_bug596336.js
toolkit/mozapps/extensions/test/browser/browser_reinstall.js
toolkit/mozapps/extensions/test/browser/browser_update.js
toolkit/mozapps/extensions/test/browser/moz.build
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
toolkit/mozapps/extensions/test/xpinstall/amosigned-restart-required.xpi
toolkit/mozapps/extensions/test/xpinstall/browser.ini
toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
toolkit/mozapps/extensions/test/xpinstall/restartless-unsigned.xpi
toolkit/mozapps/extensions/test/xpinstall/signed-no-cn.xpi
toolkit/mozapps/extensions/test/xpinstall/signed-no-o.xpi
toolkit/mozapps/extensions/test/xpinstall/signed.xpi
--- a/browser/base/content/test/webextensions/browser_extension_sideloading.js
+++ b/browser/base/content/test/webextensions/browser_extension_sideloading.js
@@ -20,42 +20,22 @@ async function createWebExtension(detail
     options.manifest.icons = {"64": details.iconURL};
   }
 
   let xpi = AddonTestUtils.createTempWebExtensionFile(options);
 
   await AddonTestUtils.manuallyInstall(xpi);
 }
 
-async function createXULExtension(details) {
-  let xpi = AddonTestUtils.createTempXPIFile({
-    "install.rdf": {
-      id: details.id,
-      name: details.name,
-      version: "0.1",
-      bootstrap: true,
-      targetApplications: [{
-        id: "toolkit@mozilla.org",
-        minVersion: "0",
-        maxVersion: "*",
-      }],
-    },
-  });
-
-  await AddonTestUtils.manuallyInstall(xpi);
-}
-
 function promiseEvent(eventEmitter, event) {
   return new Promise(resolve => {
     eventEmitter.once(event, resolve);
   });
 }
 
-let cleanup;
-
 add_task(async function() {
   const DEFAULT_ICON_URL = "chrome://mozapps/skin/extensions/extensionGeneric.svg";
 
   await SpecialPowers.pushPrefEnv({
     set: [
       ["xpinstall.signatures.required", false],
       ["extensions.autoDisableScopes", 15],
       ["extensions.ui.ignoreUnsigned", true],
@@ -67,35 +47,29 @@ add_task(async function() {
     id: ID1,
     name: "Test 1",
     userDisabled: true,
     permissions: ["history", "https://*/*"],
     iconURL: "foo-icon.png",
   });
 
   const ID2 = "addon2@tests.mozilla.org";
-  await createXULExtension({
+  await createWebExtension({
     id: ID2,
     name: "Test 2",
+    permissions: ["<all_urls>"],
   });
 
   const ID3 = "addon3@tests.mozilla.org";
   await createWebExtension({
     id: ID3,
     name: "Test 3",
     permissions: ["<all_urls>"],
   });
 
-  const ID4 = "addon4@tests.mozilla.org";
-  await createWebExtension({
-    id: ID4,
-    name: "Test 4",
-    permissions: ["<all_urls>"],
-  });
-
   testCleanup = async function() {
     // clear out ExtensionsUI state about sideloaded extensions so
     // subsequent tests don't get confused.
     ExtensionsUI.sideloaded.clear();
     ExtensionsUI.emit("change");
   };
 
   // Navigate away from the starting page to force about:addons to load
@@ -124,17 +98,17 @@ add_task(async function() {
   // Check for the addons badge on the hamburger menu
   let menuButton = document.getElementById("PanelUI-menu-button");
   is(menuButton.getAttribute("badge-status"), "addon-alert", "Should have addon alert badge");
 
   // Find the menu entries for sideloaded extensions
   await gCUITestUtils.openMainMenu();
 
   let addons = PanelUI.addonNotificationContainer;
-  is(addons.children.length, 4, "Have 4 menu entries for sideloaded extensions");
+  is(addons.children.length, 3, "Have 3 menu entries for sideloaded extensions");
 
   // Click the first sideloaded extension
   let popupPromise = promisePopupNotificationShown("addon-webext-permissions");
   addons.children[0].click();
 
   // The click should hide the main menu. This is currently synchronous.
   ok(PanelUI.panel.state != "open", "Main menu is closed or closing.");
 
@@ -151,73 +125,44 @@ add_task(async function() {
   // Check the contents of the notification, then choose "Cancel"
   checkNotification(panel, /\/foo-icon\.png$/, [
     ["webextPerms.hostDescription.allUrls"],
     ["webextPerms.description.history"],
   ]);
 
   panel.secondaryButton.click();
 
-  let [addon1, addon2, addon3, addon4] = await AddonManager.getAddonsByIDs([ID1, ID2, ID3, ID4]);
+  let [addon1, addon2, addon3] = await AddonManager.getAddonsByIDs([ID1, ID2, ID3]);
   ok(addon1.seen, "Addon should be marked as seen");
   is(addon1.userDisabled, true, "Addon 1 should still be disabled");
   is(addon2.userDisabled, true, "Addon 2 should still be disabled");
   is(addon3.userDisabled, true, "Addon 3 should still be disabled");
-  is(addon4.userDisabled, true, "Addon 4 should still be disabled");
 
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
-  // Should still have 3 entries in the hamburger menu
-  await gCUITestUtils.openMainMenu();
-
-  addons = PanelUI.addonNotificationContainer;
-  is(addons.children.length, 3, "Have 3 menu entries for sideloaded extensions");
-
-  // Click the second sideloaded extension and wait for the notification
-  popupPromise = promisePopupNotificationShown("addon-webext-permissions");
-  addons.children[0].click();
-  panel = await popupPromise;
-
-  // Again we should be at the extentions list in about:addons
-  is(gBrowser.currentURI.spec, "about:addons", "Foreground tab is at about:addons");
-
-  win = gBrowser.selectedBrowser.contentWindow;
-  ok(!win.gViewController.isLoading, "about:addons view is fully loaded");
-  is(win.gViewController.currentViewId, VIEW, "about:addons is at extensions list");
-
-  // Check the notification contents.
-  checkNotification(panel, DEFAULT_ICON_URL, []);
-
-  // This time accept the install.
-  panel.button.click();
-  await promiseEvent(ExtensionsUI, "sideload-response");
-
-  [addon1, addon2, addon3, addon4] = await AddonManager.getAddonsByIDs([ID1, ID2, ID3, ID4]);
-  is(addon1.userDisabled, true, "Addon 1 should still be disabled");
-  is(addon2.userDisabled, false, "Addon 2 should now be enabled");
-  is(addon3.userDisabled, true, "Addon 3 should still be disabled");
-  is(addon4.userDisabled, true, "Addon 4 should still be disabled");
-
   // Should still have 2 entries in the hamburger menu
   await gCUITestUtils.openMainMenu();
 
   addons = PanelUI.addonNotificationContainer;
   is(addons.children.length, 2, "Have 2 menu entries for sideloaded extensions");
 
   // Close the hamburger menu and go directly to the addons manager
   await gCUITestUtils.hideMainMenu();
 
   win = await BrowserOpenAddonsMgr(VIEW);
 
   let list = win.document.getElementById("addon-list");
+  if (win.gViewController.isLoading) {
+    await new Promise(resolve => win.document.addEventListener("ViewChanged", resolve, {once: true}));
+  }
 
   // Make sure XBL bindings are applied
   list.clientHeight;
 
-  let item = list.itemChildren.find(_item => _item.value == ID3);
+  let item = Array.from(list.children).find(_item => _item.value == ID2);
   ok(item, "Found entry for sideloaded extension in about:addons");
   item.scrollIntoView({behavior: "instant"});
 
   ok(BrowserTestUtils.is_visible(item._enableBtn), "Enable button is visible for sideloaded extension");
   ok(BrowserTestUtils.is_hidden(item._disableBtn), "Disable button is not visible for sideloaded extension");
 
   // When clicking enable we should see the permissions notification
   popupPromise = promisePopupNotificationShown("addon-webext-permissions");
@@ -225,61 +170,61 @@ add_task(async function() {
                                            gBrowser.selectedBrowser);
   panel = await popupPromise;
   checkNotification(panel, DEFAULT_ICON_URL, [["webextPerms.hostDescription.allUrls"]]);
 
   // Accept the permissions
   panel.button.click();
   await promiseEvent(ExtensionsUI, "change");
 
-  addon3 = await AddonManager.getAddonByID(ID3);
-  is(addon3.userDisabled, false, "Addon 3 should be enabled");
+  addon2 = await AddonManager.getAddonByID(ID2);
+  is(addon2.userDisabled, false, "Addon 2 should be enabled");
 
   // Should still have 1 entry in the hamburger menu
   await gCUITestUtils.openMainMenu();
 
   addons = PanelUI.addonNotificationContainer;
   is(addons.children.length, 1, "Have 1 menu entry for sideloaded extensions");
 
   // Close the hamburger menu and go to the detail page for this addon
   await gCUITestUtils.hideMainMenu();
 
-  win = await BrowserOpenAddonsMgr(`addons://detail/${encodeURIComponent(ID4)}`);
+  win = await BrowserOpenAddonsMgr(`addons://detail/${encodeURIComponent(ID3)}`);
   let button = win.document.getElementById("detail-enable-btn");
 
   // When clicking enable we should see the permissions notification
   popupPromise = promisePopupNotificationShown("addon-webext-permissions");
   BrowserTestUtils.synthesizeMouseAtCenter(button, {},
                                            gBrowser.selectedBrowser);
   panel = await popupPromise;
   checkNotification(panel, DEFAULT_ICON_URL, [["webextPerms.hostDescription.allUrls"]]);
 
   // Accept the permissions
   panel.button.click();
   await promiseEvent(ExtensionsUI, "change");
 
-  addon4 = await AddonManager.getAddonByID(ID4);
-  is(addon4.userDisabled, false, "Addon 4 should be enabled");
+  addon3 = await AddonManager.getAddonByID(ID3);
+  is(addon3.userDisabled, false, "Addon 3 should be enabled");
 
-  // We should have recorded 1 cancelled followed by 3 accepted sideloads.
-  expectTelemetry(["sideloadRejected", "sideloadAccepted", "sideloadAccepted", "sideloadAccepted"]);
+  // We should have recorded 1 cancelled followed by 2 accepted sideloads.
+  expectTelemetry(["sideloadRejected", "sideloadAccepted", "sideloadAccepted"]);
 
   isnot(menuButton.getAttribute("badge-status"), "addon-alert", "Should no longer have addon alert badge");
 
   await new Promise(resolve => setTimeout(resolve, 100));
 
-  for (let addon of [addon1, addon2, addon3, addon4]) {
+  for (let addon of [addon1, addon2, addon3]) {
     await addon.uninstall();
   }
 
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   // Assert that the expected AddonManager telemetry are being recorded.
   const expectedExtra = {source: "app-profile", method: "sideload"};
-  const noPermissionsExtra = {...expectedExtra, num_perms: "0", num_origins: "0"};
+
   const baseEvent = {object: "extension", extra: expectedExtra};
   const createBaseEventAddon = (n) => ({...baseEvent, value: `addon${n}@tests.mozilla.org`});
   const getEventsForAddonId = (events, addonId) => events.filter(ev => ev.value === addonId);
 
   const amEvents = AddonTestUtils.getAMTelemetryEvents();
 
   // Test telemetry events for addon1 (1 permission and 1 origin).
   info("Test telemetry events collected for addon1");
@@ -298,51 +243,28 @@ add_task(async function() {
   for (let event of collectedEventsAddon1) {
     Assert.deepEqual(event, expectedEventsAddon1[i++],
                      "Got the expected telemetry event");
   }
 
   is(collectedEventsAddon1.length, expectedEventsAddon1.length,
      "Got the expected number of telemetry events for addon1");
 
-  // Test telemetry events for addon2 (no permissions).
-  info("Test telemetry events collected for addon2");
-
   const baseEventAddon2 = createBaseEventAddon(2);
   const collectedEventsAddon2 = getEventsForAddonId(amEvents, baseEventAddon2.value);
   const expectedEventsAddon2 = [
-    {...baseEventAddon2, method: "sideload_prompt", extra: {...noPermissionsExtra}},
+    {
+      ...baseEventAddon2, method: "sideload_prompt",
+      extra: {...expectedExtra, num_perms: "0", num_origins: "1"},
+    },
     {...baseEventAddon2, method: "enable"},
     {...baseEventAddon2, method: "uninstall"},
   ];
 
   i = 0;
   for (let event of collectedEventsAddon2) {
     Assert.deepEqual(event, expectedEventsAddon2[i++],
                      "Got the expected telemetry event");
   }
 
   is(collectedEventsAddon2.length, expectedEventsAddon2.length,
      "Got the expected number of telemetry events for addon2");
-
-  // Test telemetry events for addon3 (no permissions and 1 origin).
-  info("Test telemetry events collected for addon2");
-
-  const baseEventAddon3 = createBaseEventAddon(3);
-  const collectedEventsAddon3 = getEventsForAddonId(amEvents, baseEventAddon3.value);
-  const expectedEventsAddon3 = [
-    {
-      ...baseEventAddon3, method: "sideload_prompt",
-      extra: {...expectedExtra, num_perms: "0", num_origins: "1"},
-    },
-    {...baseEventAddon3, method: "enable"},
-    {...baseEventAddon3, method: "uninstall"},
-  ];
-
-  i = 0;
-  for (let event of collectedEventsAddon3) {
-    Assert.deepEqual(event, expectedEventsAddon3[i++],
-                     "Got the expected telemetry event");
-  }
-
-  is(collectedEventsAddon3.length, expectedEventsAddon3.length,
-     "Got the expected number of telemetry events for addon3");
 });
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/test/browser/addons/.hgignore
@@ -0,0 +1,3 @@
+./browser_bug596336_1.xpi
+./browser_bug596336_2.xpi
+
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/manifest.mf
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-
-Name: install.rdf
-Digest-Algorithms: MD5 SHA1
-MD5-Digest: 59ZQahS8eYm678dptqF2fQ==
-SHA1-Digest: fCpbSYnLdjYZpC1t1zwsEztrYA8=
-
deleted file mode 100644
index 93c6e606e81096d8710db86f2c4d348d6deec513..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/META-INF/mozilla.sf
+++ /dev/null
@@ -1,4 +0,0 @@
-Signature-Version: 1.0
-MD5-Digest-Manifest: Cp9ofwdMdvAralffnWqQww==
-SHA1-Digest-Manifest: TpmukUYFQ+eJgQzFeAUYw+PzUdY=
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_1/install.rdf
+++ /dev/null
@@ -1,31 +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>bug596336-1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>0.3</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>Bootstrap upgrade test</em:name>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/manifest.mf
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-
-Name: install.rdf
-Digest-Algorithms: MD5 SHA1
-MD5-Digest: 1gYPkSqlgVzw1RWJIVLXrQ==
-SHA1-Digest: 046B+AIjFVBHO7G2BQfj2zoPvRw=
-
deleted file mode 100644
index ef0b63a8006dfba86151409401224f290498dee0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/META-INF/mozilla.sf
+++ /dev/null
@@ -1,4 +0,0 @@
-Signature-Version: 1.0
-MD5-Digest-Manifest: whMuT0nKTV49pQyLDTgTfA==
-SHA1-Digest-Manifest: WzDdDwYCt5znpmOn2Sz8eCWWcvA=
-
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_bug596336_2/install.rdf
+++ /dev/null
@@ -1,31 +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>bug596336-1@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>0.3</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>Bootstrap upgrade test</em:name>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/bootstrap.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-/* exported startup, shutdown, install, uninstall */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-const resProto = Cc["@mozilla.org/network/protocol;1?name=resource"]
-  .getService(Ci.nsISubstitutingProtocolHandler);
-
-function install(data, reason) {}
-function startup(data, reason) {
-  resProto.setSubstitution("my-addon", data.resourceURI);
-  Services.ppmm.loadProcessScript(
-    "resource://my-addon/frame-script.js", false);
-}
-function shutdown(data, reason) {
-  resProto.setSubstitution("my-addon", null);
-}
-function uninstall(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/frame-script.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-Services.cpmm.sendAsyncMessage("my-addon-1");
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_1/install.rdf
+++ /dev/null
@@ -1,31 +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>update1@tests.mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>0.3</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>Update Tests</em:name>
-
-  </Description>
-</RDF>
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/bootstrap.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-/* exported startup, shutdown, install, uninstall */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-const resProto = Cc["@mozilla.org/network/protocol;1?name=resource"]
-  .getService(Ci.nsISubstitutingProtocolHandler);
-
-function install(data, reason) {}
-function startup(data, reason) {
-  resProto.setSubstitution("my-addon", data.resourceURI);
-  Services.ppmm.loadProcessScript(
-    "resource://my-addon/frame-script.js", false);
-}
-function shutdown(data, reason) {
-  resProto.setSubstitution("my-addon", null);
-}
-function uninstall(data, reason) {}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/frame-script.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-Services.cpmm.sendAsyncMessage("my-addon-2");
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/addons/browser_update1_2/install.rdf
+++ /dev/null
@@ -1,31 +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>update1@tests.mozilla.org</em:id>
-    <em:version>2.0</em:version>
-    <em:bootstrap>true</em:bootstrap>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>0.3</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-        <em:minVersion>0</em:minVersion>
-        <em:maxVersion>*</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>Update Tests</em:name>
-
-  </Description>
-</RDF>
--- a/toolkit/mozapps/extensions/test/browser/browser.ini
+++ b/toolkit/mozapps/extensions/test/browser/browser.ini
@@ -1,20 +1,16 @@
 [DEFAULT]
 tags = addons
 support-files =
-  addons/browser_bug596336_1.xpi
-  addons/browser_bug596336_2.xpi
   addons/browser_dragdrop1.xpi
   addons/browser_dragdrop2.xpi
   addons/browser_dragdrop_incompat.xpi
   addons/browser_installssl.xpi
   addons/browser_theme.xpi
-  addons/browser_update1_1.xpi
-  addons/browser_update1_2.xpi
   addons/options_signed.xpi
   addons/options_signed/*
   addon_prefs.xul
   discovery.html
   head.js
   more_options.xul
   options.xul
   plugin_test.html
@@ -27,31 +23,25 @@ support-files =
   webapi_addon_listener.html
   webapi_checkavailable.html
   webapi_checkchromeframe.xul
   webapi_checkframed.html
   webapi_checknavigatedwindow.html
   !/toolkit/mozapps/extensions/test/xpinstall/corrupt.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/incompatible.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/installtrigger.html
-  !/toolkit/mozapps/extensions/test/xpinstall/restartless.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/unsigned.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/amosigned.xpi
-  !/toolkit/mozapps/extensions/test/xpinstall/amosigned-restart-required.xpi
 
 generated-files =
-  addons/browser_bug596336_1.xpi
-  addons/browser_bug596336_2.xpi
   addons/browser_dragdrop1.xpi
   addons/browser_dragdrop2.xpi
   addons/browser_dragdrop_incompat.xpi
   addons/browser_installssl.xpi
   addons/browser_theme.xpi
-  addons/browser_update1_1.xpi
-  addons/browser_update1_2.xpi
   addons/options_signed.xpi
 
 [browser_CTP_plugins.js]
 tags = blocklist
 [browser_bug523784.js]
 [browser_bug562797.js]
 [browser_bug562890.js]
 skip-if = os == 'win' && !debug # Disabled on Windows opt/PGO builds due to intermittent failures (bug 1135866)
@@ -64,17 +54,16 @@ skip-if = verify
 [browser_bug572561.js]
 [browser_bug577990.js]
 [browser_bug580298.js]
 [browser_bug586574.js]
 [browser_bug587970.js]
 [browser_bug591465.js]
 skip-if = os == "linux" && !debug # Bug 1395539 - fails on multi-core
 [browser_bug591663.js]
-[browser_bug596336.js]
 [browser_bug618502.js]
 [browser_bug679604.js]
 [browser_bug590347.js]
 [browser_checkAddonCompatibility.js]
 [browser_details.js]
 [browser_discovery.js]
 [browser_dragdrop.js]
 [browser_dragdrop_incompat.js]
@@ -92,24 +81,23 @@ skip-if = verify
 [browser_legacy.js]
 [browser_legacy_pre57.js]
 [browser_list.js]
 [browser_manualupdates.js]
 [browser_pluginprefs.js]
 [browser_pluginprefs_is_not_disabled.js]
 [browser_plugin_enabled_state_locked.js]
 [browser_recentupdates.js]
+[browser_reinstall.js]
 [browser_sorting.js]
 [browser_sorting_plugins.js]
 [browser_tabsettings.js]
 [browser_task_next_test.js]
 [browser_types.js]
 [browser_uninstalling.js]
-[browser_update.js]
-skip-if = (verify && (os == 'win'))
 [browser_updateid.js]
 [browser_updatessl.js]
 [browser_webapi.js]
 [browser_webapi_access.js]
 [browser_webapi_addon_listener.js]
 [browser_webapi_enable.js]
 [browser_webapi_install.js]
 [browser_webapi_theme.js]
rename from toolkit/mozapps/extensions/test/browser/browser_bug596336.js
rename to toolkit/mozapps/extensions/test/browser/browser_reinstall.js
--- a/toolkit/mozapps/extensions/test/browser/browser_bug596336.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_reinstall.js
@@ -1,152 +1,161 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that upgrading bootstrapped add-ons behaves correctly while the
 // manager is open
 
-var gManagerWindow;
+const {AddonTestUtils} = ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", {});
 
-add_task(async function test() {
-  waitForExplicitFinish();
+const ID = "reinstall@tests.mozilla.org";
 
-  gManagerWindow = await open_manager("addons://list/extension");
-});
+let gManagerWindow, xpi1, xpi2;
 
 function get_list_item_count() {
   return get_test_items_in_list(gManagerWindow).length;
 }
 
 function get_node(parent, anonid) {
   return parent.ownerDocument.getAnonymousElementByAttribute(parent, "anonid", anonid);
 }
 
 function get_class_node(parent, cls) {
   return parent.ownerDocument.getAnonymousElementByAttribute(parent, "class", cls);
 }
 
-function install_addon(aXpi) {
-  return new Promise(async resolve => {
-    let aInstall = await AddonManager.getInstallForURL(TESTROOT + "addons/" + aXpi + ".xpi", "application/x-xpinstall");
-    aInstall.addListener({
-      onInstallEnded(aInstall) {
-        resolve();
-      },
-    });
-    aInstall.install();
-  });
+async function install_addon(xpi) {
+  let install = await AddonManager.getInstallForFile(xpi, "application/x-xpinstall");
+  return install.install();
 }
 
 var check_addon = async function(aAddon, aVersion) {
   is(get_list_item_count(), 1, "Should be one item in the list");
   is(aAddon.version, aVersion, "Add-on should have the right version");
 
-  let item = get_addon_element(gManagerWindow, "bug596336-1@tests.mozilla.org");
+  let item = get_addon_element(gManagerWindow, ID);
   ok(!!item, "Should see the add-on in the list");
 
   // Force XBL to apply
   item.clientTop;
 
   let { version } = await get_tooltip_info(item);
   is(version, aVersion, "Version should be correct");
 
   if (aAddon.userDisabled)
     is_element_visible(get_class_node(item, "disabled-postfix"), "Disabled postfix should be hidden");
   else
     is_element_hidden(get_class_node(item, "disabled-postfix"), "Disabled postfix should be hidden");
 };
 
+add_task(async function setup() {
+  gManagerWindow = await open_manager("addons://list/extension");
+
+  xpi1 = await AddonTestUtils.createTempWebExtensionFile({
+    manifest: {
+      version: "1.0",
+      applications: {gecko: {id: ID}},
+    },
+  });
+
+  xpi2 = await AddonTestUtils.createTempWebExtensionFile({
+    manifest: {
+      version: "2.0",
+      applications: {gecko: {id: ID}},
+    },
+  });
+});
+
 // Install version 1 then upgrade to version 2 with the manager open
 add_task(async function() {
-  await install_addon("browser_bug596336_1");
-  let [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "1.0");
-  ok(!aAddon.userDisabled, "Add-on should not be disabled");
+  await install_addon(xpi1);
+  let addon = await promiseAddonByID(ID);
+  await check_addon(addon, "1.0");
+  ok(!addon.userDisabled, "Add-on should not be disabled");
 
-  await install_addon("browser_bug596336_2");
-  [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "2.0");
-  ok(!aAddon.userDisabled, "Add-on should not be disabled");
+  await install_addon(xpi2);
+  addon = await promiseAddonByID(ID);
+  await check_addon(addon, "2.0");
+  ok(!addon.userDisabled, "Add-on should not be disabled");
 
-  await aAddon.uninstall();
+  await addon.uninstall();
 
   is(get_list_item_count(), 0, "Should be no items in the list");
 });
 
 // Install version 1 mark it as disabled then upgrade to version 2 with the
 // manager open
 add_task(async function() {
-  await install_addon("browser_bug596336_1");
-  let [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await aAddon.disable();
-  await check_addon(aAddon, "1.0");
-  ok(aAddon.userDisabled, "Add-on should be disabled");
+  await install_addon(xpi1);
+  let addon = await promiseAddonByID(ID);
+  await addon.disable();
+  await check_addon(addon, "1.0");
+  ok(addon.userDisabled, "Add-on should be disabled");
 
-  await install_addon("browser_bug596336_2");
-  [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "2.0");
-  ok(aAddon.userDisabled, "Add-on should be disabled");
+  await install_addon(xpi2);
+  addon = await promiseAddonByID(ID);
+  await check_addon(addon, "2.0");
+  ok(addon.userDisabled, "Add-on should be disabled");
 
-  await aAddon.uninstall();
+  await addon.uninstall();
 
   is(get_list_item_count(), 0, "Should be no items in the list");
 });
 
 // Install version 1 click the remove button and then upgrade to version 2 with
 // the manager open
 add_task(async function() {
-  await install_addon("browser_bug596336_1");
-  let [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "1.0");
-  ok(!aAddon.userDisabled, "Add-on should not be disabled");
+  await install_addon(xpi1);
+  let addon = await promiseAddonByID(ID);
+  await check_addon(addon, "1.0");
+  ok(!addon.userDisabled, "Add-on should not be disabled");
 
-  let item = get_addon_element(gManagerWindow, "bug596336-1@tests.mozilla.org");
+  let item = get_addon_element(gManagerWindow, ID);
   EventUtils.synthesizeMouseAtCenter(get_node(item, "remove-btn"), { }, gManagerWindow);
 
   // Force XBL to apply
   item.clientTop;
 
-  ok(!!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
+  ok(!!(addon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
   is_element_visible(get_class_node(item, "pending"), "Pending message should be visible");
 
-  await install_addon("browser_bug596336_2");
-  [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "2.0");
-  ok(!aAddon.userDisabled, "Add-on should not be disabled");
+  await install_addon(xpi2);
+  addon = await promiseAddonByID(ID);
+  await check_addon(addon, "2.0");
+  ok(!addon.userDisabled, "Add-on should not be disabled");
 
-  await aAddon.uninstall();
+  await addon.uninstall();
 
   is(get_list_item_count(), 0, "Should be no items in the list");
 });
 
 // Install version 1, disable it, click the remove button and then upgrade to
 // version 2 with the manager open
 add_task(async function() {
-  await install_addon("browser_bug596336_1");
-  let [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await aAddon.disable();
-  await check_addon(aAddon, "1.0");
-  ok(aAddon.userDisabled, "Add-on should be disabled");
+  await install_addon(xpi1);
+  let addon = await promiseAddonByID(ID);
+  await addon.disable();
+  await check_addon(addon, "1.0");
+  ok(addon.userDisabled, "Add-on should be disabled");
 
-  let item = get_addon_element(gManagerWindow, "bug596336-1@tests.mozilla.org");
+  let item = get_addon_element(gManagerWindow, ID);
   EventUtils.synthesizeMouseAtCenter(get_node(item, "remove-btn"), { }, gManagerWindow);
 
   // Force XBL to apply
   item.clientTop;
 
-  ok(!!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
+  ok(!!(addon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
   is_element_visible(get_class_node(item, "pending"), "Pending message should be visible");
 
-  await install_addon("browser_bug596336_2");
-  [aAddon] = await promiseAddonsByIDs(["bug596336-1@tests.mozilla.org"]);
-  await check_addon(aAddon, "2.0");
-  ok(aAddon.userDisabled, "Add-on should be disabled");
+  await install_addon(xpi2);
+  addon = await promiseAddonByID(ID);
+  await check_addon(addon, "2.0");
+  ok(addon.userDisabled, "Add-on should be disabled");
 
-  await aAddon.uninstall();
+  await addon.uninstall();
 
   is(get_list_item_count(), 0, "Should be no items in the list");
 });
 
 add_task(function end_test() {
-  close_manager(gManagerWindow, finish);
+  return close_manager(gManagerWindow);
 });
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/browser_update.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// Tests that updates correctly flush caches and that new files gets updated.
-
-function test() {
-  requestLongerTimeout(2);
-  waitForExplicitFinish();
-
-  SpecialPowers.pushPrefEnv({"set": [
-    ["extensions.checkUpdateSecurity", false],
-    ["xpinstall.signatures.required", false],
-  ]});
-
-  run_next_test();
-}
-
-// Install a first version
-add_test(async function() {
-  let aInstall = await AddonManager.getInstallForURL(TESTROOT + "addons/browser_update1_1.xpi", "application/x-xpinstall");
-  aInstall.install();
-
-  Services.ppmm.addMessageListener("my-addon-1", function messageListener() {
-    Services.ppmm.removeMessageListener("my-addon-1", messageListener);
-    ok(true, "first version sent frame script message");
-    run_next_test();
-  });
-});
-
-// Update to a second version and verify that content gets updated
-add_test(async function() {
-  let aInstall = await AddonManager.getInstallForURL(TESTROOT + "addons/browser_update1_2.xpi", "application/x-xpinstall");
-  aInstall.install();
-
-  Services.ppmm.addMessageListener("my-addon-2", function messageListener() {
-    Services.ppmm.removeMessageListener("my-addon-2", messageListener);
-    ok(true, "second version sent frame script message");
-    run_next_test();
-  });
-});
-
-// Finally, cleanup things
-add_test(async function() {
-  let aAddon = await AddonManager.getAddonByID("update1@tests.mozilla.org");
-  aAddon.uninstall();
-
-  finish();
-});
--- a/toolkit/mozapps/extensions/test/browser/moz.build
+++ b/toolkit/mozapps/extensions/test/browser/moz.build
@@ -4,25 +4,21 @@
 # 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/.
 
 BROWSER_CHROME_MANIFESTS += [
     'browser.ini',
 ]
 
 addons = [
-    'browser_bug596336_1',
-    'browser_bug596336_2',
     'browser_dragdrop1',
     'browser_dragdrop2',
     'browser_dragdrop_incompat',
     'browser_installssl',
     'browser_theme',
-    'browser_update1_1',
-    'browser_update1_2',
     'options_signed',
 ]
 
 output_dir = OBJDIR_FILES._tests.testing.mochitest.browser.toolkit.mozapps.extensions.test.browser.addons
 
 for addon in addons:
     indir = 'addons/%s' % addon
     xpi = '%s.xpi' % indir
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
@@ -17,74 +17,63 @@ const GETADDONS_RESULTS            = BAS
 const COMPAT_RESULTS               = BASE_URL + "/data/test_AddonRepository_cache_compat.json";
 const EMPTY_RESULT                 = BASE_URL + "/data/test_AddonRepository_empty.json";
 const FAILED_RESULT                = BASE_URL + "/data/test_AddonRepository_fail.json";
 
 const FILE_DATABASE = "addons.json";
 
 const ADDONS = [
   {
-    "install.rdf": {
-      id: "test_AddonRepository_1@tests.mozilla.org",
+    manifest: {
+      name: "XPI Add-on 1",
       version: "1.1",
-      bootstrap: true,
 
-      name: "XPI Add-on 1",
       description: "XPI Add-on 1 - Description",
-      creator: "XPI Add-on 1 - Creator",
-      developer: ["XPI Add-on 1 - First Developer",
-                  "XPI Add-on 1 - Second Developer"],
-      translator: ["XPI Add-on 1 - First Translator",
-                   "XPI Add-on 1 - Second Translator"],
-      contributor: ["XPI Add-on 1 - First Contributor",
-                    "XPI Add-on 1 - Second Contributor"],
-      homepageURL: "http://example.com/xpi/1/homepage.html",
-      optionsURL: "http://example.com/xpi/1/options.html",
-      aboutURL: "http://example.com/xpi/1/about.html",
-      iconURL: "http://example.com/xpi/1/icon.png",
+      developer: {
+        name: "XPI Add-on 1 - Author",
+      },
 
-      targetApplications: [{
-        id: "xpcshell@tests.mozilla.org",
-        minVersion: "1",
-        maxVersion: "1"}],
+      homepage_url: "http://example.com/xpi/1/homepage.html",
+      icons: {
+        32: "icon.png",
+      },
+
+      options_ui: {
+        page: "options.html",
+      },
+
+      applications: {gecko: {id: "test_AddonRepository_1@tests.mozilla.org" }},
     },
   },
   {
-    "manifest.json": {
-      manifest_version: 2,
+    manifest: {
       name: "XPI Add-on 2",
       version: "1.2",
-      applications: {
-        gecko: {
-          id: "test_AddonRepository_2@tests.mozilla.org",
-        },
-      },
-      theme: {},
+      theme: { },
+      applications: {gecko: {id: "test_AddonRepository_2@tests.mozilla.org"}},
     },
   },
   {
-    "manifest.json": {
-      manifest_version: 2,
+    manifest: {
       name: "XPI Add-on 3",
       version: "1.3",
-      applications: {
-        gecko: {
-          id: "test_AddonRepository_3@tests.mozilla.org",
-        },
+      icons: {
+        32: "icon.png",
       },
-      theme: {},
-      icons: {32: "icon.png"},
+      theme: { },
+      applications: {gecko: {id: "test_AddonRepository_3@tests.mozilla.org"}},
     },
-    "icon.png": "",
-    "preview.png": "",
+    files: {
+      "preview.png": "",
+    },
   },
 ];
 
-const ADDON_IDS = ADDONS.map(addon => addon["install.rdf"] ? addon["install.rdf"].id : addon["manifest.json"].applications.gecko.id);
-const ADDON_FILES = ADDONS.map(addon => AddonTestUtils.createTempXPIFile(addon));
+const ADDON_IDS = ADDONS.map(addon => addon.manifest.applications.gecko.id);
+const ADDON_FILES = ADDONS.map(addon => AddonTestUtils.createTempWebExtensionFile(addon));
 
 const PREF_ADDON0_CACHE_ENABLED = "extensions." + ADDON_IDS[0] + ".getAddons.cache.enabled";
 const PREF_ADDON1_CACHE_ENABLED = "extensions." + ADDON_IDS[1] + ".getAddons.cache.enabled";
 
 // Properties of an individual add-on that should be checked
 // Note: updateDate is checked separately
 const ADDON_PROPERTIES = ["id", "type", "name", "version", "creator",
                           "developers", "translators", "contributors",
deleted file mode 100644
index 4edf91e34a903af625951e97bffc5db5c0793cbe..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/toolkit/mozapps/extensions/test/xpinstall/browser.ini
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser.ini
@@ -1,33 +1,27 @@
 [DEFAULT]
 support-files =
   amosigned.xpi
-  amosigned-restart-required.xpi
   authRedirect.sjs
   bug540558.html
   bug638292.html
   bug645699.html
   cookieRedirect.sjs
   corrupt.xpi
   empty.xpi
   enabled.html
   hashRedirect.sjs
   head.js
   incompatible.xpi
   installchrome.html
   installtrigger.html
   installtrigger_frame.html
   navigate.html
   redirect.sjs
-  restartless.xpi
-  restartless-unsigned.xpi
-  signed-no-cn.xpi
-  signed-no-o.xpi
-  signed.xpi
   slowinstall.sjs
   startsoftwareupdate.html
   triggerredirect.html
   unsigned.xpi
 
 [browser_amosigned_trigger.js]
 [browser_amosigned_trigger_iframe.js]
 [browser_amosigned_url.js]
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
@@ -1,17 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const SECUREROOT = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const PROGRESS_NOTIFICATION = "addon-progress";
 
-ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-
 const CHROMEROOT = extractChromeRoot(gTestPath);
 
 var gApp = document.getElementById("bundle_brand").getString("brandShortName");
 
 function waitForTick() {
   return new Promise(resolve => executeSoon(resolve));
 }
 
@@ -186,20 +184,16 @@ function removeTabAndWaitForNotification
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
   return closePromise;
 }
 
 function acceptInstallDialog(installDialog) {
   installDialog.button.click();
 }
 
-function cancelInstallDialog(installDialog) {
-  installDialog.secondaryButton.click();
-}
-
 async function waitForSingleNotification(aCallback) {
   while (PopupNotifications.panel.childNodes.length != 1) {
     await new Promise(resolve => executeSoon(resolve));
 
     info("Waiting for single notification");
     // Notification should never close while we wait
     ok(PopupNotifications.isPanelOpen, "Notification should still be open");
   }
@@ -385,158 +379,16 @@ async function test_incompatible() {
      "The add-on downloaded from this site could not be installed " +
      "because it appears to be corrupt.",
      "Should have seen the right message");
 
   Services.perms.remove(makeURI("http://example.com/"), "install");
   await removeTabAndWaitForNotificationClose();
 },
 
-async function test_restartless() {
-  let pm = Services.perms;
-  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-  let progressPromise = waitForProgressNotification();
-  let dialogPromise = waitForInstallDialog("addon-install-confirmation");
-  let triggers = encodeURIComponent(JSON.stringify({
-    "XPI": "restartless.xpi",
-  }));
-  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
-  BrowserTestUtils.loadURI(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-  await progressPromise;
-  let installDialog = await dialogPromise;
-
-  let notificationPromise = acceptAppMenuNotificationWhenShown("addon-installed");
-  acceptInstallDialog(installDialog);
-  await notificationPromise;
-
-  let installs = await AddonManager.getAllInstalls();
-  is(installs.length, 0, "Should be no pending installs");
-
-  let addon = await AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org");
-  addon.uninstall();
-
-  Services.perms.remove(makeURI("http://example.com/"), "install");
-  await removeTabAndWaitForNotificationClose(gBrowser.selectedTab);
-},
-
-async function test_sequential() {
-  // This test is only relevant if using the new doorhanger UI
-  // TODO: this subtest is disabled until multiple notification prompts are
-  // reworked in bug 1188152
-  if (true) {
-    return;
-  }
-  let pm = Services.perms;
-  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-  let progressPromise = waitForProgressNotification();
-  let dialogPromise = waitForInstallDialog();
-  let triggers = encodeURIComponent(JSON.stringify({
-    "Restartless XPI": "restartless.xpi",
-  }));
-  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-  await progressPromise;
-  let installDialog = await dialogPromise;
-
-  // Should see the right add-on
-  let container = document.getElementById("addon-install-confirmation-content");
-  is(container.childNodes.length, 1, "Should be one item listed");
-  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-
-  progressPromise = waitForProgressNotification(true, 2);
-  triggers = encodeURIComponent(JSON.stringify({
-    "Theme XPI": "theme.xpi",
-  }));
-  BrowserTestUtils.loadURI(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-  await progressPromise;
-
-  // Should still have the right add-on in the confirmation notification
-  is(container.childNodes.length, 1, "Should be one item listed");
-  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-
-  // Wait for the install to complete, we won't see a new confirmation
-  // notification
-  await new Promise(resolve => {
-    Services.obs.addObserver(function observer() {
-      Services.obs.removeObserver(observer, "addon-install-confirmation");
-      resolve();
-    }, "addon-install-confirmation");
-  });
-
-  // Make sure browser-addons.js executes first
-  await new Promise(resolve => executeSoon(resolve));
-
-  // Should have dropped the progress notification
-  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-     "Should only be showing one install confirmation");
-
-  // Should still have the right add-on in the confirmation notification
-  is(container.childNodes.length, 1, "Should be one item listed");
-  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-
-  cancelInstallDialog(installDialog);
-
-  ok(PopupNotifications.isPanelOpen, "Panel should still be open");
-  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-     "Should still have an install confirmation open");
-
-  // Should have the next add-on's confirmation dialog
-  is(container.childNodes.length, 1, "Should be one item listed");
-  is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
-
-  Services.perms.remove(makeURI("http://example.com"), "install");
-  let closePromise = waitForNotificationClose();
-  cancelInstallDialog(installDialog);
-  await closePromise;
-
-  BrowserTestUtils.removeTab(gBrowser.selectedTab);
-},
-
-async function test_allUnverified() {
-  // This test is only relevant if using the new doorhanger UI and allowing
-  // unsigned add-ons
-  if (Services.prefs.getBoolPref("xpinstall.signatures.required", true) ||
-      AppConstants.MOZ_REQUIRE_SIGNING) {
-        return;
-  }
-  let pm = Services.perms;
-  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-  let progressPromise = waitForProgressNotification();
-  let dialogPromise = waitForInstallDialog("addon-install-confirmation");
-  let triggers = encodeURIComponent(JSON.stringify({
-    "Extension XPI": "restartless-unsigned.xpi",
-  }));
-  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-  await progressPromise;
-  let installDialog = await dialogPromise;
-
-  let notification = document.getElementById("addon-install-confirmation-notification");
-  let message = notification.getAttribute("label");
-  is(message, "Caution: This site would like to install an unverified add-on in " + gApp + ". Proceed at your own risk.");
-
-  let container = document.getElementById("addon-install-confirmation-content");
-  is(container.children.length, 1, "Should be one item listed");
-  is(container.children[0].firstElementChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-  is(container.children[0].children.length, 1, "Shouldn't have the unverified marker");
-
-  let notificationPromise = acceptAppMenuNotificationWhenShown("addon-installed");
-  acceptInstallDialog(installDialog);
-  await notificationPromise;
-
-  let addon = await AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org");
-  addon.uninstall();
-
-  Services.perms.remove(makeURI("http://example.com/"), "install");
-  await removeTabAndWaitForNotificationClose();
-},
-
 async function test_localFile() {
   let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]
              .getService(Ci.nsIChromeRegistry);
   let path;
   try {
     path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
   } catch (ex) {
     path = CHROMEROOT + "corrupt.xpi";
@@ -560,70 +412,16 @@ async function test_localFile() {
   is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
   is(notification.getAttribute("label"),
      "This add-on could not be installed because it appears to be corrupt.",
      "Should have seen the right message");
 
   await removeTabAndWaitForNotificationClose();
 },
 
-async function test_tabClose() {
-  let progressPromise = waitForProgressNotification();
-  let dialogPromise = waitForInstallDialog("addon-install-confirmation");
-  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-  BrowserTestUtils.loadURI(gBrowser, TESTROOT + "restartless.xpi");
-  await progressPromise;
-  await dialogPromise;
-
-  let installs = await AddonManager.getAllInstalls();
-  is(installs.length, 1, "Should be one pending install");
-
-  await removeTabAndWaitForNotificationClose(gBrowser.selectedTab);
-
-  installs = await AddonManager.getAllInstalls();
-  is(installs.length, 0, "Should be no pending install since the tab is closed");
-},
-
-// Add-ons should be cancelled and the install notification destroyed when
-// navigating to a new origin
-async function test_tabNavigate() {
-  let pm = Services.perms;
-  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-  let progressPromise = waitForProgressNotification();
-  let dialogPromise = waitForInstallDialog("addon-install-confirmation");
-  let triggers = encodeURIComponent(JSON.stringify({
-    "Extension XPI": "restartless.xpi",
-  }));
-  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-  await progressPromise;
-  await dialogPromise;
-
-  let closePromise = waitForNotificationClose();
-  let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-  BrowserTestUtils.loadURI(gBrowser, "about:blank");
-  await closePromise;
-
-  // At the point of closing notification, AddonManager hasn't yet removed
-  // pending installs.  It removes them in onLocationChange listener, and
-  // the notification is also closed in another onLocationChange listener,
-  // before AddonManager's one.  Wait for next tick to ensure all
-  // onLocationChange listeners are performed.
-  await waitForTick();
-
-  let installs = await AddonManager.getAllInstalls();
-  is(installs.length, 0, "Should be no pending install");
-
-  Services.perms.remove(makeURI("http://example.com/"), "install");
-  await loadPromise;
-
-  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-},
-
 async function test_urlBar() {
   let progressPromise = waitForProgressNotification();
   let dialogPromise = waitForInstallDialog();
 
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
   await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
   gURLBar.value = TESTROOT + "amosigned.xpi";
   gURLBar.focus();
deleted file mode 100644
index 8e76bd052ce1471d7cb6dd4fde35fce855187b86..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 90d3a3ce66692496ee625b2ae1725785193079a5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 19b754038008ed3043a7178aa8c42da83747bf8e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index bd7f78b7c7712c0aca18776e08541e87898da119..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001