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

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

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 8 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/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 94615c6bff630b42433e84475b208ce757ab22db..949a242e5aa6d7d4e13099704fbea7fa8c366f62 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -873,13 +873,14 @@ TEST_F(TextfieldTest, DragAndDrop_ToTheRight) {
ui::MouseEvent click_a(ui::ET_MOUSE_PRESSED, point, point,
ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
textfield_->OnMousePressed(click_a);
- EXPECT_TRUE(textfield_->CanStartDragForView(textfield_, click_a.location(),
- gfx::Point()));
- operations = textfield_->GetDragOperationsForView(textfield_,
- click_a.location());
+ EXPECT_TRUE(textfield_->CanStartDragForView(
+ textfield_, gfx::ToFlooredPoint(click_a.location()), gfx::Point()));
+ operations = textfield_->GetDragOperationsForView(
+ textfield_, gfx::ToFlooredPoint(click_a.location()));
EXPECT_EQ(ui::DragDropTypes::DRAG_MOVE | ui::DragDropTypes::DRAG_COPY,
operations);
- textfield_->WriteDragDataForView(NULL, click_a.location(), &data);
+ textfield_->WriteDragDataForView(
+ NULL, gfx::ToFlooredPoint(click_a.location()), &data);
EXPECT_TRUE(data.GetString(&string));
EXPECT_EQ(textfield_->GetSelectedText(), string);
EXPECT_TRUE(textfield_->GetDropFormats(&formats, &custom_formats));
@@ -926,13 +927,14 @@ TEST_F(TextfieldTest, DragAndDrop_ToTheLeft) {
ui::MouseEvent click_a(ui::ET_MOUSE_PRESSED, point, point,
ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
textfield_->OnMousePressed(click_a);
- EXPECT_TRUE(textfield_->CanStartDragForView(textfield_, click_a.location(),
- gfx::Point()));
- operations = textfield_->GetDragOperationsForView(textfield_,
- click_a.location());
+ EXPECT_TRUE(textfield_->CanStartDragForView(
+ textfield_, gfx::ToFlooredPoint(click_a.location()), gfx::Point()));
+ operations = textfield_->GetDragOperationsForView(
+ textfield_, gfx::ToFlooredPoint(click_a.location()));
EXPECT_EQ(ui::DragDropTypes::DRAG_MOVE | ui::DragDropTypes::DRAG_COPY,
operations);
- textfield_->WriteDragDataForView(NULL, click_a.location(), &data);
+ textfield_->WriteDragDataForView(
+ NULL, gfx::ToFlooredPoint(click_a.location()), &data);
EXPECT_TRUE(data.GetString(&string));
EXPECT_EQ(textfield_->GetSelectedText(), string);
EXPECT_TRUE(textfield_->GetDropFormats(&formats, &custom_formats));
@@ -974,7 +976,8 @@ TEST_F(TextfieldTest, DragAndDrop_Canceled) {
ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
textfield_->OnMousePressed(click);
ui::OSExchangeData data;
- textfield_->WriteDragDataForView(NULL, click.location(), &data);
+ textfield_->WriteDragDataForView(
+ NULL, gfx::ToFlooredPoint(click.location()), &data);
EXPECT_TRUE(textfield_->CanDrop(data));
// Drag the text over somewhere valid, outside the current selection.
gfx::Point drop_point(GetCursorPositionX(2), 0);

Powered by Google App Engine
This is Rietveld 408576698