michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: const ADDON = "test_bug521905"; michael@0: const ID = "bug521905@tests.mozilla.org"; michael@0: michael@0: // Disables security checking our updates which haven't been signed michael@0: Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false); michael@0: michael@0: function run_test() { michael@0: // This test is only relevant on builds where the version is included in the michael@0: // checkCompatibility preference name michael@0: if (isNightlyChannel()) { michael@0: return; michael@0: } michael@0: michael@0: do_test_pending(); michael@0: createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2"); michael@0: michael@0: startupManager(); michael@0: AddonManager.checkCompatibility = false; michael@0: michael@0: installAllFiles([do_get_addon(ADDON)], function() { michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonByID(ID, function(addon) { michael@0: do_check_neq(addon, null); michael@0: do_check_true(addon.isActive); michael@0: michael@0: do_execute_soon(run_test_1); michael@0: }); michael@0: }); michael@0: } michael@0: michael@0: function run_test_1() { michael@0: Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", true); michael@0: michael@0: restartManager(); michael@0: AddonManager.getAddonByID(ID, function(addon) { michael@0: do_check_neq(addon, null); michael@0: do_check_false(addon.isActive); michael@0: michael@0: do_execute_soon(run_test_2); michael@0: }); michael@0: } michael@0: michael@0: function run_test_2() { michael@0: Services.prefs.setBoolPref("extensions.checkCompatibility.2.0p", false); michael@0: michael@0: restartManager(); michael@0: AddonManager.getAddonByID(ID, function(addon) { michael@0: do_check_neq(addon, null); michael@0: do_check_false(addon.isActive); michael@0: michael@0: do_execute_soon(do_test_finished); michael@0: }); michael@0: }