toolkit/mozapps/extensions/test/xpcshell/test_bug740612.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug740612.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.6 + */
     1.7 +
     1.8 +// This verifies that attempts to override the global values fails but doesn't
     1.9 +// destroy the world with it
    1.10 +createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
    1.11 +
    1.12 +const profileDir = gProfD.clone();
    1.13 +profileDir.append("extensions");
    1.14 +
    1.15 +function getActiveVersion() {
    1.16 +  return Services.prefs.getIntPref("bootstraptest.active_version");
    1.17 +}
    1.18 +
    1.19 +function getInstalledVersion() {
    1.20 +  return Services.prefs.getIntPref("bootstraptest.installed_version");
    1.21 +}
    1.22 +
    1.23 +function run_test() {
    1.24 +  do_test_pending();
    1.25 +
    1.26 +  manuallyInstall(do_get_addon("test_bug740612_1"), profileDir,
    1.27 +                  "bug740612_1@tests.mozilla.org");
    1.28 +  manuallyInstall(do_get_addon("test_bug740612_2"), profileDir,
    1.29 +                  "bug740612_2@tests.mozilla.org");
    1.30 +
    1.31 +  startupManager();
    1.32 +
    1.33 +  AddonManager.getAddonsByIDs(["bug740612_1@tests.mozilla.org",
    1.34 +                               "bug740612_2@tests.mozilla.org"],
    1.35 +                               function([a1, a2]) {
    1.36 +    do_check_neq(a1, null);
    1.37 +    do_check_neq(a2, null);
    1.38 +    do_check_eq(getInstalledVersion(), "1.0");
    1.39 +    do_check_eq(getActiveVersion(), "1.0");
    1.40 +
    1.41 +    do_execute_soon(do_test_finished);
    1.42 +  });
    1.43 +}

mercurial