michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: const Cc = Components.classes; michael@0: const Ci = Components.interfaces; michael@0: const Cu = Components.utils; michael@0: const Cr = Components.results; michael@0: michael@0: const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul"; michael@0: michael@0: Cu.import("resource://testing-common/httpd.js"); michael@0: var gTestserver = new HttpServer(); michael@0: gTestserver.start(-1); michael@0: gPort = gTestserver.identity.primaryPort; michael@0: michael@0: // register static files with server and interpolate port numbers in them michael@0: mapFile("/data/bug455906_warn.xml", gTestserver); michael@0: mapFile("/data/bug455906_start.xml", gTestserver); michael@0: mapFile("/data/bug455906_block.xml", gTestserver); michael@0: mapFile("/data/bug455906_empty.xml", gTestserver); michael@0: michael@0: // Workaround for Bug 658720 - URL formatter can leak during xpcshell tests michael@0: const PREF_BLOCKLIST_ITEM_URL = "extensions.blocklist.itemURL"; michael@0: Services.prefs.setCharPref(PREF_BLOCKLIST_ITEM_URL, "http://localhost:" + gPort + "/blocklist/%blockID%"); michael@0: michael@0: var ADDONS = [{ michael@0: // Tests how the blocklist affects a disabled add-on michael@0: id: "test_bug455906_1@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 1", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects an enabled add-on michael@0: id: "test_bug455906_2@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 2", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects an enabled add-on, to be disabled by the notification michael@0: id: "test_bug455906_3@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 3", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects a disabled add-on that was already warned about michael@0: id: "test_bug455906_4@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 4", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects an enabled add-on that was already warned about michael@0: id: "test_bug455906_5@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 5", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects an already blocked add-on michael@0: id: "test_bug455906_6@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 6", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Tests how the blocklist affects an incompatible add-on michael@0: id: "test_bug455906_7@tests.mozilla.org", michael@0: name: "Bug 455906 Addon Test 7", michael@0: version: "5", michael@0: appVersion: "2" michael@0: }, { michael@0: // Spare add-on used to ensure we get a notification when switching lists michael@0: id: "dummy_bug455906_1@tests.mozilla.org", michael@0: name: "Dummy Addon 1", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }, { michael@0: // Spare add-on used to ensure we get a notification when switching lists michael@0: id: "dummy_bug455906_2@tests.mozilla.org", michael@0: name: "Dummy Addon 2", michael@0: version: "5", michael@0: appVersion: "3" michael@0: }]; michael@0: michael@0: function MockPlugin(name, version, enabledState) { michael@0: this.name = name; michael@0: this.version = version; michael@0: this.enabledState = enabledState; michael@0: } michael@0: Object.defineProperty(MockPlugin.prototype, "blocklisted", { michael@0: get: function MockPlugin_getBlocklisted() { michael@0: let bls = Cc["@mozilla.org/extensions/blocklist;1"].getService(Ci.nsIBlocklistService); michael@0: return bls.getPluginBlocklistState(this) == bls.STATE_BLOCKED; michael@0: } michael@0: }); michael@0: Object.defineProperty(MockPlugin.prototype, "disabled", { michael@0: get: function MockPlugin_getDisabled() { michael@0: return this.enabledState == Ci.nsIPluginTag.STATE_DISABLED; michael@0: } michael@0: }); michael@0: michael@0: var PLUGINS = [ michael@0: // Tests how the blocklist affects a disabled plugin michael@0: new MockPlugin("test_bug455906_1", "5", Ci.nsIPluginTag.STATE_DISABLED), michael@0: // Tests how the blocklist affects an enabled plugin michael@0: new MockPlugin("test_bug455906_2", "5", Ci.nsIPluginTag.STATE_ENABLED), michael@0: // Tests how the blocklist affects an enabled plugin, to be disabled by the notification michael@0: new MockPlugin("test_bug455906_3", "5", Ci.nsIPluginTag.STATE_ENABLED), michael@0: // Tests how the blocklist affects a disabled plugin that was already warned about michael@0: new MockPlugin("test_bug455906_4", "5", Ci.nsIPluginTag.STATE_DISABLED), michael@0: // Tests how the blocklist affects an enabled plugin that was already warned about michael@0: new MockPlugin("test_bug455906_5", "5", Ci.nsIPluginTag.STATE_ENABLED), michael@0: // Tests how the blocklist affects an already blocked plugin michael@0: new MockPlugin("test_bug455906_6", "5", Ci.nsIPluginTag.STATE_ENABLED) michael@0: ]; michael@0: michael@0: var gNotificationCheck = null; michael@0: var gTestCheck = null; michael@0: michael@0: // A fake plugin host for the blocklist service to use michael@0: var PluginHost = { michael@0: getPluginTags: function(countRef) { michael@0: countRef.value = PLUGINS.length; michael@0: return PLUGINS; michael@0: }, michael@0: michael@0: QueryInterface: function(iid) { michael@0: if (iid.equals(Ci.nsIPluginHost) michael@0: || iid.equals(Ci.nsISupports)) michael@0: return this; michael@0: michael@0: throw Components.results.NS_ERROR_NO_INTERFACE; michael@0: } michael@0: } michael@0: michael@0: var PluginHostFactory = { michael@0: createInstance: function (outer, iid) { michael@0: if (outer != null) michael@0: throw Components.results.NS_ERROR_NO_AGGREGATION; michael@0: return PluginHost.QueryInterface(iid); michael@0: } michael@0: }; michael@0: michael@0: // Don't need the full interface, attempts to call other methods will just michael@0: // throw which is just fine michael@0: var WindowWatcher = { michael@0: openWindow: function(parent, url, name, features, windowArguments) { michael@0: // Should be called to list the newly blocklisted items michael@0: do_check_eq(url, URI_EXTENSION_BLOCKLIST_DIALOG); michael@0: michael@0: if (gNotificationCheck) { michael@0: var args = windowArguments.wrappedJSObject; michael@0: gNotificationCheck(args); michael@0: } michael@0: michael@0: //run the code after the blocklist is closed michael@0: Services.obs.notifyObservers(null, "addon-blocklist-closed", null); michael@0: michael@0: // Call the next test after the blocklist has finished up michael@0: do_timeout(0, gTestCheck); michael@0: }, michael@0: michael@0: QueryInterface: function(iid) { michael@0: if (iid.equals(Ci.nsIWindowWatcher) michael@0: || iid.equals(Ci.nsISupports)) michael@0: return this; michael@0: michael@0: throw Cr.NS_ERROR_NO_INTERFACE; michael@0: } michael@0: } michael@0: michael@0: var WindowWatcherFactory = { michael@0: createInstance: function createInstance(outer, iid) { michael@0: if (outer != null) michael@0: throw Components.results.NS_ERROR_NO_AGGREGATION; michael@0: return WindowWatcher.QueryInterface(iid); michael@0: } michael@0: }; michael@0: var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar); michael@0: registrar.registerFactory(Components.ID("{721c3e73-969e-474b-a6dc-059fd288c428}"), michael@0: "Fake Plugin Host", michael@0: "@mozilla.org/plugin/host;1", PluginHostFactory); michael@0: registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"), michael@0: "Fake Window Watcher", michael@0: "@mozilla.org/embedcomp/window-watcher;1", WindowWatcherFactory); michael@0: michael@0: function create_addon(addon) { michael@0: var installrdf = "\n" + michael@0: "\n" + michael@0: "\n" + michael@0: " \n" + michael@0: " " + addon.id + "\n" + michael@0: " " + addon.version + "\n" + michael@0: " \n" + michael@0: " \n" + michael@0: " xpcshell@tests.mozilla.org\n" + michael@0: " " + addon.appVersion + "\n" + michael@0: " " + addon.appVersion + "\n" + michael@0: " \n" + michael@0: " \n" + michael@0: " " + addon.name + "\n" + michael@0: " \n" + michael@0: "\n"; michael@0: var target = gProfD.clone(); michael@0: target.append("extensions"); michael@0: target.append(addon.id); michael@0: target.append("install.rdf"); michael@0: target.create(target.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE); michael@0: var stream = Cc["@mozilla.org/network/file-output-stream;1"]. michael@0: createInstance(Ci.nsIFileOutputStream); michael@0: stream.init(target, michael@0: FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE, michael@0: FileUtils.PERMS_FILE, 0); michael@0: stream.write(installrdf, installrdf.length); michael@0: stream.close(); michael@0: } michael@0: michael@0: function load_blocklist(file) { michael@0: Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + file); michael@0: var blocklist = Cc["@mozilla.org/extensions/blocklist;1"]. michael@0: getService(Ci.nsITimerCallback); michael@0: blocklist.notify(null); michael@0: } michael@0: michael@0: function check_addon_state(addon) { michael@0: return addon.userDisabled + "," + addon.softDisabled + "," + addon.appDisabled; michael@0: } michael@0: michael@0: function check_plugin_state(plugin) { michael@0: return plugin.disabled + "," + plugin.blocklisted; michael@0: } michael@0: michael@0: function create_blocklistURL(blockID){ michael@0: let url = Services.urlFormatter.formatURLPref(PREF_BLOCKLIST_ITEM_URL); michael@0: url = url.replace(/%blockID%/g, blockID); michael@0: return url; michael@0: } michael@0: michael@0: // Performs the initial setup michael@0: function run_test() { michael@0: // Setup for test michael@0: dump("Setting up tests\n"); michael@0: // Rather than keeping lots of identical add-ons in version control, just michael@0: // write them into the profile. michael@0: for (let addon of ADDONS) michael@0: create_addon(addon); michael@0: michael@0: // Copy the initial blocklist into the profile to check add-ons start in the michael@0: // right state. michael@0: copyBlocklistToProfile(do_get_file("data/bug455906_start.xml")); michael@0: michael@0: createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8"); michael@0: startupManager(); michael@0: michael@0: do_test_pending(); michael@0: check_test_pt1(); michael@0: } michael@0: michael@0: // Before every main test this is the state the add-ons are meant to be in michael@0: function check_initial_state(callback) { michael@0: AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(addons) { michael@0: do_check_eq(check_addon_state(addons[0]), "true,false,false"); michael@0: do_check_eq(check_addon_state(addons[1]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[2]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[3]), "true,true,false"); michael@0: do_check_eq(check_addon_state(addons[4]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[5]), "false,false,true"); michael@0: do_check_eq(check_addon_state(addons[6]), "false,false,true"); michael@0: michael@0: do_check_eq(check_plugin_state(PLUGINS[0]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[1]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[2]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[3]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[4]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[5]), "false,true"); michael@0: michael@0: callback(); michael@0: }); michael@0: } michael@0: michael@0: // Tests the add-ons were installed and the initial blocklist applied as expected michael@0: function check_test_pt1() { michael@0: dump("Checking pt 1\n"); michael@0: michael@0: AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], callback_soon(function(addons) { michael@0: for (var i = 0; i < ADDONS.length; i++) { michael@0: if (!addons[i]) michael@0: do_throw("Addon " + (i + 1) + " did not get installed correctly"); michael@0: } michael@0: michael@0: do_check_eq(check_addon_state(addons[0]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[1]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[2]), "false,false,false"); michael@0: michael@0: // Warn add-ons should be soft disabled automatically michael@0: do_check_eq(check_addon_state(addons[3]), "true,true,false"); michael@0: do_check_eq(check_addon_state(addons[4]), "true,true,false"); michael@0: michael@0: // Blocked and incompatible should be app disabled only michael@0: do_check_eq(check_addon_state(addons[5]), "false,false,true"); michael@0: do_check_eq(check_addon_state(addons[6]), "false,false,true"); michael@0: michael@0: // We've overridden the plugin host so we cannot tell what that would have michael@0: // initialised the plugins as michael@0: michael@0: // Put the add-ons into the base state michael@0: addons[0].userDisabled = true; michael@0: addons[4].userDisabled = false; michael@0: michael@0: restartManager(); michael@0: check_initial_state(function() { michael@0: gNotificationCheck = check_notification_pt2; michael@0: gTestCheck = check_test_pt2; michael@0: load_blocklist("bug455906_warn.xml"); michael@0: }); michael@0: })); michael@0: } michael@0: michael@0: function check_notification_pt2(args) { michael@0: dump("Checking notification pt 2\n"); michael@0: do_check_eq(args.list.length, 4); michael@0: michael@0: for (let addon of args.list) { michael@0: if (addon.item instanceof Ci.nsIPluginTag) { michael@0: switch (addon.item.name) { michael@0: case "test_bug455906_2": michael@0: do_check_false(addon.blocked); michael@0: break; michael@0: case "test_bug455906_3": michael@0: do_check_false(addon.blocked); michael@0: addon.disable = true; michael@0: break; michael@0: default: michael@0: do_throw("Unknown addon: " + addon.item.name); michael@0: } michael@0: } michael@0: else { michael@0: switch (addon.item.id) { michael@0: case "test_bug455906_2@tests.mozilla.org": michael@0: do_check_false(addon.blocked); michael@0: break; michael@0: case "test_bug455906_3@tests.mozilla.org": michael@0: do_check_false(addon.blocked); michael@0: addon.disable = true; michael@0: break; michael@0: default: michael@0: do_throw("Unknown addon: " + addon.item.id); michael@0: } michael@0: } michael@0: } michael@0: } michael@0: michael@0: function check_test_pt2() { michael@0: restartManager(); michael@0: dump("Checking results pt 2\n"); michael@0: michael@0: AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], callback_soon(function(addons) { michael@0: // Should have disabled this add-on as requested michael@0: do_check_eq(check_addon_state(addons[2]), "true,true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[2]), "true,false"); michael@0: michael@0: // The blocked add-on should have changed to soft disabled michael@0: do_check_eq(check_addon_state(addons[5]), "true,true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[5]), "true,false"); michael@0: michael@0: // These should have been unchanged michael@0: do_check_eq(check_addon_state(addons[0]), "true,false,false"); michael@0: do_check_eq(check_addon_state(addons[1]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[3]), "true,true,false"); michael@0: do_check_eq(check_addon_state(addons[4]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[6]), "false,false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[0]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[1]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[3]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[4]), "false,false"); michael@0: michael@0: // Back to starting state michael@0: addons[2].userDisabled = false; michael@0: addons[5].userDisabled = false; michael@0: PLUGINS[2].enabledState = Ci.nsIPluginTag.STATE_ENABLED; michael@0: PLUGINS[5].enabledState = Ci.nsIPluginTag.STATE_ENABLED; michael@0: restartManager(); michael@0: gNotificationCheck = null; michael@0: gTestCheck = run_test_pt3; michael@0: load_blocklist("bug455906_start.xml"); michael@0: })); michael@0: } michael@0: michael@0: function run_test_pt3() { michael@0: restartManager(); michael@0: check_initial_state(function() { michael@0: gNotificationCheck = check_notification_pt3; michael@0: gTestCheck = check_test_pt3; michael@0: load_blocklist("bug455906_block.xml"); michael@0: }); michael@0: } michael@0: michael@0: function check_notification_pt3(args) { michael@0: dump("Checking notification pt 3\n"); michael@0: do_check_eq(args.list.length, 6); michael@0: michael@0: for (let addon of args.list) { michael@0: if (addon.item instanceof Ci.nsIPluginTag) { michael@0: switch (addon.item.name) { michael@0: case "test_bug455906_2": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: case "test_bug455906_3": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: case "test_bug455906_5": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: default: michael@0: do_throw("Unknown addon: " + addon.item.name); michael@0: } michael@0: } michael@0: else { michael@0: switch (addon.item.id) { michael@0: case "test_bug455906_2@tests.mozilla.org": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: case "test_bug455906_3@tests.mozilla.org": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: case "test_bug455906_5@tests.mozilla.org": michael@0: do_check_true(addon.blocked); michael@0: break; michael@0: default: michael@0: do_throw("Unknown addon: " + addon.item.id); michael@0: } michael@0: } michael@0: } michael@0: } michael@0: michael@0: function check_test_pt3() { michael@0: restartManager(); michael@0: dump("Checking results pt 3\n"); michael@0: michael@0: let blocklist = Cc["@mozilla.org/extensions/blocklist;1"]. michael@0: getService(Ci.nsIBlocklistService); michael@0: michael@0: AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(addons) { michael@0: // All should have gained the blocklist state, user disabled as previously michael@0: do_check_eq(check_addon_state(addons[0]), "true,false,true"); michael@0: do_check_eq(check_addon_state(addons[1]), "false,false,true"); michael@0: do_check_eq(check_addon_state(addons[2]), "false,false,true"); michael@0: do_check_eq(check_addon_state(addons[4]), "false,false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[0]), "true,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[1]), "false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[2]), "false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[3]), "true,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[4]), "false,true"); michael@0: michael@0: // Should have gained the blocklist state but no longer be soft disabled michael@0: do_check_eq(check_addon_state(addons[3]), "false,false,true"); michael@0: michael@0: // Check blockIDs are correct michael@0: do_check_eq(blocklist.getAddonBlocklistURL(addons[0]),create_blocklistURL(addons[0].id)); michael@0: do_check_eq(blocklist.getAddonBlocklistURL(addons[1]),create_blocklistURL(addons[1].id)); michael@0: do_check_eq(blocklist.getAddonBlocklistURL(addons[2]),create_blocklistURL(addons[2].id)); michael@0: do_check_eq(blocklist.getAddonBlocklistURL(addons[3]),create_blocklistURL(addons[3].id)); michael@0: do_check_eq(blocklist.getAddonBlocklistURL(addons[4]),create_blocklistURL(addons[4].id)); michael@0: michael@0: // All plugins have the same blockID on the test michael@0: do_check_eq(blocklist.getPluginBlocklistURL(PLUGINS[0]), create_blocklistURL('test_bug455906_plugin')); michael@0: do_check_eq(blocklist.getPluginBlocklistURL(PLUGINS[1]), create_blocklistURL('test_bug455906_plugin')); michael@0: do_check_eq(blocklist.getPluginBlocklistURL(PLUGINS[2]), create_blocklistURL('test_bug455906_plugin')); michael@0: do_check_eq(blocklist.getPluginBlocklistURL(PLUGINS[3]), create_blocklistURL('test_bug455906_plugin')); michael@0: do_check_eq(blocklist.getPluginBlocklistURL(PLUGINS[4]), create_blocklistURL('test_bug455906_plugin')); michael@0: michael@0: // Shouldn't be changed michael@0: do_check_eq(check_addon_state(addons[5]), "false,false,true"); michael@0: do_check_eq(check_addon_state(addons[6]), "false,false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[5]), "false,true"); michael@0: michael@0: // Back to starting state michael@0: gNotificationCheck = null; michael@0: gTestCheck = run_test_pt4; michael@0: load_blocklist("bug455906_start.xml"); michael@0: }); michael@0: } michael@0: michael@0: function run_test_pt4() { michael@0: AddonManager.getAddonByID(ADDONS[4].id, callback_soon(function(addon) { michael@0: addon.userDisabled = false; michael@0: PLUGINS[4].enabledState = Ci.nsIPluginTag.STATE_ENABLED; michael@0: restartManager(); michael@0: check_initial_state(function() { michael@0: gNotificationCheck = check_notification_pt4; michael@0: gTestCheck = check_test_pt4; michael@0: load_blocklist("bug455906_empty.xml"); michael@0: }); michael@0: })); michael@0: } michael@0: michael@0: function check_notification_pt4(args) { michael@0: dump("Checking notification pt 4\n"); michael@0: michael@0: // Should be just the dummy add-on to force this notification michael@0: do_check_eq(args.list.length, 1); michael@0: do_check_false(args.list[0].item instanceof Ci.nsIPluginTag); michael@0: do_check_eq(args.list[0].item.id, "dummy_bug455906_2@tests.mozilla.org"); michael@0: } michael@0: michael@0: function check_test_pt4() { michael@0: restartManager(); michael@0: dump("Checking results pt 4\n"); michael@0: michael@0: AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(addons) { michael@0: // This should have become unblocked michael@0: do_check_eq(check_addon_state(addons[5]), "false,false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[5]), "false,false"); michael@0: michael@0: // Should get re-enabled michael@0: do_check_eq(check_addon_state(addons[3]), "false,false,false"); michael@0: michael@0: // No change for anything else michael@0: do_check_eq(check_addon_state(addons[0]), "true,false,false"); michael@0: do_check_eq(check_addon_state(addons[1]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[2]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[4]), "false,false,false"); michael@0: do_check_eq(check_addon_state(addons[6]), "false,false,true"); michael@0: do_check_eq(check_plugin_state(PLUGINS[0]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[1]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[2]), "false,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[3]), "true,false"); michael@0: do_check_eq(check_plugin_state(PLUGINS[4]), "false,false"); michael@0: michael@0: finish(); michael@0: }); michael@0: } michael@0: michael@0: function finish() { michael@0: gTestserver.stop(do_test_finished); michael@0: }