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

Unified Diff: ui/gfx/icon_util_unittest.cc

Issue 326583002: use setInfo instead of (deprecated) setConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icon_util_unittest.cc
diff --git a/ui/gfx/icon_util_unittest.cc b/ui/gfx/icon_util_unittest.cc
index 46f833b88881ccb27b6f3282666e1b8fac60209c..1e2e96297c28a2d860bff0280474f5d473bebf0d 100644
--- a/ui/gfx/icon_util_unittest.cc
+++ b/ui/gfx/icon_util_unittest.cc
@@ -172,22 +172,22 @@ TEST_F(IconUtilTest, TestBitmapToIconInvalidParameters) {
// Wrong bitmap format.
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeA8(kSmallIconWidth, kSmallIconHeight));
+ bitmap->setInfo(SkImageInfo::MakeA8(kSmallIconWidth, kSmallIconHeight));
icon = IconUtil::CreateHICONFromSkBitmap(*bitmap);
EXPECT_EQ(icon, static_cast<HICON>(NULL));
// Invalid bitmap size.
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeN32Premul(0, 0));
+ bitmap->setInfo(SkImageInfo::MakeN32Premul(0, 0));
icon = IconUtil::CreateHICONFromSkBitmap(*bitmap);
EXPECT_EQ(icon, static_cast<HICON>(NULL));
// Valid bitmap configuration but no pixels allocated.
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeN32Premul(kSmallIconWidth,
- kSmallIconHeight));
+ bitmap->setInfo(SkImageInfo::MakeN32Premul(kSmallIconWidth,
+ kSmallIconHeight));
icon = IconUtil::CreateHICONFromSkBitmap(*bitmap);
EXPECT_TRUE(icon == NULL);
}
@@ -205,10 +205,9 @@ TEST_F(IconUtilTest, TestCreateIconFileInvalidParameters) {
// Wrong bitmap format.
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeA8(kSmallIconWidth, kSmallIconHeight));
// Must allocate pixels or else ImageSkia will ignore the bitmap and just
// return an empty image.
- bitmap->allocPixels();
+ bitmap->allocPixels(SkImageInfo::MakeA8(kSmallIconWidth, kSmallIconHeight));
memset(bitmap->getPixels(), 0, bitmap->width() * bitmap->height());
image_family.Add(gfx::Image::CreateFrom1xBitmap(*bitmap));
EXPECT_FALSE(IconUtil::CreateIconFileFromImageFamily(image_family,
@@ -219,8 +218,7 @@ TEST_F(IconUtilTest, TestCreateIconFileInvalidParameters) {
image_family.clear();
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeN32Premul(0, 0));
- bitmap->allocPixels();
+ bitmap->allocPixels(SkImageInfo::MakeN32Premul(0, 0));
image_family.Add(gfx::Image::CreateFrom1xBitmap(*bitmap));
EXPECT_FALSE(IconUtil::CreateIconFileFromImageFamily(image_family,
valid_icon_filename));
@@ -230,8 +228,8 @@ TEST_F(IconUtilTest, TestCreateIconFileInvalidParameters) {
image_family.clear();
bitmap.reset(new SkBitmap);
ASSERT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
- bitmap->setConfig(SkImageInfo::MakeN32Premul(kSmallIconWidth,
- kSmallIconHeight));
+ bitmap->setInfo(SkImageInfo::MakeN32Premul(kSmallIconWidth,
+ kSmallIconHeight));
image_family.Add(gfx::Image::CreateFrom1xBitmap(*bitmap));
EXPECT_FALSE(IconUtil::CreateIconFileFromImageFamily(image_family,
valid_icon_filename));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698