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

Unified Diff: skia/ext/skia_utils_mac_unittest.mm

Issue 10245003: Makes ImageSkia more like SkBitmap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comment Created 8 years, 7 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 | « skia/ext/skia_utils_mac.mm ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac_unittest.mm
diff --git a/skia/ext/skia_utils_mac_unittest.mm b/skia/ext/skia_utils_mac_unittest.mm
index 24310b014af9775186d1f0ffaa3774bbe629d2b6..1353eb6dc6ceb7d419fe4f47710e6bab030c1325 100644
--- a/skia/ext/skia_utils_mac_unittest.mm
+++ b/skia/ext/skia_utils_mac_unittest.mm
@@ -187,36 +187,16 @@ TEST_F(SkiaUtilsMacTest, FAILS_BitmapToNSImage_BlueRectangle444) {
ShapeHelper(200, 200, false, false);
}
-TEST_F(SkiaUtilsMacTest, FAILS_MultipleBitmapsToNSImage) {
- int redWidth = 10;
- int redHeight = 15;
- int blueWidth = 20;
- int blueHeight = 30;
-
- SkBitmap redBitmap(CreateSkBitmap(redWidth, redHeight, true, true));
- SkBitmap blueBitmap(CreateSkBitmap(blueWidth, blueHeight, false, true));
- std::vector<const SkBitmap*> bitmaps;
- bitmaps.push_back(&redBitmap);
- bitmaps.push_back(&blueBitmap);
-
- NSImage* image = gfx::SkBitmapsToNSImage(bitmaps);
-
- // Image size should be the same as the smallest bitmap.
- EXPECT_DOUBLE_EQ(redWidth, [image size].width);
- EXPECT_DOUBLE_EQ(redHeight, [image size].height);
-
- EXPECT_EQ(2u, [[image representations] count]);
-
- for (NSBitmapImageRep* imageRep in [image representations]) {
- bool isred = [imageRep size].width == redWidth;
- if (isred) {
- EXPECT_DOUBLE_EQ(redHeight, [imageRep size].height);
- } else {
- EXPECT_DOUBLE_EQ(blueWidth, [imageRep size].width);
- EXPECT_DOUBLE_EQ(blueHeight, [imageRep size].height);
- }
- TestImageRep(imageRep, isred);
- }
+TEST_F(SkiaUtilsMacTest, FAILS_BitmapToNSBitmapImageRep_BlueRectangle20x30) {
+ int width = 20;
+ int height = 30;
+
+ SkBitmap bitmap(CreateSkBitmap(width, height, false, true));
+ NSBitmapImageRep* imageRep = gfx::SkBitmapToNSBitmapImageRep(bitmap);
+
+ EXPECT_DOUBLE_EQ(width, [imageRep size].width);
+ EXPECT_DOUBLE_EQ(height, [imageRep size].height);
+ TestImageRep(imageRep, false);
}
TEST_F(SkiaUtilsMacTest, NSImageRepToSkBitmap) {
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698