Bug 594554: When an update is available the extensions list shows the updated version rather than the current version. r=Unfocused, a=blocks-final
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 06 Oct 2010 10:17:37 -0700
changeset 54981 e32f2d1a0ea1071f37ed83b43eb2f06e6cd03a92
parent 54980 847aca956ecac57abf6dcf7405c3446fe74c629a
child 54982 7b0845a3717d8cb0a199956b78ae821b9eb91db2
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersUnfocused, blocks-final
bugs594554
milestone2.0b8pre
Bug 594554: When an update is available the extensions list shows the updated version rather than the current version. r=Unfocused, a=blocks-final
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -1159,17 +1159,19 @@
           var showProgress = this.mAddon.install &&
                              this.mAddon.install.state != AddonManager.STATE_INSTALLED;
           this._showStatus(showProgress ? "progress" : "none");
         ]]></body>
       </method>
 
       <method name="_updateUpgradeInfo">
         <body><![CDATA[
-          this._version.value = this.mManualUpdate.version;
+          // Only update the version string if we're displaying the upgrade info
+          if (this.hasAttribute("upgrade"))
+            this._version.value = this.mManualUpdate.version;
         ]]></body>
       </method>
 
       <method name="_fetchReleaseNotes">
         <parameter name="aURI"/>
         <body><![CDATA[
           var self = this;
           if (!aURI || this._relNotesLoaded) {
--- a/toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
@@ -65,23 +65,28 @@ add_test(function() {
 
 
 add_test(function() {
   gAvailableCategory.addEventListener("CategoryBadgeUpdated", function() {
     gAvailableCategory.removeEventListener("CategoryBadgeUpdated", arguments.callee, false);
     is(gAvailableCategory.badgeCount, 1, "Badge for Available Updates should now be 1");
     run_next_test();
   }, false);
-  
-  gProvider.createInstalls([{
-    name: "manually updating addon (new and improved!)",
-    existingAddon: gProvider.addons[1],
-    version: "1.1",
-    releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml", null, null)
-  }]);
+
+  gCategoryUtilities.openType("extension", function() {
+    gProvider.createInstalls([{
+      name: "manually updating addon (new and improved!)",
+      existingAddon: gProvider.addons[1],
+      version: "1.1",
+      releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml", null, null)
+    }]);
+
+    var item = get_addon_element(gManagerWindow, "addon2@tests.mozilla.org");
+    is(item._version.value, "1.0", "Should still show the old version in the normal list");
+  });
 });
 
 
 add_test(function() {
   wait_for_view_load(gManagerWindow, function() {
     is(gManagerWindow.document.getElementById("categories").selectedItem.value, "addons://updates/available", "Available Updates category should now be selected");
     is(gManagerWindow.gViewController.currentViewId, "addons://updates/available", "Available Updates view should be the current view");
     run_next_test();