|
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 */ |
|
5 |
|
6 const ADDON = "test_bug521905"; |
|
7 const ID = "bug521905@tests.mozilla.org"; |
|
8 |
|
9 // Disables security checking our updates which haven't been signed |
|
10 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false); |
|
11 |
|
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 } |
|
18 |
|
19 do_test_pending(); |
|
20 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2"); |
|
21 |
|
22 startupManager(); |
|
23 AddonManager.checkCompatibility = false; |
|
24 |
|
25 installAllFiles([do_get_addon(ADDON)], function() { |
|
26 restartManager(); |
|
27 |
|
28 AddonManager.getAddonByID(ID, function(addon) { |
|
29 do_check_neq(addon, null); |
|
30 do_check_true(addon.isActive); |
|
31 |
|
32 do_execute_soon(run_test_1); |
|
33 }); |
|
34 }); |
|
35 } |
|
36 |
|
37 function run_test_1() { |
|
38 Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", true); |
|
39 |
|
40 restartManager(); |
|
41 AddonManager.getAddonByID(ID, function(addon) { |
|
42 do_check_neq(addon, null); |
|
43 do_check_false(addon.isActive); |
|
44 |
|
45 do_execute_soon(run_test_2); |
|
46 }); |
|
47 } |
|
48 |
|
49 function run_test_2() { |
|
50 Services.prefs.setBoolPref("extensions.checkCompatibility.2.0p", false); |
|
51 |
|
52 restartManager(); |
|
53 AddonManager.getAddonByID(ID, function(addon) { |
|
54 do_check_neq(addon, null); |
|
55 do_check_false(addon.isActive); |
|
56 |
|
57 do_execute_soon(do_test_finished); |
|
58 }); |
|
59 } |