Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: ui/gfx/image/image_unittest.cc

Issue 340613004: Use ImageSkiaSource to create ImageSkia from ImagePNGReps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test util fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/image/image_unittest.cc
diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc
index a0fbe3e42bb137e96764bd1d3873d44a7be972b4..c5414393beb7cf67ab82452699258998b3dc8c8d 100644
--- a/ui/gfx/image/image_unittest.cc
+++ b/ui/gfx/image/image_unittest.cc
@@ -243,12 +243,22 @@ TEST_F(ImageTest, MultiResolutionPNGToImageSkia) {
scales.push_back(1.0f);
scales.push_back(2.0f);
gfx::ImageSkia image_skia = image.AsImageSkia();
- EXPECT_TRUE(gt::ImageSkiaStructureMatches(image_skia, kSize1x, kSize1x,
- scales));
EXPECT_TRUE(gt::IsEqual(bytes1x,
image_skia.GetRepresentation(1.0f).sk_bitmap()));
EXPECT_TRUE(gt::IsEqual(bytes2x,
image_skia.GetRepresentation(2.0f).sk_bitmap()));
+ EXPECT_TRUE(gt::ImageSkiaStructureMatches(image_skia, kSize1x, kSize1x,
+ scales));
+
+ gfx::ImageSkiaRep rep_1_6x = image_skia.GetRepresentation(1.6f);
+ ASSERT_FALSE(rep_1_6x.is_null());
+ ASSERT_EQ(1.6f, rep_1_6x.scale());
+ EXPECT_EQ("40x40", rep_1_6x.pixel_size().ToString());
+
+ gfx::ImageSkiaRep rep_0_8x = image_skia.GetRepresentation(0.8f);
+ ASSERT_FALSE(rep_0_8x.is_null());
+ ASSERT_EQ(0.8f, rep_0_8x.scale());
+ EXPECT_EQ("20x20", rep_0_8x.pixel_size().ToString());
}
TEST_F(ImageTest, MultiResolutionPNGToPlatform) {

Powered by Google App Engine
This is Rietveld 408576698