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

Unified Diff: ui/gfx/font_unittest.cc

Issue 8392017: Change string16 to std::string in the gfx::Font() interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 'UTF-8' everywhere in the comments Created 9 years, 2 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.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 06e260efb10ddcabea905ae30524f7ed7fd42d90..d495213126b0a7936c62b9be6e65120fc42a93c2 100644
--- a/ui/gfx/font_unittest.cc
+++ b/ui/gfx/font_unittest.cc
@@ -57,17 +57,17 @@ int ScopedMinimumFontSizeCallback::minimum_size_ = 0;
TEST_F(FontTest, LoadArial) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
gfx::NativeFont native = cf.GetNativeFont();
ASSERT_TRUE(native);
ASSERT_EQ(cf.GetStyle(), Font::NORMAL);
ASSERT_EQ(cf.GetFontSize(), 16);
- ASSERT_EQ(cf.GetFontName(), ASCIIToUTF16("Arial"));
+ ASSERT_EQ(cf.GetFontName(), "Arial");
FreeIfNecessary(native);
}
TEST_F(FontTest, LoadArialBold) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
Font bold(cf.DeriveFont(0, Font::BOLD));
gfx::NativeFont native = bold.GetNativeFont();
ASSERT_TRUE(native);
@@ -76,20 +76,20 @@ TEST_F(FontTest, LoadArialBold) {
}
TEST_F(FontTest, Ascent) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
ASSERT_GT(cf.GetBaseline(), 2);
ASSERT_LE(cf.GetBaseline(), 22);
}
TEST_F(FontTest, Height) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
ASSERT_GE(cf.GetHeight(), 16);
// TODO(akalin): Figure out why height is so large on Linux.
ASSERT_LE(cf.GetHeight(), 26);
}
TEST_F(FontTest, AvgWidths) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
ASSERT_EQ(cf.GetExpectedTextWidth(0), 0);
ASSERT_GT(cf.GetExpectedTextWidth(1), cf.GetExpectedTextWidth(0));
ASSERT_GT(cf.GetExpectedTextWidth(2), cf.GetExpectedTextWidth(1));
@@ -97,12 +97,12 @@ TEST_F(FontTest, AvgWidths) {
}
TEST_F(FontTest, AvgCharWidth) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
ASSERT_GT(cf.GetAverageCharacterWidth(), 0);
}
TEST_F(FontTest, Widths) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf("Arial", 16);
ASSERT_EQ(cf.GetStringWidth(ASCIIToUTF16("")), 0);
ASSERT_GT(cf.GetStringWidth(ASCIIToUTF16("a")),
cf.GetStringWidth(ASCIIToUTF16("")));
@@ -114,7 +114,7 @@ TEST_F(FontTest, Widths) {
#if defined(OS_WIN)
TEST_F(FontTest, DeriveFontResizesIfSizeTooSmall) {
- Font cf(L"Arial", 8);
+ Font cf("Arial", 8);
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
@@ -123,7 +123,7 @@ TEST_F(FontTest, DeriveFontResizesIfSizeTooSmall) {
}
TEST_F(FontTest, DeriveFontKeepsOriginalSizeIfHeightOk) {
- Font cf(L"Arial", 8);
+ Font cf("Arial", 8);
// The minimum font size is set to 5 in browser_main.cc.
ScopedMinimumFontSizeCallback minimum_size(5);
« no previous file with comments | « ui/gfx/font.cc ('k') | ui/gfx/platform_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698