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

Unified Diff: ui/gfx/image/image_unittest.cc

Issue 10332163: Revert 137075 - Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | « ui/gfx/image/image.cc ('k') | ui/gfx/image/image_unittest_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_unittest.cc
===================================================================
--- ui/gfx/image/image_unittest.cc (revision 137075)
+++ ui/gfx/image/image_unittest.cc (working copy)
@@ -2,6 +2,7 @@
// 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"
@@ -67,8 +68,8 @@
}
TEST_F(ImageTest, SkiaRefToSkia) {
- SkBitmap originalBitmap(gt::CreateBitmap(25, 25));
- gfx::Image image(originalBitmap);
+ scoped_ptr<SkBitmap> originalBitmap(gt::CreateBitmap(25, 25));
+ gfx::Image image(*originalBitmap.get());
const SkBitmap* bitmap = image.ToSkBitmap();
EXPECT_TRUE(bitmap);
EXPECT_FALSE(bitmap->isNull());
@@ -103,7 +104,7 @@
if (!kUsesSkiaNatively)
EXPECT_FALSE(image.HasRepresentation(gt::GetPlatformRepresentationType()));
- EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image)));
+ EXPECT_TRUE(gt::ToPlatformType(image));
EXPECT_EQ(kRepCount, image.RepresentationCount());
const SkBitmap* bitmap = image.ToSkBitmap();
@@ -127,7 +128,7 @@
EXPECT_FALSE(bitmap->isNull());
EXPECT_EQ(kRepCount, image.RepresentationCount());
- EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image)));
+ EXPECT_TRUE(gt::ToPlatformType(image));
EXPECT_EQ(kRepCount, image.RepresentationCount());
EXPECT_TRUE(image.HasRepresentation(gfx::Image::kImageRepSkia));
@@ -135,11 +136,11 @@
TEST_F(ImageTest, PlatformToPlatform) {
gfx::Image image(gt::CreatePlatformImage());
- EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image)));
+ EXPECT_TRUE(gt::ToPlatformType(image));
EXPECT_EQ(1U, image.RepresentationCount());
// Make sure double conversion doesn't happen.
- EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image)));
+ EXPECT_TRUE(gt::ToPlatformType(image));
EXPECT_EQ(1U, image.RepresentationCount());
EXPECT_TRUE(image.HasRepresentation(gt::GetPlatformRepresentationType()));
@@ -220,8 +221,7 @@
image1.SwapRepresentations(&image2);
EXPECT_EQ(bitmap2, image1.ToSkBitmap());
- EXPECT_TRUE(gt::PlatformImagesEqual(platform_image,
- gt::ToPlatformType(image1)));
+ EXPECT_EQ(platform_image, gt::ToPlatformType(image1));
EXPECT_EQ(bitmap1, image2.ToSkBitmap());
EXPECT_EQ(kRepCount, image1.RepresentationCount());
EXPECT_EQ(1U, image2.RepresentationCount());
@@ -237,7 +237,7 @@
EXPECT_EQ(1U, image2.RepresentationCount());
EXPECT_EQ(image1.ToSkBitmap(), image2.ToSkBitmap());
- EXPECT_TRUE(gt::IsPlatformImageValid(gt::ToPlatformType(image2)));
+ EXPECT_TRUE(gt::ToPlatformType(image2));
EXPECT_EQ(kRepCount, image2.RepresentationCount());
EXPECT_EQ(kRepCount, image1.RepresentationCount());
}
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/gfx/image/image_unittest_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698