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

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

Issue 738363002: Enable subpixel positioning for UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re-disable dwrite in tests, re-enable dwrite metrics Created 6 years, 1 month 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/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 84da7d4e37f0473ee520dd9fd47c223d63990270..2ec05f49130bec552b0a3184e03ad2483a384e70 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -1451,12 +1451,12 @@ TEST_F(TextfieldTest, TextCursorDisplayTest) {
SendKeyEvent(0x05E1);
EXPECT_EQ(WideToUTF16(L"ab\x05E1"), textfield_->text());
x = GetCursorBounds().x();
- EXPECT_EQ(prev_x, x);
+ EXPECT_GE(1, std::abs(x - prev_x));
msw 2014/11/24 21:51:00 If I read this right, entering an RTL character in
ckocagil 2014/11/25 01:39:47 When the cursor is placed between two glyphs, we p
msw 2014/11/25 04:52:06 Add an explanatory comment and/or TODO.
SendKeyEvent(0x05E2);
EXPECT_EQ(WideToUTF16(L"ab\x05E1\x5E2"), textfield_->text());
x = GetCursorBounds().x();
- EXPECT_EQ(prev_x, x);
+ EXPECT_GE(1, std::abs(x - prev_x));
// Clear text.
SendKeyEvent(ui::VKEY_A, false, true);
@@ -1472,7 +1472,7 @@ TEST_F(TextfieldTest, TextCursorDisplayTest) {
SendKeyEvent(0x05E2);
EXPECT_EQ(WideToUTF16(L"\x05E1\x05E2"), textfield_->text());
x = GetCursorBounds().x();
- EXPECT_EQ(prev_x, x);
+ EXPECT_GE(1, std::abs(x - prev_x));
SendKeyEvent('a');
EXPECT_EQ(WideToUTF16(L"\x05E1\x5E2" L"a"), textfield_->text());
@@ -1501,7 +1501,7 @@ TEST_F(TextfieldTest, TextCursorDisplayInRTLTest) {
SendKeyEvent('b');
EXPECT_STR_EQ("ab", textfield_->text());
x = GetCursorBounds().x();
- EXPECT_EQ(prev_x, x);
+ EXPECT_GE(1, std::abs(x - prev_x));
SendKeyEvent(0x05E1);
EXPECT_EQ(WideToUTF16(L"ab\x05E1"), textfield_->text());
@@ -1532,7 +1532,7 @@ TEST_F(TextfieldTest, TextCursorDisplayInRTLTest) {
SendKeyEvent('a');
EXPECT_EQ(WideToUTF16(L"\x05E1\x5E2" L"a"), textfield_->text());
x = GetCursorBounds().x();
- EXPECT_EQ(prev_x, x);
+ EXPECT_GE(1, std::abs(x - prev_x));
prev_x = x;
SendKeyEvent('b');

Powered by Google App Engine
This is Rietveld 408576698