From 5c724c315cf02584662adfcdf034a60ad2d2e551 Mon Sep 17 00:00:00 2001 From: "noyau@chromium.org" Date: Tue, 11 Dec 2012 19:14:57 +0000 Subject: [PATCH] Fix a unittest failing on iOS retina devices. iOS retina devices are the only chrome supported platform without support for 100p images in the platform representation of skia image. This test was assuming 100p was always preserved during convertion from one format to the next. BUG=None Review URL: https://chromiumcodereview.appspot.com/11458006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172369 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/image/image_unittest.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc index 0ed783f5230d..faf8361864d0 100644 --- a/ui/gfx/image/image_unittest.cc +++ b/ui/gfx/image/image_unittest.cc @@ -278,12 +278,14 @@ TEST_F(ImageTest, PlatformToPNGEncodeAndDecode) { // sure these work with the Skia Encode/Decode. TEST_F(ImageTest, PNGEncodeFromSkiaDecodeToPlatform) { // Force the conversion sequence skia to png to platform_type. + ui::ScaleFactor ideal_scale_factor = ui::GetScaleFactorFromScale(1.0f); + gfx::Image from_skia(gt::CreateBitmap(25, 25)); scoped_refptr png_bytes = from_skia.As1xPNGBytes(); std::vector image_png_reps; - image_png_reps.push_back(gfx::ImagePNGRep(png_bytes, ui::SCALE_FACTOR_100P)); + image_png_reps.push_back(gfx::ImagePNGRep(png_bytes, ideal_scale_factor)); gfx::Image from_png(image_png_reps); gfx::Image from_platform(gt::CopyPlatformType(from_png)); -- 2.11.4.GIT