Bug 728651 - Add a new test to check that all bundled add-ons are compatible. r=Neil f=sgautherie
authorJens Hatlak <jh@junetz.de>
Tue, 28 Feb 2012 19:06:32 +0100
changeset 10962 6658e84a7d4093b33e445d482d389eea991ff500
parent 10961 c1704e94d670c5668437235b810aa24445be08ae
child 10963 5445b9cf8c2a36c9260d4f6c662983aa4b7e2319
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs728651
Bug 728651 - Add a new test to check that all bundled add-ons are compatible. r=Neil f=sgautherie
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();
+  });
+}