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

Unified Diff: ui/gfx/font_unittest.cc

Issue 138013004: Clean-up: Renames gfx::Font's methods and removes its obsolete methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unused methods in PlatformFont. Created 6 years, 10 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/font_list_unittest.cc ('k') | ui/gfx/platform_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_unittest.cc
diff --git a/ui/gfx/font_unittest.cc b/ui/gfx/font_unittest.cc
index 32216d61fbed1a766e3873027861fcd0006c49a7..918873588f04158bbf0f7260949cc1adb8d6471c 100644
--- a/ui/gfx/font_unittest.cc
+++ b/ui/gfx/font_unittest.cc
@@ -15,8 +15,6 @@
#include "ui/gfx/platform_font_win.h"
#endif
-using base::ASCIIToUTF16;
-
namespace gfx {
namespace {
@@ -72,7 +70,7 @@ TEST_F(FontTest, LoadArial) {
TEST_F(FontTest, LoadArialBold) {
Font cf("Arial", 16);
- Font bold(cf.DeriveFont(0, Font::BOLD));
+ Font bold(cf.Derive(0, Font::BOLD));
NativeFont native = bold.GetNativeFont();
EXPECT_TRUE(native);
EXPECT_EQ(bold.GetStyle(), Font::BOLD);
@@ -108,22 +106,6 @@ TEST_F(FontTest, AvgWidths) {
EXPECT_GT(cf.GetExpectedTextWidth(3), cf.GetExpectedTextWidth(2));
}
-TEST_F(FontTest, AvgCharWidth) {
- Font cf("Arial", 16);
- EXPECT_GT(cf.GetAverageCharacterWidth(), 0);
-}
-
-TEST_F(FontTest, Widths) {
- Font cf("Arial", 16);
- EXPECT_EQ(cf.GetStringWidth(base::string16()), 0);
- EXPECT_GT(cf.GetStringWidth(ASCIIToUTF16("a")),
- cf.GetStringWidth(base::string16()));
- EXPECT_GT(cf.GetStringWidth(ASCIIToUTF16("ab")),
- cf.GetStringWidth(ASCIIToUTF16("a")));
- EXPECT_GT(cf.GetStringWidth(ASCIIToUTF16("abc")),
- cf.GetStringWidth(ASCIIToUTF16("ab")));
-}
-
#if !defined(OS_WIN)
// On Windows, Font::GetActualFontNameForTesting() doesn't work well for now.
// http://crbug.com/327287
@@ -141,21 +123,21 @@ TEST_F(FontTest, GetActualFontNameForTesting) {
#endif
#if defined(OS_WIN)
-TEST_F(FontTest, DeriveFontResizesIfSizeTooSmall) {
+TEST_F(FontTest, DeriveResizesIfSizeTooSmall) {
Font cf("Arial", 8);
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
- Font derived_font = cf.DeriveFont(-4);
+ Font derived_font = cf.Derive(-4, cf.GetStyle());
EXPECT_EQ(5, derived_font.GetFontSize());
}
-TEST_F(FontTest, DeriveFontKeepsOriginalSizeIfHeightOk) {
+TEST_F(FontTest, DeriveKeepsOriginalSizeIfHeightOk) {
Font cf("Arial", 8);
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
- Font derived_font = cf.DeriveFont(-2);
+ Font derived_font = cf.Derive(-2, cf.GetStyle());
EXPECT_EQ(6, derived_font.GetFontSize());
}
#endif // defined(OS_WIN)
« no previous file with comments | « ui/gfx/font_list_unittest.cc ('k') | ui/gfx/platform_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698