toolkit/mozapps/extensions/test/xpcshell/test_bug521905.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 4 */
michael@0 5
michael@0 6 const ADDON = "test_bug521905";
michael@0 7 const ID = "bug521905@tests.mozilla.org";
michael@0 8
michael@0 9 // Disables security checking our updates which haven't been signed
michael@0 10 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
michael@0 11
michael@0 12 function run_test() {
michael@0 13 // This test is only relevant on builds where the version is included in the
michael@0 14 // checkCompatibility preference name
michael@0 15 if (isNightlyChannel()) {
michael@0 16 return;
michael@0 17 }
michael@0 18
michael@0 19 do_test_pending();
michael@0 20 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2");
michael@0 21
michael@0 22 startupManager();
michael@0 23 AddonManager.checkCompatibility = false;
michael@0 24
michael@0 25 installAllFiles([do_get_addon(ADDON)], function() {
michael@0 26 restartManager();
michael@0 27
michael@0 28 AddonManager.getAddonByID(ID, function(addon) {
michael@0 29 do_check_neq(addon, null);
michael@0 30 do_check_true(addon.isActive);
michael@0 31
michael@0 32 do_execute_soon(run_test_1);
michael@0 33 });
michael@0 34 });
michael@0 35 }
michael@0 36
michael@0 37 function run_test_1() {
michael@0 38 Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", true);
michael@0 39
michael@0 40 restartManager();
michael@0 41 AddonManager.getAddonByID(ID, function(addon) {
michael@0 42 do_check_neq(addon, null);
michael@0 43 do_check_false(addon.isActive);
michael@0 44
michael@0 45 do_execute_soon(run_test_2);
michael@0 46 });
michael@0 47 }
michael@0 48
michael@0 49 function run_test_2() {
michael@0 50 Services.prefs.setBoolPref("extensions.checkCompatibility.2.0p", false);
michael@0 51
michael@0 52 restartManager();
michael@0 53 AddonManager.getAddonByID(ID, function(addon) {
michael@0 54 do_check_neq(addon, null);
michael@0 55 do_check_false(addon.isActive);
michael@0 56
michael@0 57 do_execute_soon(do_test_finished);
michael@0 58 });
michael@0 59 }

mercurial