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

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

Issue 1038523006: Set FixedSource image unscaled in ImageSkiaTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia_unittest.cc
diff --git a/ui/gfx/image/image_skia_unittest.cc b/ui/gfx/image/image_skia_unittest.cc
index 49348e23c095f80ea3bcf99023f7cdad7a65876b..7f87202de5a392a1337c362b1c6ba5ddaf0fc23d 100644
--- a/ui/gfx/image/image_skia_unittest.cc
+++ b/ui/gfx/image/image_skia_unittest.cc
@@ -158,7 +158,7 @@ class ImageSkiaTest : public testing::Test {
};
TEST_F(ImageSkiaTest, FixedSource) {
- ImageSkiaRep image(Size(100, 200), 1.0f);
+ ImageSkiaRep image(Size(100, 200), 0.0f);
ImageSkia image_skia(new FixedSource(image), Size(100, 200));
EXPECT_EQ(0U, image_skia.image_reps().size());
@@ -177,10 +177,20 @@ TEST_F(ImageSkiaTest, FixedSource) {
EXPECT_EQ(1.0f, result_200p.scale());
EXPECT_EQ(1U, image_skia.image_reps().size());
+ const ImageSkiaRep& result_300p = image_skia.GetRepresentation(3.0f);
+
+ EXPECT_EQ(100, result_300p.GetWidth());
+ EXPECT_EQ(200, result_300p.GetHeight());
+ EXPECT_EQ(100, result_300p.pixel_width());
+ EXPECT_EQ(200, result_300p.pixel_height());
+ EXPECT_EQ(1.0f, result_300p.scale());
+ EXPECT_EQ(1U, image_skia.image_reps().size());
+
// Get the representation again and make sure it doesn't
// generate new image skia rep.
image_skia.GetRepresentation(1.0f);
image_skia.GetRepresentation(2.0f);
+ image_skia.GetRepresentation(3.0f);
EXPECT_EQ(1U, image_skia.image_reps().size());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698