Bug 728651 - Add a new test to check that all bundled add-ons are compatible. r=Neil f=sgautherie a=Callek
authorJens Hatlak <jh@junetz.de>
Tue, 28 Feb 2012 19:06:32 +0100
changeset 11658 ad79480a62c3424267d636b68727936d8323778c
parent 11657 5c44d1dfbacea7627c287ad7ea8fb0daa005fe44
child 11659 6b006b33f66195f64dc47b78d767ebd4cd148fde
push id6
push userbienvenu@nventure.com
push dateWed, 16 May 2012 22:24:51 +0000
treeherdertry-comm-central@ac395aea3008 [default view] [failures only]
reviewersNeil, Callek
bugs728651
Bug 728651 - Add a new test to check that all bundled add-ons are compatible. r=Neil f=sgautherie a=Callek
suite/browser/test/Makefile.in
suite/browser/test/browser/browser_bug728651.js
--- 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();
+  });
+}