michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: // Test that all bundled add-ons are compatible. michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true); michael@0: ok(AddonManager.strictCompatibility, "Strict compatibility should be enabled"); michael@0: michael@0: AddonManager.getAllAddons(function gAACallback(aAddons) { michael@0: // Sort add-ons (by type and name) to improve output. michael@0: aAddons.sort(function compareTypeName(a, b) { michael@0: return a.type.localeCompare(b.type) || a.name.localeCompare(b.name); michael@0: }); michael@0: michael@0: let allCompatible = true; michael@0: for (let a of aAddons) { michael@0: // Ignore plugins. michael@0: if (a.type == "plugin") michael@0: continue; michael@0: michael@0: ok(a.isCompatible, a.type + " " + a.name + " " + a.version + " should be compatible"); michael@0: allCompatible = allCompatible && a.isCompatible; michael@0: } michael@0: // Add a reminder. michael@0: if (!allCompatible) michael@0: ok(false, "As this test failed, test browser_bug557956.js should have failed, too."); michael@0: michael@0: finish(); michael@0: }); michael@0: }