Chromium Code Reviews| Index: ui/gfx/image/image_unittest.cc |
| diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc |
| index 93a8b612c0095ca24acd5d2ee1b84614532986ad..ff28226ed349fae17755ed3515304148c21a51a7 100644 |
| --- a/ui/gfx/image/image_unittest.cc |
| +++ b/ui/gfx/image/image_unittest.cc |
| @@ -194,13 +194,20 @@ TEST_F(ImageTest, SkiaToCocoaCopy) { |
| } |
| #endif |
| +inline uint32_t SetPackedColor(uint8_t a, uint8_t r, uint8_t g, uint8_t b) { |
|
sky
2012/08/02 21:02:00
There are functions in skia for creating a color f
|
| + // Pack colors according to the order of alpha and rgb |
| + return (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) | |
| + (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT); |
| +} |
| + |
| TEST_F(ImageTest, CheckSkiaColor) { |
| gfx::Image image(gt::CreatePlatformImage()); |
| const SkBitmap* bitmap = image.ToSkBitmap(); |
| SkAutoLockPixels auto_lock(*bitmap); |
| uint32_t* pixel = bitmap->getAddr32(10, 10); |
| - EXPECT_EQ(SK_ColorRED, *pixel); |
| + // Expect the red color |
| + EXPECT_EQ(SetPackedColor(0xFF, 0xFF, 0x00, 0x00), *pixel); |
| } |
| TEST_F(ImageTest, SwapRepresentations) { |