Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/
3 */
5 // Test that all bundled add-ons are compatible.
7 function test() {
8 waitForExplicitFinish();
10 Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true);
11 ok(AddonManager.strictCompatibility, "Strict compatibility should be enabled");
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 });
19 let allCompatible = true;
20 for (let a of aAddons) {
21 // Ignore plugins.
22 if (a.type == "plugin")
23 continue;
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.");
32 finish();
33 });
34 }