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

Unified Diff: views/controls/label_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 | « views/controls/label.cc ('k') | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/label_unittest.cc
===================================================================
--- views/controls/label_unittest.cc (revision 71168)
+++ views/controls/label_unittest.cc (working copy)
@@ -15,22 +15,22 @@
// All text sizing measurements (width and height) should be greater than this.
const int kMinTextDimension = 4;
-#if defined(OS_WIN)
+#if defined(WIN_OS)
// Courier is failing on linux because it's non scalable.
TEST(LabelTest, FontPropertyCourier) {
Label label;
- string16 font_name(ASCIIToUTF16("courier"));
- gfx::Font font(font_name, 30);
+ std::wstring font_name(L"courier");
+ gfx::Font font = gfx::Font::CreateFont(font_name, 30);
label.SetFont(font);
gfx::Font font_used = label.font();
- EXPECT_EQ(font_name, font_used.GetFontName());
- EXPECT_EQ(30, font_used.GetFontSize());
+ EXPECT_EQ(font_name, font_used.FontName());
+ EXPECT_EQ(30, font_used.FontSize());
}
#endif
TEST(LabelTest, FontPropertyArial) {
Label label;
- string16 font_name(ASCIIToUTF16("arial"));
+ std::wstring font_name(L"arial");
gfx::Font font(font_name, 30);
label.SetFont(font);
gfx::Font font_used = label.font();
@@ -214,7 +214,7 @@
// SizeToFit with limited width.
label.SizeToFit(required_width - 1);
int constrained_width = label.GetLocalBounds(true).width();
-#if defined(OS_WIN)
+#if defined(WIN_OS)
// Canvas::SizeStringInt (in app/gfx/canvas_linux.cc)
// has to be fixed to return the size that fits to given width/height.
EXPECT_LT(constrained_width, required_width);
@@ -229,7 +229,7 @@
int required_height = label.GetHeightForWidth(required_width);
EXPECT_GT(required_height, kMinTextDimension);
int height_for_constrained_width = label.GetHeightForWidth(constrained_width);
-#if defined(OS_WIN)
+#if defined(WIN_OS)
// Canvas::SizeStringInt (in app/gfx/canvas_linux.cc)
// has to be fixed to return the size that fits to given width/height.
EXPECT_GT(height_for_constrained_width, required_height);
@@ -261,7 +261,7 @@
// calculation. If it is, then the height will grow when width
// is shrunk.
int height1 = label.GetHeightForWidth(required_width_with_border - 1);
-#if defined(OS_WIN)
+#if defined(WIN_OS)
// Canvas::SizeStringInt (in app/gfx/canvas_linux.cc)
// has to be fixed to return the size that fits to given width/height.
EXPECT_GT(height1, required_height_with_border);
« no previous file with comments | « views/controls/label.cc ('k') | views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698