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