michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: function run_test() { michael@0: do_test_pending(); michael@0: createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); michael@0: michael@0: startupManager(); michael@0: michael@0: run_test_1(); michael@0: } michael@0: michael@0: // Tests that installing doesn't require a restart michael@0: function run_test_1() { michael@0: prepare_test({ }, [ michael@0: "onNewInstall" michael@0: ]); michael@0: michael@0: AddonManager.getInstallForFile(do_get_addon("test_bug567184"), function(install) { michael@0: ensure_test_completed(); michael@0: michael@0: do_check_neq(install, null); michael@0: michael@0: prepare_test({ michael@0: "bug567184@tests.mozilla.org": [ michael@0: ["onInstalling", false], michael@0: "onInstalled" michael@0: ] michael@0: }, [ michael@0: "onInstallStarted", michael@0: "onInstallEnded", michael@0: ], check_test_1); michael@0: install.install(); michael@0: }); michael@0: } michael@0: michael@0: function check_test_1() { michael@0: AddonManager.getAllInstalls(function(installs) { michael@0: // There should be no active installs now since the install completed and michael@0: // doesn't require a restart. michael@0: do_check_eq(installs.length, 0); michael@0: michael@0: AddonManager.getAddonByID("bug567184@tests.mozilla.org", function(b1) { michael@0: do_check_neq(b1, null); michael@0: do_check_true(b1.appDisabled); michael@0: do_check_false(b1.userDisabled); michael@0: do_check_false(b1.isActive); michael@0: michael@0: do_execute_soon(do_test_finished); michael@0: }); michael@0: }); michael@0: }