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

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: Rename methods and vars to make image_scale more clear 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
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 562ade13b54575e7b517f7f986d2b3b1091ea0bc..27ae93134db63dd2977e0bdcc71c7b1f3725f78d 100644
--- a/chrome/browser/history/select_favicon_frames_unittest.cc
+++ b/chrome/browser/history/select_favicon_frames_unittest.cc
@@ -35,7 +35,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)
@@ -62,7 +63,7 @@ TEST(SelectFaviconFramesTest, ZeroSizePicksLargest) {
gfx::ImageSkia image = SelectFaviconFrames(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());
@@ -77,7 +78,7 @@ TEST(SelectFaviconFramesTest, _16From16) {
gfx::ImageSkia image = SelectFaviconFrames(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));
@@ -91,7 +92,7 @@ TEST(SelectFaviconFramesTest, _16From17) {
// Should resample from the bigger candidate.
gfx::ImageSkia image = SelectFaviconFrames(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));
@@ -106,7 +107,7 @@ TEST(SelectFaviconFramesTest, _16From15) {
// candidate.
gfx::ImageSkia image = SelectFaviconFrames(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,8 +119,8 @@ TEST(SelectFaviconFramesTest, _16From16_Scale2x_32_From_16) {
gfx::ImageSkia image = SelectFaviconFrames(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));
@@ -133,8 +134,8 @@ TEST(SelectFaviconFramesTest, _16From16_Scale2x_32_From_32) {
gfx::ImageSkia image = SelectFaviconFrames(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));

Powered by Google App Engine
This is Rietveld 408576698