|
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 */ |
|
5 |
|
6 function run_test() { |
|
7 do_test_pending(); |
|
8 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); |
|
9 |
|
10 startupManager(); |
|
11 |
|
12 installAllFiles([do_get_file("data/test_bug526598_1.xpi"), |
|
13 do_get_file("data/test_bug526598_2.xpi")], function() { |
|
14 |
|
15 restartManager(); |
|
16 |
|
17 AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org", |
|
18 "bug526598_2@tests.mozilla.org"], |
|
19 callback_soon(function([a1, a2]) { |
|
20 |
|
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()); |
|
29 |
|
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()); |
|
38 |
|
39 a1.uninstall(); |
|
40 a2.uninstall(); |
|
41 |
|
42 restartManager(); |
|
43 |
|
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); |
|
49 |
|
50 do_execute_soon(do_test_finished); |
|
51 }); |
|
52 })); |
|
53 }); |
|
54 } |