summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-2018.07.18.tar
UXP-2018.07.18.tar.gz
UXP-2018.07.18.tar.lz
UXP-2018.07.18.tar.xz
UXP-2018.07.18.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js')
-rw-r--r--toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js80
1 files changed, 0 insertions, 80 deletions
diff --git a/toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js b/toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js
deleted file mode 100644
index 18bb7d74e..000000000
--- a/toolkit/mozapps/webextensions/test/xpcshell/test_install_from_sources.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const ID = "bootstrap1@tests.mozilla.org";
-createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
-startupManager();
-
-BootstrapMonitor.init();
-
-// Partial list of bootstrap reasons from XPIProvider.jsm
-const BOOTSTRAP_REASONS = {
- ADDON_INSTALL: 5,
- ADDON_UPGRADE: 7,
- ADDON_DOWNGRADE: 8,
-};
-
-// Install an unsigned add-on with no existing add-on present.
-// Restart and make sure it is still around.
-add_task(function*() {
- let extInstallCalled = false;
- AddonManager.addInstallListener({
- onExternalInstall: (aInstall) => {
- do_check_eq(aInstall.id, ID);
- do_check_eq(aInstall.version, "1.0");
- extInstallCalled = true;
- },
- });
-
- let installingCalled = false;
- let installedCalled = false;
- AddonManager.addAddonListener({
- onInstalling: (aInstall) => {
- do_check_eq(aInstall.id, ID);
- do_check_eq(aInstall.version, "1.0");
- installingCalled = true;
- },
- onInstalled: (aInstall) => {
- do_check_eq(aInstall.id, ID);
- do_check_eq(aInstall.version, "1.0");
- installedCalled = true;
- },
- onInstallStarted: (aInstall) => {
- do_throw("onInstallStarted called unexpectedly");
- }
- });
-
- yield AddonManager.installAddonFromSources(do_get_file("data/from_sources/"));
-
- do_check_true(extInstallCalled);
- do_check_true(installingCalled);
- do_check_true(installedCalled);
-
- let install = BootstrapMonitor.checkAddonInstalled(ID, "1.0");
- equal(install.reason, BOOTSTRAP_REASONS.ADDON_INSTALL);
- BootstrapMonitor.checkAddonStarted(ID, "1.0");
-
- let addon = yield promiseAddonByID(ID);
-
- do_check_neq(addon, null);
- do_check_eq(addon.version, "1.0");
- do_check_eq(addon.name, "Test Bootstrap 1");
- do_check_true(addon.isCompatible);
- do_check_false(addon.appDisabled);
- do_check_true(addon.isActive);
- do_check_eq(addon.type, "extension");
- do_check_eq(addon.signedState, mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_SIGNED : AddonManager.SIGNEDSTATE_NOT_REQUIRED);
-
- yield promiseRestartManager();
-
- install = BootstrapMonitor.checkAddonInstalled(ID, "1.0");
- equal(install.reason, BOOTSTRAP_REASONS.ADDON_INSTALL);
- BootstrapMonitor.checkAddonStarted(ID, "1.0");
-
- addon = yield promiseAddonByID(ID);
- do_check_neq(addon, null);
-
- yield promiseRestartManager();
-});
-