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: // Disables security checking our updates which haven't been signed michael@0: Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false); michael@0: michael@0: // Get the HTTP server. michael@0: Components.utils.import("resource://testing-common/httpd.js"); michael@0: var testserver; michael@0: michael@0: var ADDON = { michael@0: id: "bug299716-2@tests.mozilla.org", michael@0: addon: "test_bug299716_2" michael@0: }; michael@0: michael@0: function run_test() { michael@0: do_test_pending(); michael@0: michael@0: createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9"); michael@0: michael@0: const dataDir = do_get_file("data"); michael@0: const addonsDir = do_get_addon(ADDON.addon).parent; michael@0: michael@0: // Create and configure the HTTP server. michael@0: testserver = new HttpServer(); michael@0: testserver.registerDirectory("/addons/", addonsDir); michael@0: testserver.registerDirectory("/data/", dataDir); michael@0: testserver.start(4444); michael@0: michael@0: startupManager(); michael@0: michael@0: installAllFiles([do_get_addon(ADDON.addon)], function() { michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonByID(ADDON.id, function(item) { michael@0: do_check_eq(item.version, 0.1); michael@0: do_check_false(item.isCompatible); michael@0: michael@0: item.findUpdates({ michael@0: onUpdateFinished: function(addon) { michael@0: do_check_false(item.isCompatible); michael@0: michael@0: testserver.stop(do_test_finished); michael@0: } michael@0: }, AddonManager.UPDATE_WHEN_USER_REQUESTED); michael@0: }); michael@0: }); michael@0: }