Index: ui/gfx/image/image_unittest.cc |
diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc |
index 87935621c9446701bb51f2808dfa85567cefc239..51e06f440a422270d69d6ee88dc7fd27c3b93f01 100644 |
--- a/ui/gfx/image/image_unittest.cc |
+++ b/ui/gfx/image/image_unittest.cc |
@@ -2,7 +2,6 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "base/memory/scoped_ptr.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
#include "ui/gfx/image/image.h" |
@@ -68,8 +67,8 @@ TEST_F(ImageTest, SkiaToSkia) { |
} |
TEST_F(ImageTest, SkiaRefToSkia) { |
- scoped_ptr<SkBitmap> originalBitmap(gt::CreateBitmap(25, 25)); |
- gfx::Image image(*originalBitmap.get()); |
+ SkBitmap originalBitmap(gt::CreateBitmap(25, 25)); |
+ gfx::Image image(originalBitmap); |
const SkBitmap* bitmap = image.ToSkBitmap(); |
EXPECT_TRUE(bitmap); |
EXPECT_FALSE(bitmap->isNull()); |
@@ -104,7 +103,7 @@ TEST_F(ImageTest, SkiaToPlatform) { |
if (!kUsesSkiaNatively) |
EXPECT_FALSE(image.HasRepresentation(gt::GetPlatformRepresentationType())); |
- EXPECT_TRUE(gt::ToPlatformType(image)); |
+ EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image))); |
EXPECT_EQ(kRepCount, image.RepresentationCount()); |
const SkBitmap* bitmap = image.ToSkBitmap(); |
@@ -128,7 +127,7 @@ TEST_F(ImageTest, PlatformToSkia) { |
EXPECT_FALSE(bitmap->isNull()); |
EXPECT_EQ(kRepCount, image.RepresentationCount()); |
- EXPECT_TRUE(gt::ToPlatformType(image)); |
+ EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image))); |
EXPECT_EQ(kRepCount, image.RepresentationCount()); |
EXPECT_TRUE(image.HasRepresentation(gfx::Image::kImageRepSkia)); |
@@ -136,11 +135,11 @@ TEST_F(ImageTest, PlatformToSkia) { |
TEST_F(ImageTest, PlatformToPlatform) { |
gfx::Image image(gt::CreatePlatformImage()); |
- EXPECT_TRUE(gt::ToPlatformType(image)); |
+ EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image))); |
EXPECT_EQ(1U, image.RepresentationCount()); |
// Make sure double conversion doesn't happen. |
- EXPECT_TRUE(gt::ToPlatformType(image)); |
+ EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image))); |
EXPECT_EQ(1U, image.RepresentationCount()); |
EXPECT_TRUE(image.HasRepresentation(gt::GetPlatformRepresentationType())); |
@@ -221,7 +220,8 @@ TEST_F(ImageTest, SwapRepresentations) { |
image1.SwapRepresentations(&image2); |
EXPECT_EQ(bitmap2, image1.ToSkBitmap()); |
- EXPECT_EQ(platform_image, gt::ToPlatformType(image1)); |
+ EXPECT_TRUE(gt::PlatformImagesEqual(platform_image, |
+ gt::ToPlatformType(image1))); |
EXPECT_EQ(bitmap1, image2.ToSkBitmap()); |
EXPECT_EQ(kRepCount, image1.RepresentationCount()); |
EXPECT_EQ(1U, image2.RepresentationCount()); |
@@ -237,7 +237,7 @@ TEST_F(ImageTest, Copy) { |
EXPECT_EQ(1U, image2.RepresentationCount()); |
EXPECT_EQ(image1.ToSkBitmap(), image2.ToSkBitmap()); |
- EXPECT_TRUE(gt::ToPlatformType(image2)); |
+ EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image2))); |
EXPECT_EQ(kRepCount, image2.RepresentationCount()); |
EXPECT_EQ(kRepCount, image1.RepresentationCount()); |
} |
@@ -258,8 +258,8 @@ TEST_F(ImageTest, MultiResolutionSkBitmap) { |
const int height2 = 24; |
std::vector<const SkBitmap*> bitmaps; |
- bitmaps.push_back(gt::CreateBitmap(width1, height1)); |
- bitmaps.push_back(gt::CreateBitmap(width2, height2)); |
+ bitmaps.push_back(new SkBitmap(gt::CreateBitmap(width1, height1))); |
+ bitmaps.push_back(new SkBitmap(gt::CreateBitmap(width2, height2))); |
gfx::Image image(bitmaps); |
EXPECT_EQ(1u, image.RepresentationCount()); |