toolkit/mozapps/extensions/test/xpcshell/test_bug740612.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.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/
michael@0 3 */
michael@0 4
michael@0 5 // This verifies that attempts to override the global values fails but doesn't
michael@0 6 // destroy the world with it
michael@0 7 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
michael@0 8
michael@0 9 const profileDir = gProfD.clone();
michael@0 10 profileDir.append("extensions");
michael@0 11
michael@0 12 function getActiveVersion() {
michael@0 13 return Services.prefs.getIntPref("bootstraptest.active_version");
michael@0 14 }
michael@0 15
michael@0 16 function getInstalledVersion() {
michael@0 17 return Services.prefs.getIntPref("bootstraptest.installed_version");
michael@0 18 }
michael@0 19
michael@0 20 function run_test() {
michael@0 21 do_test_pending();
michael@0 22
michael@0 23 manuallyInstall(do_get_addon("test_bug740612_1"), profileDir,
michael@0 24 "bug740612_1@tests.mozilla.org");
michael@0 25 manuallyInstall(do_get_addon("test_bug740612_2"), profileDir,
michael@0 26 "bug740612_2@tests.mozilla.org");
michael@0 27
michael@0 28 startupManager();
michael@0 29
michael@0 30 AddonManager.getAddonsByIDs(["bug740612_1@tests.mozilla.org",
michael@0 31 "bug740612_2@tests.mozilla.org"],
michael@0 32 function([a1, a2]) {
michael@0 33 do_check_neq(a1, null);
michael@0 34 do_check_neq(a2, null);
michael@0 35 do_check_eq(getInstalledVersion(), "1.0");
michael@0 36 do_check_eq(getActiveVersion(), "1.0");
michael@0 37
michael@0 38 do_execute_soon(do_test_finished);
michael@0 39 });
michael@0 40 }

mercurial