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

Unified Diff: ui/views/controls/textfield/native_textfield_views_unittest.cc

Issue 25039002: Always aligns text at vertically center (Textfield, Label). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 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
Index: ui/views/controls/textfield/native_textfield_views_unittest.cc
diff --git a/ui/views/controls/textfield/native_textfield_views_unittest.cc b/ui/views/controls/textfield/native_textfield_views_unittest.cc
index 01ef5780b140ae0b96e485760ea94bc90ed7b606..cf3f47a0a0735dbb69ee2a098ebf5b67beb4a513 100644
--- a/ui/views/controls/textfield/native_textfield_views_unittest.cc
+++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc
@@ -1903,24 +1903,17 @@ TEST_F(NativeTextfieldViewsTest, TestLongPressInitiatesDragDrop) {
}
TEST_F(NativeTextfieldViewsTest, GetTextfieldBaseline_FontFallbackTest) {
-#if defined(OS_WIN)
- // This test fails on some versions of Windows because two different strings
- // have the same baseline.
- if (base::win::GetVersion() <= base::win::VERSION_XP ||
- base::win::VERSION_WIN8 <= base::win::GetVersion())
- return;
-#endif
-
InitTextfield(Textfield::STYLE_DEFAULT);
textfield_->SetText(UTF8ToUTF16("abc"));
const int old_baseline = textfield_->GetBaseline();
// Set text which may fall back to a font which has taller baseline than
- // the default font. |new_baseline| will be greater than |old_baseline|.
+ // the default font.
textfield_->SetText(UTF8ToUTF16("\xE0\xB9\x91"));
const int new_baseline = textfield_->GetBaseline();
- EXPECT_GT(new_baseline, old_baseline);
+ // Regardless of the text, the baseline must be the same.
+ EXPECT_EQ(new_baseline, old_baseline);
}
} // namespace views
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | ui/views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698