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

Unified Diff: ui/gfx/image/image_mac_unittest.mm

Issue 10086023: Expose array of bitmaps contained by gfx::Image similar to NSImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 8 years, 8 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') | ui/gfx/image/image_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_mac_unittest.mm
diff --git a/ui/gfx/image/image_mac_unittest.mm b/ui/gfx/image/image_mac_unittest.mm
index 0affe373406e657d846a3baa4cf2160234dc295c..1ac5d391844c46df34f04878de2f148453ccb907 100644
--- a/ui/gfx/image/image_mac_unittest.mm
+++ b/ui/gfx/image/image_mac_unittest.mm
@@ -9,6 +9,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_unittest_util.h"
namespace {
@@ -48,11 +49,12 @@ TEST_F(ImageMacTest, MultiResolutionNSImageToSkBitmap) {
gfx::Image image(ns_image.release());
EXPECT_EQ(1u, image.RepresentationCount());
- EXPECT_EQ(2u, image.GetNumberOfSkBitmaps());
+ const std::vector<const SkBitmap*>& bitmaps = image.ToImageSkia()->bitmaps();
+ EXPECT_EQ(2u, bitmaps.size());
- const SkBitmap* bitmap1 = image.GetSkBitmapAtIndex(0);
+ const SkBitmap* bitmap1 = bitmaps[0];
EXPECT_TRUE(bitmap1);
- const SkBitmap* bitmap2 = image.GetSkBitmapAtIndex(1);
+ const SkBitmap* bitmap2 = bitmaps[1];
EXPECT_TRUE(bitmap2);
if (bitmap1->width() == width1) {
@@ -66,8 +68,7 @@ TEST_F(ImageMacTest, MultiResolutionNSImageToSkBitmap) {
EXPECT_EQ(bitmap2->height(), height1);
}
- // GetNumberOfSkBitmaps and GetSkBitmapAtIndex should create a second
- // representation.
+ // ToImageSkia should create a second representation.
EXPECT_EQ(2u, image.RepresentationCount());
}
@@ -83,7 +84,7 @@ TEST_F(ImageMacTest, MultiResolutionSkBitmapToNSImage) {
gfx::Image image(bitmaps);
EXPECT_EQ(1u, image.RepresentationCount());
- EXPECT_EQ(2u, image.GetNumberOfSkBitmaps());
+ EXPECT_EQ(2u, image.ToImageSkia()->bitmaps().size());
NSImage* ns_image = image;
EXPECT_TRUE(ns_image);
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/gfx/image/image_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698