Wed, 31 Dec 2014 06:09:35 +0100
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 | function run_test() { |
michael@0 | 6 | do_test_pending(); |
michael@0 | 7 | createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); |
michael@0 | 8 | |
michael@0 | 9 | startupManager(); |
michael@0 | 10 | |
michael@0 | 11 | run_test_1(); |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | // Tests that installing doesn't require a restart |
michael@0 | 15 | function run_test_1() { |
michael@0 | 16 | prepare_test({ }, [ |
michael@0 | 17 | "onNewInstall" |
michael@0 | 18 | ]); |
michael@0 | 19 | |
michael@0 | 20 | AddonManager.getInstallForFile(do_get_addon("test_bug567184"), function(install) { |
michael@0 | 21 | ensure_test_completed(); |
michael@0 | 22 | |
michael@0 | 23 | do_check_neq(install, null); |
michael@0 | 24 | |
michael@0 | 25 | prepare_test({ |
michael@0 | 26 | "bug567184@tests.mozilla.org": [ |
michael@0 | 27 | ["onInstalling", false], |
michael@0 | 28 | "onInstalled" |
michael@0 | 29 | ] |
michael@0 | 30 | }, [ |
michael@0 | 31 | "onInstallStarted", |
michael@0 | 32 | "onInstallEnded", |
michael@0 | 33 | ], check_test_1); |
michael@0 | 34 | install.install(); |
michael@0 | 35 | }); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | function check_test_1() { |
michael@0 | 39 | AddonManager.getAllInstalls(function(installs) { |
michael@0 | 40 | // There should be no active installs now since the install completed and |
michael@0 | 41 | // doesn't require a restart. |
michael@0 | 42 | do_check_eq(installs.length, 0); |
michael@0 | 43 | |
michael@0 | 44 | AddonManager.getAddonByID("bug567184@tests.mozilla.org", function(b1) { |
michael@0 | 45 | do_check_neq(b1, null); |
michael@0 | 46 | do_check_true(b1.appDisabled); |
michael@0 | 47 | do_check_false(b1.userDisabled); |
michael@0 | 48 | do_check_false(b1.isActive); |
michael@0 | 49 | |
michael@0 | 50 | do_execute_soon(do_test_finished); |
michael@0 | 51 | }); |
michael@0 | 52 | }); |
michael@0 | 53 | } |