|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
3 */ |
|
4 |
|
5 // Test that all bundled add-ons are compatible. |
|
6 |
|
7 function test() { |
|
8 waitForExplicitFinish(); |
|
9 |
|
10 Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true); |
|
11 ok(AddonManager.strictCompatibility, "Strict compatibility should be enabled"); |
|
12 |
|
13 AddonManager.getAllAddons(function gAACallback(aAddons) { |
|
14 // Sort add-ons (by type and name) to improve output. |
|
15 aAddons.sort(function compareTypeName(a, b) { |
|
16 return a.type.localeCompare(b.type) || a.name.localeCompare(b.name); |
|
17 }); |
|
18 |
|
19 let allCompatible = true; |
|
20 for (let a of aAddons) { |
|
21 // Ignore plugins. |
|
22 if (a.type == "plugin") |
|
23 continue; |
|
24 |
|
25 ok(a.isCompatible, a.type + " " + a.name + " " + a.version + " should be compatible"); |
|
26 allCompatible = allCompatible && a.isCompatible; |
|
27 } |
|
28 // Add a reminder. |
|
29 if (!allCompatible) |
|
30 ok(false, "As this test failed, test browser_bug557956.js should have failed, too."); |
|
31 |
|
32 finish(); |
|
33 }); |
|
34 } |