toolkit/mozapps/extensions/test/xpcshell/test_bug526598.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 function run_test() {
     7   do_test_pending();
     8   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
    10   startupManager();
    12   installAllFiles([do_get_file("data/test_bug526598_1.xpi"),
    13                    do_get_file("data/test_bug526598_2.xpi")], function() {
    15     restartManager();
    17     AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org",
    18                                  "bug526598_2@tests.mozilla.org"],
    19                                  callback_soon(function([a1, a2]) {
    21       do_check_neq(a1, null);
    22       do_check_true(a1.hasResource("install.rdf"));
    23       let uri = a1.getResourceURI("install.rdf");
    24       do_check_true(uri instanceof AM_Ci.nsIFileURL);
    25       let file = uri.file;
    26       do_check_true(file.exists());
    27       do_check_true(file.isReadable());
    28       do_check_true(file.isWritable());
    30       do_check_neq(a2, null);
    31       do_check_true(a2.hasResource("install.rdf"));
    32       uri = a2.getResourceURI("install.rdf");
    33       do_check_true(uri instanceof AM_Ci.nsIFileURL);
    34       file = uri.file;
    35       do_check_true(file.exists());
    36       do_check_true(file.isReadable());
    37       do_check_true(file.isWritable());
    39       a1.uninstall();
    40       a2.uninstall();
    42       restartManager();
    44       AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org",
    45                                    "bug526598_2@tests.mozilla.org"],
    46                                    function([newa1, newa2]) {
    47         do_check_eq(newa1, null);
    48         do_check_eq(newa2, null);
    50         do_execute_soon(do_test_finished);
    51       });
    52     }));
    53   });
    54 }

mercurial