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

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

Issue 9390022: Simplify handling of BiDi cursor movement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make set_selection_start private, fix accidental inclusion of local hacks Created 8 years, 10 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 57101563d62d6e88c83082735891bc73161108db..b0e14e4e34a2ee9752e56a9d260d20ae5aae1afc 100644
--- a/ui/views/controls/textfield/native_textfield_views_unittest.cc
+++ b/ui/views/controls/textfield/native_textfield_views_unittest.cc
@@ -269,7 +269,7 @@ class NativeTextfieldViewsTest : public ViewsTestBase,
int GetCursorPositionX(int cursor_pos) {
gfx::RenderText* render_text = textfield_view_->GetRenderText();
return render_text->GetCursorBounds(
- gfx::SelectionModel(cursor_pos), false).x();
+ gfx::SelectionModel(cursor_pos, gfx::CURSOR_FORWARD), false).x();
}
// Get the current cursor bounds.
@@ -1350,32 +1350,32 @@ TEST_F(NativeTextfieldViewsTest, HitInsideTextAreaTest) {
std::vector<gfx::Rect> cursor_bounds;
// Save each cursor bound.
- gfx::SelectionModel sel(0, 0, gfx::SelectionModel::LEADING);
+ gfx::SelectionModel sel(0, gfx::CURSOR_FORWARD);
cursor_bounds.push_back(GetCursorBounds(sel));
- sel = gfx::SelectionModel(1, 0, gfx::SelectionModel::TRAILING);
+ sel = gfx::SelectionModel(1, gfx::CURSOR_BACKWARD);
gfx::Rect bound = GetCursorBounds(sel);
- sel = gfx::SelectionModel(1, 1, gfx::SelectionModel::LEADING);
+ sel = gfx::SelectionModel(1, gfx::CURSOR_FORWARD);
EXPECT_EQ(bound.x(), GetCursorBounds(sel).x());
cursor_bounds.push_back(bound);
// Check that a cursor at the end of the Latin portion of the text is at the
// same position as a cursor placed at the end of the RTL Hebrew portion.
- sel = gfx::SelectionModel(2, 1, gfx::SelectionModel::TRAILING);
+ sel = gfx::SelectionModel(2, gfx::CURSOR_BACKWARD);
bound = GetCursorBounds(sel);
- sel = gfx::SelectionModel(4, 3, gfx::SelectionModel::TRAILING);
+ sel = gfx::SelectionModel(4, gfx::CURSOR_BACKWARD);
EXPECT_EQ(bound.x(), GetCursorBounds(sel).x());
cursor_bounds.push_back(bound);
- sel = gfx::SelectionModel(3, 2, gfx::SelectionModel::TRAILING);
+ sel = gfx::SelectionModel(3, gfx::CURSOR_BACKWARD);
bound = GetCursorBounds(sel);
- sel = gfx::SelectionModel(3, 3, gfx::SelectionModel::LEADING);
+ sel = gfx::SelectionModel(3, gfx::CURSOR_FORWARD);
EXPECT_EQ(bound.x(), GetCursorBounds(sel).x());
cursor_bounds.push_back(bound);
- sel = gfx::SelectionModel(2, 2, gfx::SelectionModel::LEADING);
+ sel = gfx::SelectionModel(2, gfx::CURSOR_FORWARD);
bound = GetCursorBounds(sel);
- sel = gfx::SelectionModel(4, 2, gfx::SelectionModel::LEADING);
+ sel = gfx::SelectionModel(4, gfx::CURSOR_FORWARD);
EXPECT_EQ(bound.x(), GetCursorBounds(sel).x());
cursor_bounds.push_back(bound);

Powered by Google App Engine
This is Rietveld 408576698