toolkit/mozapps/extensions/test/browser/browser_checkAddonCompatibility.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 }

mercurial