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

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: std::round to std::floor(+0.5) Created 6 years 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/win/direct_write.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
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');
« no previous file with comments | « ui/gfx/win/direct_write.cc ('k') | ui/views/examples/examples_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698