Bug 593217 - Detail view always shows full screenshot, not thumbnail. r=bmcbride, a=blocking-beta6
authorDave Townsend <dtownsend@mozilla.com>
Mon, 06 Sep 2010 19:00:47 +1200
changeset 52070 1376f2e60e6bd4583c14176cfec60619c5380a54
parent 52069 f032fd9b166bb55844ab776c8a1bc2e21490d6fd
child 52071 cda6a4cf9839872f87fbe6b74fcb12267955aff2
push idunknown
push userunknown
push dateunknown
reviewersbmcbride, blocking-beta6
bugs593217
milestone2.0b6pre
Bug 593217 - Detail view always shows full screenshot, not thumbnail. r=bmcbride, a=blocking-beta6
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_details.js
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1722,18 +1722,18 @@ var gDetailView = {
       version.hidden = false;
       version.value = aAddon.version;
     } else {
       version.hidden = true;
     }
 
     var screenshot = document.getElementById("detail-screenshot");
     if (aAddon.screenshots && aAddon.screenshots.length > 0) {
-      if (aAddon.screenshots[0].thumbnail)
-        screenshot.src = aAddon.screenshots[0].thumbnail;
+      if (aAddon.screenshots[0].thumbnailURL)
+        screenshot.src = aAddon.screenshots[0].thumbnailURL;
       else
         screenshot.src = aAddon.screenshots[0].url;
       screenshot.hidden = false;
     } else {
       screenshot.hidden = true;
     }
 
     var desc = document.getElementById("detail-desc");
--- a/toolkit/mozapps/extensions/test/browser/browser_details.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_details.js
@@ -85,17 +85,21 @@ function test() {
     reviewCount: 1,
     reviewURL: "http://example.com/reviews",
     applyBackgroundUpdates: false,
     isActive: false,
     isCompatible: false,
     appDisabled: true,
     permissions: AddonManager.PERM_CAN_ENABLE |
                  AddonManager.PERM_CAN_DISABLE |
-                 AddonManager.PERM_CAN_UPGRADE
+                 AddonManager.PERM_CAN_UPGRADE,
+    screenshots: [{
+      url: "http://example.com/screenshot",
+      thumbnailURL: "http://example.com/thumbnail"
+    }],
   }, {
     id: "addon4@tests.mozilla.org",
     name: "Test add-on 4",
     _userDisabled: true,
     isActive: false,
     blocklistState: Ci.nsIBlocklistService.STATE_SOFTBLOCKED
   }, {
     id: "addon5@tests.mozilla.org",
@@ -238,17 +242,17 @@ add_test(function() {
     is(get("detail-icon").src, "chrome://foo/skin/icon.png", "Icon should be correct");
 
     is_element_visible(get("detail-creator"), "Creator should not be hidden");
     is_element_visible(get("detail-creator")._creatorName, "Creator name should not be hidden");
     is(get("detail-creator")._creatorName.value, "Mozilla", "Creator should be correct");
     is_element_hidden(get("detail-creator")._creatorLink, "Creator link should be hidden");
 
     is_element_visible(get("detail-screenshot"), "Screenshot should be visible");
-    ok(get("detail-screenshot").src, "http://example.com/screenshot");
+    is(get("detail-screenshot").src, "http://example.com/screenshot", "Should be showing the full sized screenshot");
     is(get("detail-desc").textContent, "Short description", "Description should be correct");
 
     is_element_hidden(get("detail-contributions"), "Contributions section should be hidden");
 
     is_element_visible(get("detail-dateUpdated"), "Update date should not be hidden");
     is(Date.parse(get("detail-dateUpdated").value), gDate.getTime(), "Update date should be correct");
 
     is_element_hidden(get("detail-rating-row"), "Rating should be hidden");
@@ -285,17 +289,18 @@ add_test(function() {
     is(get("detail-icon").src, "", "Icon should be correct");
 
     is_element_visible(get("detail-creator"), "Creator should not be hidden");
     is_element_hidden(get("detail-creator")._creatorName, "Creator name should be hidden");
     is_element_visible(get("detail-creator")._creatorLink, "Creator link should not be hidden");
     is(get("detail-creator")._creatorLink.value, "Mozilla", "Creator link should be correct");
     is(get("detail-creator")._creatorLink.href, "http://www.mozilla.org", "Creator link href should be correct");
 
-    is_element_hidden(get("detail-screenshot"), "Screenshot should not be visible");
+    is_element_visible(get("detail-screenshot"), "Screenshot should be visible");
+    is(get("detail-screenshot").src, "http://example.com/thumbnail", "Should be showing the thumbnail");
 
     is_element_hidden(get("detail-contributions"), "Contributions section should be hidden");
 
     is_element_visible(get("detail-dateUpdated"), "Update date should not be hidden");
     is(Date.parse(get("detail-dateUpdated").value), gDate.getTime(), "Update date should be correct");
 
     is_element_visible(get("detail-rating-row"), "Rating row should not be hidden");
     is_element_hidden(get("detail-rating"), "Rating should be hidden");