toolkit/mozapps/extensions/test/xpcshell/test_bug299716_2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     6 // Disables security checking our updates which haven't been signed
     7 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
     9 // Get the HTTP server.
    10 Components.utils.import("resource://testing-common/httpd.js");
    11 var testserver;
    13 var ADDON = {
    14   id: "bug299716-2@tests.mozilla.org",
    15   addon: "test_bug299716_2"
    16 };
    18 function run_test() {
    19   do_test_pending();
    21   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
    23   const dataDir = do_get_file("data");
    24   const addonsDir = do_get_addon(ADDON.addon).parent;
    26   // Create and configure the HTTP server.
    27   testserver = new HttpServer();
    28   testserver.registerDirectory("/addons/", addonsDir);
    29   testserver.registerDirectory("/data/", dataDir);
    30   testserver.start(4444);
    32   startupManager();
    34   installAllFiles([do_get_addon(ADDON.addon)], function() {
    35     restartManager();
    37     AddonManager.getAddonByID(ADDON.id, function(item) {
    38       do_check_eq(item.version, 0.1);
    39       do_check_false(item.isCompatible);
    41       item.findUpdates({
    42         onUpdateFinished: function(addon) {
    43           do_check_false(item.isCompatible);
    45           testserver.stop(do_test_finished);
    46         }
    47       }, AddonManager.UPDATE_WHEN_USER_REQUESTED);
    48     });
    49   });
    50 }

mercurial