| Index: ui/gfx/image/image_unittest.cc
|
| diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc
|
| index c0b2489b8798dba861f6206cfb3cc1d011e71c89..0ad95ae5da7c5eeabb82667e5d088ed1a7284909 100644
|
| --- a/ui/gfx/image/image_unittest.cc
|
| +++ b/ui/gfx/image/image_unittest.cc
|
| @@ -176,16 +176,12 @@ TEST_F(ImageTest, PNGDecodeToSkiaFailure) {
|
| gt::CheckColor(bitmap->getColor(10, 10), true);
|
| }
|
|
|
| -// TODO(rohitrao): This test needs an iOS implementation of
|
| -// GetPlatformImageColor().
|
| -#if !defined(OS_IOS)
|
| TEST_F(ImageTest, PNGDecodeToPlatformFailure) {
|
| std::vector<unsigned char> png(100, 0);
|
| gfx::Image image(&png.front(), png.size());
|
| gt::CheckColor(gt::GetPlatformImageColor(gt::ToPlatformType(image), 10, 10),
|
| true);
|
| }
|
| -#endif
|
|
|
| TEST_F(ImageTest, SkiaToPlatform) {
|
| gfx::Image image(gt::CreateBitmap(25, 25));
|
| @@ -308,9 +304,6 @@ TEST_F(ImageTest, CheckSkiaColor) {
|
| gt::CheckColor(bitmap->getColor(10, 10), false);
|
| }
|
|
|
| -// TODO(rohitrao): This test needs an iOS implementation of
|
| -// GetPlatformImageColor().
|
| -#if !defined(OS_IOS)
|
| TEST_F(ImageTest, SkBitmapConversionPreservesOrientation) {
|
| const int width = 50;
|
| const int height = 50;
|
| @@ -324,27 +317,35 @@ TEST_F(ImageTest, SkBitmapConversionPreservesOrientation) {
|
| SkPaint red;
|
| red.setColor(SK_ColorRED);
|
| canvas.drawRect(SkRect::MakeWH(width, height / 2), red);
|
| - gt::CheckColor(bitmap.getColor(10, 10), true);
|
| - gt::CheckColor(bitmap.getColor(10, 40), false);
|
| + {
|
| + SCOPED_TRACE("Checking color of the initial SkBitmap");
|
| + gt::CheckColor(bitmap.getColor(10, 10), true);
|
| + gt::CheckColor(bitmap.getColor(10, 40), false);
|
| + }
|
|
|
| // Convert from SkBitmap to a platform representation, then check the upper
|
| // half of the platform image to make sure it is red, not green.
|
| gfx::Image from_skbitmap(bitmap);
|
| - gt::CheckColor(
|
| - gt::GetPlatformImageColor(gt::ToPlatformType(from_skbitmap), 10, 10),
|
| - true);
|
| - gt::CheckColor(
|
| - gt::GetPlatformImageColor(gt::ToPlatformType(from_skbitmap), 10, 40),
|
| - false);
|
| + {
|
| + SCOPED_TRACE("Checking color of the platform image");
|
| + gt::CheckColor(
|
| + gt::GetPlatformImageColor(gt::ToPlatformType(from_skbitmap), 10, 10),
|
| + true);
|
| + gt::CheckColor(
|
| + gt::GetPlatformImageColor(gt::ToPlatformType(from_skbitmap), 10, 40),
|
| + false);
|
| + }
|
|
|
| // Force a conversion back to SkBitmap and check that the upper half is red.
|
| gfx::Image from_platform(gt::CopyPlatformType(from_skbitmap));
|
| const SkBitmap* bitmap2 = from_platform.ToSkBitmap();
|
| SkAutoLockPixels auto_lock(*bitmap2);
|
| - gt::CheckColor(bitmap2->getColor(10, 10), true);
|
| - gt::CheckColor(bitmap2->getColor(10, 40), false);
|
| + {
|
| + SCOPED_TRACE("Checking color after conversion back to SkBitmap");
|
| + gt::CheckColor(bitmap2->getColor(10, 10), true);
|
| + gt::CheckColor(bitmap2->getColor(10, 40), false);
|
| + }
|
| }
|
| -#endif // !defined(OS_IOS)
|
|
|
| TEST_F(ImageTest, SwapRepresentations) {
|
| const size_t kRepCount = kUsesSkiaNatively ? 1U : 2U;
|
|
|