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

Unified Diff: ui/views/touchui/touch_selection_controller_impl_unittest.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 3 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/touchui/touch_selection_controller_impl_unittest.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index b9df2ec3b32a83aae4a2ab32c8722e4915b46da4..6fc8e782a45434c8f45e862fed1d39e521c871c2 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -610,7 +610,7 @@ class TestTouchEditable : public ui::TouchEditable {
bounds_ = bounds;
}
- void set_cursor_rect(const gfx::Rect& cursor_rect) {
+ void set_cursor_rect(const gfx::RectF& cursor_rect) {
cursor_bound_.SetEdge(cursor_rect.origin(), cursor_rect.bottom_left());
cursor_bound_.set_type(ui::SelectionBound::Type::CENTER);
}
@@ -689,31 +689,35 @@ TEST_F(TouchSelectionControllerImplTest,
// Put the cursor completely inside the client bounds. Handle should be
// visible.
- touch_editable.set_cursor_rect(gfx::Rect(2, 0, 1, 20));
+ touch_editable.set_cursor_rect(gfx::RectF(2.f, 0.f, 1.f, 20.f));
touch_selection_controller->SelectionChanged();
EXPECT_TRUE(IsCursorHandleVisibleFor(touch_selection_controller.get()));
// Move the cursor up such that |kBarMinHeight| pixels are still in the client
// bounds. Handle should still be visible.
- touch_editable.set_cursor_rect(gfx::Rect(2, kBarMinHeight - 20, 1, 20));
+ touch_editable.set_cursor_rect(
+ gfx::RectF(2.f, kBarMinHeight - 20.f, 1.f, 20.f));
touch_selection_controller->SelectionChanged();
EXPECT_TRUE(IsCursorHandleVisibleFor(touch_selection_controller.get()));
// Move the cursor up such that less than |kBarMinHeight| pixels are in the
// client bounds. Handle should be hidden.
- touch_editable.set_cursor_rect(gfx::Rect(2, kBarMinHeight - 20 - 1, 1, 20));
+ touch_editable.set_cursor_rect(
+ gfx::RectF(2.f, kBarMinHeight - 20.f - 1.f, 1.f, 20.f));
touch_selection_controller->SelectionChanged();
EXPECT_FALSE(IsCursorHandleVisibleFor(touch_selection_controller.get()));
// Move the Cursor down such that |kBarBottomAllowance| pixels are out of the
// client bounds. Handle should be visible.
- touch_editable.set_cursor_rect(gfx::Rect(2, kBarBottomAllowance, 1, 20));
+ touch_editable.set_cursor_rect(
+ gfx::RectF(2.f, kBarBottomAllowance, 1.f, 20.f));
touch_selection_controller->SelectionChanged();
EXPECT_TRUE(IsCursorHandleVisibleFor(touch_selection_controller.get()));
// Move the cursor down such that more than |kBarBottomAllowance| pixels are
// out of the client bounds. Handle should be hidden.
- touch_editable.set_cursor_rect(gfx::Rect(2, kBarBottomAllowance + 1, 1, 20));
+ touch_editable.set_cursor_rect(
+ gfx::RectF(2.f, kBarBottomAllowance + 1.f, 1.f, 20.f));
touch_selection_controller->SelectionChanged();
EXPECT_FALSE(IsCursorHandleVisibleFor(touch_selection_controller.get()));
@@ -731,7 +735,7 @@ TEST_F(TouchSelectionControllerImplTest, HandlesStackAboveParent) {
// Start touch editing, check that the handle is above the first window, and
// end touch editing.
StartTouchEditing();
- gfx::Point test_point = GetCursorHandleDragPoint();
+ auto test_point = gfx::PointF(GetCursorHandleDragPoint());
ui::MouseEvent test_event1(ui::ET_MOUSE_MOVED, test_point, test_point,
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
EXPECT_EQ(GetCursorHandleNativeView(),

Powered by Google App Engine
This is Rietveld 408576698