Bug 1225944 - Allow reinstalling temp add-ons. r=Mossop

MozReview-Commit-ID: JTbCaKGJ7wW
This commit is contained in:
J. Ryan Stinnett 2016-02-19 21:21:19 -06:00
parent 9e390d3655
commit 63103c689d
2 changed files with 2 additions and 15 deletions

View File

@ -3822,12 +3822,7 @@ this.XPIProvider = {
let oldAddon = yield new Promise(
resolve => XPIDatabase.getVisibleAddonForID(addon.id, resolve));
if (oldAddon) {
if (oldAddon.location == KEY_APP_TEMPORARY) {
logger.warn("temporary add-on already installed:", addon.id);
throw new Error("Add-on with ID " + oldAddon.id + " is already"
+ " temporarily installed");
}
else if (!oldAddon.bootstrap) {
if (!oldAddon.bootstrap) {
logger.warn("Non-restartless Add-on is already installed", addon.id);
throw new Error("Non-restartless add-on with ID "
+ oldAddon.id + " is already installed");

View File

@ -425,15 +425,7 @@ add_task(function*() {
do_check_eq(addon.type, "extension");
do_check_eq(addon.signedState, mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_SIGNED : AddonManager.SIGNEDSTATE_NOT_REQUIRED);
try {
yield AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
do_throw("Installing a temporary second temporary add-on should return"
+ " a rejected promise");
} catch (err) {
do_check_eq(err.message,
"Add-on with ID bootstrap1@tests.mozilla.org is already temporarily"
+ " installed");
}
yield AddonManager.installTemporaryAddon(do_get_addon("test_bootstrap1_1"));
BootstrapMonitor.checkAddonInstalled(ID, "1.0");
BootstrapMonitor.checkAddonStarted(ID, "1.0");