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

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

Issue 9455062: Add gfx::Image::Image(const SkBitmap&) constructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « ui/gfx/image/image.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_unittest.cc
diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc
index 6cc622a0bd0e4c4c9ff44f860224fe1460fa1138..42c4ad3c2b843b153da41e025821c115844bf6f1 100644
--- a/ui/gfx/image/image_unittest.cc
+++ b/ui/gfx/image/image_unittest.cc
@@ -66,6 +66,18 @@ TEST_F(ImageTest, SkiaToSkia) {
EXPECT_FALSE(image.HasRepresentation(gt::GetPlatformRepresentationType()));
}
+TEST_F(ImageTest, SkiaRefToSkia) {
+ gfx::Image image(*gt::CreateBitmap(25, 25));
+ const SkBitmap* bitmap = image.ToSkBitmap();
+ EXPECT_TRUE(bitmap);
+ EXPECT_FALSE(bitmap->isNull());
+ EXPECT_EQ(1U, image.RepresentationCount());
+
+ EXPECT_EQ(bitmap, image.ToSkBitmap());
+ if (!kUsesSkiaNatively)
+ EXPECT_FALSE(image.HasRepresentation(gt::GetPlatformRepresentationType()));
+}
+
TEST_F(ImageTest, SkiaToSkiaRef) {
gfx::Image image(gt::CreateBitmap(25, 25));
« no previous file with comments | « ui/gfx/image/image.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698