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
Родитель a6fd9010b2
Коммит 626606e4c4
2 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -591,8 +591,15 @@ function check_test_10(install) {
AddonManager.getAllInstalls(function(activeInstalls) {
do_check_eq(activeInstalls.length, 0);
restartManager();
// Check that the install did not complete
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
do_check_eq(a3, null);
run_test_11();
});
});
}
// Tests that a multi-package install shows up as multiple installs with the
@ -934,6 +941,13 @@ function check_test_13(install) {
do_check_false(hasFlag(olda2.pendingOperations, AddonManager.PENDING_UPGRADE));
do_check_eq(olda2.pendingUpgrade, null);
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();
});
});
}