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: // This just verifies that the EM can actually startup and shutdown a few times michael@0: // without any errors michael@0: michael@0: // We have to look up how many add-ons are present since there will be plugins michael@0: // etc. detected michael@0: var gCount; 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: var count = 0; michael@0: startupManager(); michael@0: AddonManager.getAddonsByTypes(null, function(list) { michael@0: gCount = list.length; michael@0: michael@0: do_execute_soon(run_test_1); michael@0: }); michael@0: } michael@0: michael@0: function run_test_1() { michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonsByTypes(null, function(addons) { michael@0: do_check_eq(gCount, addons.length); michael@0: michael@0: AddonManager.getAddonsWithOperationsByTypes(null, function(pendingAddons) { michael@0: do_check_eq(0, pendingAddons.length); michael@0: michael@0: do_execute_soon(run_test_2); michael@0: }); michael@0: }); michael@0: } michael@0: michael@0: function run_test_2() { michael@0: shutdownManager(); michael@0: michael@0: startupManager(false); michael@0: michael@0: AddonManager.getAddonsByTypes(null, function(addons) { michael@0: do_check_eq(gCount, addons.length); michael@0: michael@0: do_execute_soon(run_test_3); michael@0: }); michael@0: } michael@0: michael@0: function run_test_3() { michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonsByTypes(null, callback_soon(function(addons) { michael@0: do_check_eq(gCount, addons.length); michael@0: do_test_finished(); michael@0: })); michael@0: }