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

Unified Diff: chrome/browser/history/select_favicon_frames_unittest.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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 | « chrome/browser/history/select_favicon_frames.cc ('k') | chrome/browser/profiles/profile_info_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/select_favicon_frames_unittest.cc
diff --git a/chrome/browser/history/select_favicon_frames_unittest.cc b/chrome/browser/history/select_favicon_frames_unittest.cc
index f79e773538a2d7e05a372bff4aaef0a5a2dc2e72..6936eceb66807b17882abfb65ac86fdb566ea3b3 100644
--- a/chrome/browser/history/select_favicon_frames_unittest.cc
+++ b/chrome/browser/history/select_favicon_frames_unittest.cc
@@ -43,7 +43,8 @@ SkBitmap MakeBitmap(SkColor color, int w, int h) {
SkColor GetColor(const gfx::ImageSkia& image, ui::ScaleFactor factor,
int x = -1, int y = -1) {
- const SkBitmap& bitmap = image.GetRepresentation(factor).sk_bitmap();
+ const SkBitmap& bitmap =
+ image.GetRepresentation(ui::GetImageScale(factor)).sk_bitmap();
if (x == -1)
x = bitmap.width() / 2;
if (y == -1)
@@ -71,7 +72,7 @@ TEST(SelectFaviconFramesTest, ZeroSizePicksLargest) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x(), 0, NULL);
EXPECT_EQ(1u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
EXPECT_EQ(48, image.width());
EXPECT_EQ(48, image.height());
@@ -87,7 +88,7 @@ TEST(SelectFaviconFramesTest, _16From16) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x(), 16, NULL);
EXPECT_EQ(1u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
EXPECT_EQ(16, image.width());
EXPECT_EQ(16, image.height());
EXPECT_EQ(SK_ColorGREEN, GetColor1x(image));
@@ -102,7 +103,7 @@ TEST(SelectFaviconFramesTest, _16From17) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x(), 16, NULL);
EXPECT_EQ(1u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
EXPECT_EQ(16, image.width());
EXPECT_EQ(16, image.height());
EXPECT_EQ(SK_ColorGREEN, GetColor1x(image));
@@ -118,7 +119,7 @@ TEST(SelectFaviconFramesTest, _16From15) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x(), 16, NULL);
EXPECT_EQ(1u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
EXPECT_EQ(16, image.width());
EXPECT_EQ(16, image.height());
EXPECT_EQ(SK_ColorGREEN, GetColor1x(image));
@@ -131,8 +132,8 @@ TEST(SelectFaviconFramesTest, _16From16_Scale2x_32_From_16) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x2x(), 16, NULL);
EXPECT_EQ(2u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_200P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
+ ASSERT_TRUE(image.HasRepresentation(2.0f));
EXPECT_EQ(16, image.width());
EXPECT_EQ(16, image.height());
EXPECT_EQ(SK_ColorGREEN, GetColor1x(image));
@@ -147,8 +148,8 @@ TEST(SelectFaviconFramesTest, _16From16_Scale2x_32_From_32) {
gfx::ImageSkia image = SelectFaviconFrames(bitmaps,
SizesFromBitmaps(bitmaps), Scale1x2x(), 16, NULL);
EXPECT_EQ(2u, image.image_reps().size());
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_100P));
- ASSERT_TRUE(image.HasRepresentation(ui::SCALE_FACTOR_200P));
+ ASSERT_TRUE(image.HasRepresentation(1.0f));
+ ASSERT_TRUE(image.HasRepresentation(2.0f));
EXPECT_EQ(16, image.width());
EXPECT_EQ(16, image.height());
EXPECT_EQ(SK_ColorGREEN, GetColor1x(image));
« no previous file with comments | « chrome/browser/history/select_favicon_frames.cc ('k') | chrome/browser/profiles/profile_info_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698