summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.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_signed_multi.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_signed_multi.js')
-rw-r--r--toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js b/toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js
deleted file mode 100644
index 01de29088..000000000
--- a/toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Enable signature checks for these tests
-gUseRealCertChecks = true;
-// Disable update security
-Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
-
-const DATA = "data/signing_checks/";
-
-// Each multi-package XPI contains one valid theme and one other add-on that
-// has the following error state:
-const ADDONS = {
- "multi_signed.xpi": 0,
- "multi_badid.xpi": AddonManager.ERROR_CORRUPT_FILE,
- "multi_broken.xpi": AddonManager.ERROR_CORRUPT_FILE,
- "multi_unsigned.xpi": AddonManager.ERROR_SIGNEDSTATE_REQUIRED,
-};
-
-function createInstall(filename) {
- return new Promise(resolve => {
- AddonManager.getInstallForFile(do_get_file(DATA + filename), resolve, "application/x-xpinstall");
- });
-}
-
-function run_test() {
- createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "4", "4");
- startupManager();
-
- run_next_test();
-}
-
-function* test_addon(filename) {
- do_print("Testing " + filename);
-
- let install = yield createInstall(filename);
- do_check_eq(install.state, AddonManager.STATE_DOWNLOADED);
- do_check_eq(install.error, 0);
-
- do_check_neq(install.linkedInstalls, null);
- do_check_eq(install.linkedInstalls.length, 1);
-
- let linked = install.linkedInstalls[0];
- do_print(linked.state);
- do_check_eq(linked.error, ADDONS[filename]);
- if (linked.error == 0) {
- do_check_eq(linked.state, AddonManager.STATE_DOWNLOADED);
- linked.cancel();
- }
- else {
- do_check_eq(linked.state, AddonManager.STATE_DOWNLOAD_FAILED);
- }
-
- install.cancel();
-}
-
-for (let filename of Object.keys(ADDONS))
- add_task(test_addon.bind(null, filename));