Bug 597620: Undoing an install doesn't work. r=robstring, a=blocks-betaN

This commit is contained in:
Dave Townsend 2010-09-28 10:28:15 -07:00
parent 36b4ab9197
commit bff9c19a35
2 changed files with 23 additions and 3 deletions

View File

@ -4288,8 +4288,14 @@ AddonInstall.prototype = {
let stagedJSON = stagedAddon.clone();
stagedAddon.append(this.addon.id);
stagedJSON.append(this.addon.id + ".json");
if (stagedAddon.exists())
if (stagedAddon.exists()) {
stagedAddon.remove(true);
}
else {
stagedAddon.leafName += ".xpi";
if (stagedAddon.exists())
stagedAddon.remove(false);
}
if (stagedJSON.exists())
stagedJSON.remove(true);
this.state = AddonManager.STATE_CANCELLED;

View File

@ -591,7 +591,14 @@ function check_test_10(install) {
AddonManager.getAllInstalls(function(activeInstalls) {
do_check_eq(activeInstalls.length, 0);
run_test_11();
restartManager();
// Check that the install did not complete
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
do_check_eq(a3, null);
run_test_11();
});
});
}
@ -934,6 +941,13 @@ function check_test_13(install) {
do_check_false(hasFlag(olda2.pendingOperations, AddonManager.PENDING_UPGRADE));
do_check_eq(olda2.pendingUpgrade, null);
end_test();
restartManager();
// Check that the upgrade did not complete
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_eq(a2.version, "2.0");
end_test();
});
});
}