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: function run_test() { michael@0: do_test_pending(); michael@0: createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); michael@0: michael@0: startupManager(); michael@0: michael@0: installAllFiles([do_get_file("data/test_bug526598_1.xpi"), michael@0: do_get_file("data/test_bug526598_2.xpi")], function() { michael@0: michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org", michael@0: "bug526598_2@tests.mozilla.org"], michael@0: callback_soon(function([a1, a2]) { michael@0: michael@0: do_check_neq(a1, null); michael@0: do_check_true(a1.hasResource("install.rdf")); michael@0: let uri = a1.getResourceURI("install.rdf"); michael@0: do_check_true(uri instanceof AM_Ci.nsIFileURL); michael@0: let file = uri.file; michael@0: do_check_true(file.exists()); michael@0: do_check_true(file.isReadable()); michael@0: do_check_true(file.isWritable()); michael@0: michael@0: do_check_neq(a2, null); michael@0: do_check_true(a2.hasResource("install.rdf")); michael@0: uri = a2.getResourceURI("install.rdf"); michael@0: do_check_true(uri instanceof AM_Ci.nsIFileURL); michael@0: file = uri.file; michael@0: do_check_true(file.exists()); michael@0: do_check_true(file.isReadable()); michael@0: do_check_true(file.isWritable()); michael@0: michael@0: a1.uninstall(); michael@0: a2.uninstall(); michael@0: michael@0: restartManager(); michael@0: michael@0: AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org", michael@0: "bug526598_2@tests.mozilla.org"], michael@0: function([newa1, newa2]) { michael@0: do_check_eq(newa1, null); michael@0: do_check_eq(newa2, null); michael@0: michael@0: do_execute_soon(do_test_finished); michael@0: }); michael@0: })); michael@0: }); michael@0: }