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 | startupManager(); |
michael@0 | 9 | |
michael@0 | 10 | prepare_test({ }, [ |
michael@0 | 11 | "onNewInstall" |
michael@0 | 12 | ]); |
michael@0 | 13 | |
michael@0 | 14 | AddonManager.getInstallForFile(do_get_addon("test_bug675371"), function(install) { |
michael@0 | 15 | ensure_test_completed(); |
michael@0 | 16 | |
michael@0 | 17 | do_check_neq(install, null); |
michael@0 | 18 | |
michael@0 | 19 | prepare_test({ |
michael@0 | 20 | "bug675371@tests.mozilla.org": [ |
michael@0 | 21 | ["onInstalling", false], |
michael@0 | 22 | "onInstalled" |
michael@0 | 23 | ] |
michael@0 | 24 | }, [ |
michael@0 | 25 | "onInstallStarted", |
michael@0 | 26 | "onInstallEnded" |
michael@0 | 27 | ], callback_soon(check_test)); |
michael@0 | 28 | install.install(); |
michael@0 | 29 | }); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | function check_test() { |
michael@0 | 33 | AddonManager.getAddonByID("bug675371@tests.mozilla.org", do_exception_wrap(function(addon) { |
michael@0 | 34 | do_check_neq(addon, null); |
michael@0 | 35 | do_check_true(addon.isActive); |
michael@0 | 36 | |
michael@0 | 37 | // Tests that chrome.manifest is registered when the addon is installed. |
michael@0 | 38 | var target = { active: false }; |
michael@0 | 39 | Services.scriptloader.loadSubScript("chrome://bug675371/content/test.js", target); |
michael@0 | 40 | do_check_true(target.active); |
michael@0 | 41 | |
michael@0 | 42 | shutdownManager(); |
michael@0 | 43 | |
michael@0 | 44 | // Tests that chrome.manifest remains registered at app shutdown. |
michael@0 | 45 | target.active = false; |
michael@0 | 46 | Services.scriptloader.loadSubScript("chrome://bug675371/content/test.js", target); |
michael@0 | 47 | do_check_true(target.active); |
michael@0 | 48 | |
michael@0 | 49 | do_execute_soon(do_test_finished); |
michael@0 | 50 | })); |
michael@0 | 51 | } |