Bug 728651 - Add a new test to check that all bundled add-ons are compatible. r=Neil f=sgautherie
--- a/suite/browser/test/Makefile.in
+++ b/suite/browser/test/Makefile.in
@@ -75,16 +75,17 @@ include $(topsrcdir)/config/rules.mk
plugin_both2.html \
browser_popupNotification.js \
browser_scope.js \
browser_alltabslistener.js \
alltabslistener.html \
browser_relatedTabs.js \
browser_selectTabAtIndex.js \
browser_bug519216.js \
+ browser_bug728651.js \
$(NULL)
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_BROWSER_FILES += browser_bug462289.js
endif
libs:: $(addprefix mochitest/, $(_TEST_FILES))
$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/suite/browser/test/browser/browser_bug728651.js
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+// Test that all bundled add-ons are compatible.
+
+const PREF_STRICT_COMPAT = "extensions.strictCompatibility";
+
+function test() {
+ waitForExplicitFinish();
+
+ Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true);
+ is(AddonManager.strictCompatibility, true, "Strict compatibility should be enabled");
+
+ AddonManager.getAllAddons(function(aAddons) {
+ let allCompatible = true;
+ aAddons.forEach(function(a) {
+ if (a.type != "plugin") { // we don't care about plugins
+ ok(a.isCompatible, a.name + " " + a.version + " should be compatible");
+ allCompatible = allCompatible && a.isCompatible;
+ }
+ });
+ if (!allCompatible)
+ ok(false, "As this test failed, Toolkit test browser_bug557956.js should fail, too.");
+ Services.prefs.clearUserPref(PREF_STRICT_COMPAT);
+ finish();
+ });
+}