2010-04-20 15:33:00 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
*/
|
|
|
|
|
|
|
|
// This verifies that deleting the database from the profile doesn't break
|
|
|
|
// anything
|
|
|
|
|
|
|
|
const profileDir = gProfD.clone();
|
|
|
|
profileDir.append("extensions");
|
|
|
|
|
|
|
|
function run_test() {
|
|
|
|
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
|
|
|
|
2010-09-10 15:54:37 -07:00
|
|
|
writeInstallRDFForExtension({
|
2010-04-20 15:33:00 -07:00
|
|
|
id: "addon1@tests.mozilla.org",
|
|
|
|
version: "1.0",
|
|
|
|
updateURL: "http://localhost:4444/data/test_update.rdf",
|
|
|
|
targetApplications: [{
|
|
|
|
id: "xpcshell@tests.mozilla.org",
|
|
|
|
minVersion: "1",
|
|
|
|
maxVersion: "1"
|
|
|
|
}],
|
|
|
|
name: "Test Addon 1",
|
2010-09-10 15:54:37 -07:00
|
|
|
}, profileDir);
|
2010-04-20 15:33:00 -07:00
|
|
|
|
2010-07-14 10:13:26 -07:00
|
|
|
startupManager();
|
2010-04-20 15:33:00 -07:00
|
|
|
|
2010-05-27 15:10:09 -07:00
|
|
|
do_test_pending();
|
|
|
|
|
|
|
|
run_test_1();
|
|
|
|
}
|
|
|
|
|
|
|
|
function end_test() {
|
|
|
|
do_test_finished();
|
|
|
|
}
|
|
|
|
|
|
|
|
function run_test_1() {
|
|
|
|
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
|
|
|
do_check_neq(a1, null);
|
|
|
|
do_check_eq(a1.version, "1.0");
|
|
|
|
|
|
|
|
shutdownManager();
|
|
|
|
|
|
|
|
let db = gProfD.clone();
|
|
|
|
db.append("extensions.sqlite");
|
|
|
|
db.remove(true);
|
|
|
|
|
|
|
|
check_test_1();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function check_test_1() {
|
2010-07-14 10:13:26 -07:00
|
|
|
startupManager(false);
|
2010-05-27 15:10:09 -07:00
|
|
|
|
2010-04-20 15:33:00 -07:00
|
|
|
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
|
|
|
do_check_neq(a1, null);
|
|
|
|
do_check_eq(a1.version, "1.0");
|
|
|
|
|
|
|
|
let db = gProfD.clone();
|
|
|
|
db.append("extensions.sqlite");
|
|
|
|
do_check_true(db.exists());
|
|
|
|
do_check_true(db.fileSize > 0);
|
|
|
|
|
2010-05-27 15:10:09 -07:00
|
|
|
end_test();
|
2010-04-20 15:33:00 -07:00
|
|
|
});
|
|
|
|
}
|