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

Unified Diff: gfx/font_unittest.cc

Issue 6134010: Revert 71167 - Remove wstring from gfx.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « gfx/font.cc ('k') | gfx/platform_font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/font_unittest.cc
===================================================================
--- gfx/font_unittest.cc (revision 71168)
+++ gfx/font_unittest.cc (working copy)
@@ -46,35 +46,35 @@
TEST_F(FontTest, LoadArial) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf(L"Arial", 16);
ASSERT_TRUE(cf.GetNativeFont());
ASSERT_EQ(cf.GetStyle(), Font::NORMAL);
ASSERT_EQ(cf.GetFontSize(), 16);
- ASSERT_EQ(cf.GetFontName(), ASCIIToUTF16("Arial"));
+ ASSERT_EQ(cf.GetFontName(), L"Arial");
}
TEST_F(FontTest, LoadArialBold) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf(L"Arial", 16);
Font bold(cf.DeriveFont(0, Font::BOLD));
ASSERT_TRUE(bold.GetNativeFont());
ASSERT_EQ(bold.GetStyle(), Font::BOLD);
}
TEST_F(FontTest, Ascent) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf(L"Arial", 16);
ASSERT_GT(cf.GetBaseline(), 2);
ASSERT_LE(cf.GetBaseline(), 22);
}
TEST_F(FontTest, Height) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf(L"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(L"Arial", 16);
ASSERT_EQ(cf.GetExpectedTextWidth(0), 0);
ASSERT_GT(cf.GetExpectedTextWidth(1), cf.GetExpectedTextWidth(0));
ASSERT_GT(cf.GetExpectedTextWidth(2), cf.GetExpectedTextWidth(1));
@@ -82,7 +82,7 @@
}
TEST_F(FontTest, Widths) {
- Font cf(ASCIIToUTF16("Arial"), 16);
+ Font cf(L"Arial", 16);
ASSERT_EQ(cf.GetStringWidth(ASCIIToUTF16("")), 0);
ASSERT_GT(cf.GetStringWidth(ASCIIToUTF16("a")),
cf.GetStringWidth(ASCIIToUTF16("")));
« no previous file with comments | « gfx/font.cc ('k') | gfx/platform_font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698