From eda567b364a06e9e63efb865a6b1c73f1cb5232e Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 26 Jun 2018 16:09:08 -0400 Subject: [AllAM] Remove Mozilla Tests --- .../test/xpcshell/test_signed_multi.js | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js (limited to 'toolkit/mozapps/webextensions/test/xpcshell/test_signed_multi.js') 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)); -- cgit v1.2.3