[Suggestions] Take minimum dimension when checking retrieved image size

Desktop / Chromium - galinap [google.com] - 13 July 2017 13:13 EDT

The thumbnail returned from a ThumbnailProvider may have one dimension larger than the requested thumbnail size. Therefore, the assertion in onThumbnailRetreived() should be using the smaller of the two sides to check that the condition is met, instead of using its height arbitrarily.

Bug: 715477 Change-Id: I6e60c41dad1014508343f2338ad81140d577f08b Reviewed-on: https://chromium-review.googlesource.com/541323

91f155e [Suggestions] Take minimum dimension when checking retrieved image size
.../browser/download/ui/ThumbnailProviderImpl.java | 25 ++-
chrome/android/java_sources.gni | 1 +
.../download/ui/ThumbnailProviderImplTest.java | 225 +++++++++++++++++++++
.../thumbnail_provider/test_image_10x10.jpg | Bin 0 -> 400 bytes
.../thumbnail_provider/test_image_10x20.jpg | Bin 0 -> 417 bytes
.../thumbnail_provider/test_image_20x10.jpg | Bin 0 -> 419 bytes
.../thumbnail_provider/test_image_20x20.jpg | Bin 0 -> 444 bytes
7 files changed, 249 insertions(+), 2 deletions(-)

Upstream: git.chromium.org


  • Share