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

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

Issue 8044004: Clean up of SelectionModel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: add comment about 'next' in ReplaceTextInternal Created 9 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
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_views_unittest.cc
===================================================================
--- views/controls/textfield/native_textfield_views_unittest.cc (revision 103984)
+++ views/controls/textfield/native_textfield_views_unittest.cc (working copy)
@@ -780,7 +780,8 @@
// Ensure the textfield will provide selected text for drag data.
string16 string;
ui::OSExchangeData data;
- textfield_->SelectSelectionModel(gfx::SelectionModel(6, 12));
+ const ui::Range kStringRange(6, 12);
+ textfield_->SelectRange(kStringRange);
const gfx::Point kStringPoint(GetCursorPositionX(9), 0);
textfield_view_->WriteDragDataForView(NULL, kStringPoint, &data);
EXPECT_TRUE(data.GetString(&string));
@@ -795,7 +796,7 @@
textfield_->ClearSelection();
EXPECT_EQ(ui::DragDropTypes::DRAG_NONE,
textfield_view_->GetDragOperationsForView(NULL, kStringPoint));
- textfield_->SelectSelectionModel(gfx::SelectionModel(6, 12));
+ textfield_->SelectRange(kStringRange);
// Ensure that textfields only initiate drag operations inside the selection.
EXPECT_EQ(ui::DragDropTypes::DRAG_NONE,
textfield_view_->GetDragOperationsForView(NULL, gfx::Point()));
@@ -821,7 +822,7 @@
std::set<OSExchangeData::CustomFormat> custom_formats;
// Start dragging "ello".
- textfield_->SelectSelectionModel(gfx::SelectionModel(1, 5));
+ textfield_->SelectRange(ui::Range(1, 5));
MouseEvent click_a(ui::ET_MOUSE_PRESSED, GetCursorPositionX(3), 0,
ui::EF_LEFT_BUTTON_DOWN);
textfield_view_->OnMousePressed(click_a);
@@ -875,7 +876,7 @@
std::set<OSExchangeData::CustomFormat> custom_formats;
// Start dragging " worl".
- textfield_->SelectSelectionModel(gfx::SelectionModel(5, 10));
+ textfield_->SelectRange(ui::Range(5, 10));
MouseEvent click_a(ui::ET_MOUSE_PRESSED, GetCursorPositionX(7), 0,
ui::EF_LEFT_BUTTON_DOWN);
textfield_view_->OnMousePressed(click_a);
@@ -922,7 +923,7 @@
textfield_->SetText(ASCIIToUTF16("hello world"));
// Start dragging "worl".
- textfield_->SelectSelectionModel(gfx::SelectionModel(6, 10));
+ textfield_->SelectRange(ui::Range(6, 10));
MouseEvent click(ui::ET_MOUSE_PRESSED, GetCursorPositionX(8), 0,
ui::EF_LEFT_BUTTON_DOWN);
textfield_view_->OnMousePressed(click);
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698