Bug 594551: Update shows as incompatible in the available updates pane when the installed version is incompatible. r=Unfocused, a=blocks-final

This commit is contained in:
Dave Townsend 2010-10-06 10:18:38 -07:00
parent 27a432d4a3
commit c829a069e1
2 changed files with 10 additions and 4 deletions

View File

@ -1084,7 +1084,9 @@
} else {
this.removeAttribute("pending");
if (this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
var isUpgrade = this.hasAttribute("upgrade");
if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
this.setAttribute("notification", "error");
this._error.textContent = gStrings.ext.formatStringFromName(
"notification.blocked",
@ -1093,14 +1095,14 @@
this._errorLink.value = gStrings.ext.GetStringFromName("notification.blocked.link");
this._errorLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
this._errorLink.hidden = false;
} else if (!this.mAddon.isCompatible) {
} else if (!isUpgrade && !this.mAddon.isCompatible) {
this.setAttribute("notification", "warning");
this._warning.textContent = gStrings.ext.formatStringFromName(
"notification.incompatible",
[this.mAddon.name, gStrings.brandShortName, gStrings.appVersion], 3
);
this._warningLink.hidden = true;
} else if (this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
} else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
this.setAttribute("notification", "warning");
this._warning.textContent = gStrings.ext.formatStringFromName(
"notification.softblocked",
@ -1109,7 +1111,7 @@
this._warningLink.value = gStrings.ext.GetStringFromName("notification.softblocked.link");
this._warningLink.href = Services.urlFormatter.formatURLPref("extensions.blocklist.detailsURL");
this._warningLink.hidden = false;
} else if (this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
} else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
this.setAttribute("notification", "warning");
this._warning.textContent = gStrings.ext.formatStringFromName(
"notification.outdated",

View File

@ -43,6 +43,8 @@ add_test(function() {
id: "addon2@tests.mozilla.org",
name: "manually updating addon",
version: "1.0",
isCompatible: false,
blocklistState: Ci.nsIBlocklistService.STATE_BLOCKED,
applyBackgroundUpdates: AddonManager.AUTOUPDATE_DISABLE
}]);
@ -115,6 +117,8 @@ add_test(function() {
is_element_visible(postfix, "'Update' postfix should be visible");
is_element_visible(item._updateAvailable, "");
is_element_visible(item._relNotesToggle, "Release notes toggle should be visible");
is_element_hidden(item._warning, "Incompatible warning should be hidden");
is_element_hidden(item._error, "Blocklist error should be hidden");
info("Opening release notes");
item.addEventListener("RelNotesToggle", function() {