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

Unified Diff: ui/aura/gestures/gesture_recognizer_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/aura/gestures/gesture_recognizer_unittest.cc
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 5404dd4e0a2b40a7f154f938446f53e668a08606..2177651178af468e897afcef79fd83a38845a6b2 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -562,7 +562,7 @@ class TestEventHandler : public ui::EventHandler {
touch_moved_count_++;
break;
case ui::ET_TOUCH_CANCELLED:
- cancelled_touch_points_.push_back(event->location());
+ cancelled_touch_points_.push_back(event->location_f());
break;
default:
break;
@@ -680,7 +680,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(delegate->tap());
@@ -701,7 +701,7 @@ TEST_F(GestureRecognizerTest, GestureEventTap) {
// Make sure there is enough delay before the touch is released so that it is
// recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -733,7 +733,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
// Test with no ET_TOUCH_MOVED events.
{
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
press.set_radius_x(5);
press.set_radius_y(12);
@@ -750,7 +750,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
release.set_radius_x(5);
release.set_radius_y(12);
@@ -776,7 +776,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
// Test with no ET_TOUCH_MOVED events but different touch points and radii.
{
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(365, 290),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(365.f, 290.f),
kTouchId, tes.Now());
press.set_radius_x(8);
press.set_radius_y(14);
@@ -791,7 +791,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(367, 291),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(367.f, 291.f),
kTouchId, tes.LeapForward(50));
release.set_radius_x(20);
release.set_radius_y(13);
@@ -817,7 +817,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
// Test with a single ET_TOUCH_MOVED event.
{
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(46, 205),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(46.f, 205.f),
kTouchId, tes.Now());
press.set_radius_x(6);
press.set_radius_y(10);
@@ -833,8 +833,8 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(49, 204),
- kTouchId, tes.LeapForward(50));
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(49.f, 204.f), kTouchId,
+ tes.LeapForward(50));
move.set_radius_x(8);
move.set_radius_y(12);
DispatchEventUsingWindowDispatcher(&move);
@@ -848,7 +848,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(49, 204),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(49.f, 204.f),
kTouchId, tes.LeapForward(50));
release.set_radius_x(4);
release.set_radius_y(8);
@@ -874,7 +874,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
// Test with a few ET_TOUCH_MOVED events.
{
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(400, 150),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(400.f, 150.f),
kTouchId, tes.Now());
press.set_radius_x(7);
press.set_radius_y(10);
@@ -889,7 +889,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(397, 151),
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(397.f, 151.f),
kTouchId, tes.LeapForward(50));
move.set_radius_x(13);
move.set_radius_y(12);
@@ -904,7 +904,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(397, 149),
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(397.f, 149.f),
kTouchId, tes.LeapForward(50));
move1.set_radius_x(16);
move1.set_radius_y(16);
@@ -919,7 +919,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(400, 150),
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(400.f, 150.f),
kTouchId, tes.LeapForward(50));
move2.set_radius_x(14);
move2.set_radius_y(10);
@@ -934,7 +934,7 @@ TEST_F(GestureRecognizerTest, GestureEventTapRegion) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(401, 149),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(401.f, 149.f),
kTouchId, tes.LeapForward(50));
release.set_radius_x(8);
release.set_radius_y(9);
@@ -976,7 +976,7 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_2_EVENTS(delegate->events(),
@@ -1019,9 +1019,8 @@ TEST_F(GestureRecognizerTest, GestureEventScroll) {
// Release the touch. This should end the scroll.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
- kTouchId,
- tes.LeapForward(50));
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
+ kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_SCROLL_FLING_START,
@@ -1051,8 +1050,8 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) {
// Tracks the total scroll since we want to verify that the correct position
// will be scrolled to throughout the prediction.
gfx::Vector2dF total_scroll;
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(96, 196),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(96.f, 196.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_GESTURE_BEGIN,
@@ -1060,8 +1059,8 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) {
delegate->Reset();
// Get rid of touch slop.
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(111, 211),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(111.f, 211.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
EXPECT_3_EVENTS(delegate->events(),
ui::ET_GESTURE_TAP_CANCEL,
@@ -1096,9 +1095,8 @@ TEST_F(GestureRecognizerTest, GestureEventScrollPrediction) {
// Release the touch. This should end the scroll.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
- kTouchId,
- tes.LeapForward(50));
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
+ kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
}
@@ -1165,13 +1163,13 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Get rid of touch slop.
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(10.f, 0.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->Reset();
@@ -1195,7 +1193,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
delegate.get());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&release);
@@ -1216,13 +1214,13 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Get rid of touch slop.
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(0, 10),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(0.f, 10.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->Reset();
@@ -1247,7 +1245,7 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
EXPECT_EQ(0, delegate->scroll_velocity_x());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 206),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 206.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&release);
@@ -1270,8 +1268,8 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Move the touch-point such that a non-rail scroll begins, and we're outside
@@ -1292,7 +1290,7 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
delegate.get());
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&release);
@@ -1315,10 +1313,8 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED,
- gfx::Point(101, 201),
- kTouchId,
- ui::EventTimeForNow());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId, ui::EventTimeForNow());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -1333,10 +1329,8 @@ TEST_F(GestureRecognizerTest, GestureEventLongPress) {
EXPECT_FALSE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED,
- gfx::Point(101, 201),
- kTouchId,
- ui::EventTimeForNow());
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
+ kTouchId, ui::EventTimeForNow());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->long_press());
@@ -1359,7 +1353,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
@@ -1379,7 +1373,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledByScroll) {
EXPECT_TRUE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(10));
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->long_press());
@@ -1401,10 +1395,8 @@ TEST_F(GestureRecognizerTest, GestureEventLongTap) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED,
- gfx::Point(101, 201),
- kTouchId,
- ui::EventTimeForNow());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId, ui::EventTimeForNow());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -1419,10 +1411,8 @@ TEST_F(GestureRecognizerTest, GestureEventLongTap) {
EXPECT_FALSE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED,
- gfx::Point(101, 201),
- kTouchId,
- ui::EventTimeForNow());
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
+ kTouchId, ui::EventTimeForNow());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->long_press());
EXPECT_TRUE(delegate->long_tap());
@@ -1446,7 +1436,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_TRUE(delegate->tap_down());
@@ -1457,7 +1447,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) {
// Second tap, to cancel the long press
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
@@ -1471,7 +1461,7 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressCancelledBySecondTap) {
EXPECT_FALSE(delegate->long_press());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->long_press());
@@ -1490,13 +1480,13 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Get rid of touch slop.
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(5, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(5.f, 0.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->Reset();
@@ -1546,13 +1536,13 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Get rid of touch slop.
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(0, 5),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(0.f, 5.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->Reset();
@@ -1610,7 +1600,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(delegate->tap());
@@ -1623,7 +1613,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
// Make sure there is enough delay before the touch is released so that it is
// recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_TRUE(delegate->tap());
@@ -1636,7 +1626,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
// Now, do a scroll gesture. Delay it sufficiently so that it doesn't trigger
// a double-tap.
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(1000));
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_FALSE(delegate->tap());
@@ -1647,7 +1637,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
EXPECT_FALSE(delegate->scroll_end());
// Get rid of touch slop.
- ui::TouchEvent move_remove_slop(ui::ET_TOUCH_MOVED, gfx::Point(116, 216),
+ ui::TouchEvent move_remove_slop(ui::ET_TOUCH_MOVED, gfx::PointF(116.f, 216.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&move_remove_slop);
EXPECT_TRUE(delegate->tap_cancel());
@@ -1663,8 +1653,8 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
// The first movement is diagonal, to ensure that we have a free scroll,
// and not a rail scroll.
delegate->Reset();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(135, 235),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(135.f, 235.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -1677,8 +1667,8 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
// Move some more to generate a few more scroll updates.
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(115, 216),
- kTouchId, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(115.f, 216.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -1692,8 +1682,8 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
EXPECT_EQ(0, delegate->scroll_y_hint());
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(145, 220),
- kTouchId, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(145.f, 220.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -1706,7 +1696,7 @@ TEST_F(GestureRecognizerTest, GestureTapFollowedByScroll) {
// Release the touch. This should end the scroll.
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->tap());
@@ -1734,8 +1724,8 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
// Touch down on the window. This should not generate any gesture event.
queued_delegate->Reset();
- ui::TouchEvent press(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(queued_delegate->tap());
EXPECT_FALSE(queued_delegate->tap_down());
@@ -1749,9 +1739,7 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
// as a tap. However, this still should not create any gesture events.
queued_delegate->Reset();
ui::TouchEvent release(
- ui::ET_TOUCH_RELEASED,
- gfx::Point(101, 201),
- kTouchId1,
+ ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f), kTouchId1,
press.time_stamp() + base::TimeDelta::FromMilliseconds(50));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(queued_delegate->tap());
@@ -1770,8 +1758,8 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -2345, gfx::Rect(0, 0, 50, 50), root_window()));
delegate->Reset();
- ui::TouchEvent press2(
- ui::ET_TOUCH_PRESSED, gfx::Point(10, 20), kTouchId2, tes.Now());
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 20.f),
+ kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
@@ -1782,8 +1770,8 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
EXPECT_FALSE(delegate->scroll_update());
EXPECT_FALSE(delegate->scroll_end());
- ui::TouchEvent release2(
- ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), kTouchId2, tes.Now());
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(10.f, 20.f),
+ kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&release2);
// Process the first queued event.
@@ -1813,8 +1801,8 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
// Start all over. Press on the first window, then press again on the second
// window. The second press should still go to the first window.
queued_delegate->Reset();
- ui::TouchEvent press3(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now());
+ ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press3);
EXPECT_FALSE(queued_delegate->tap());
EXPECT_FALSE(queued_delegate->tap_down());
@@ -1829,8 +1817,8 @@ TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {
queued_delegate->Reset();
delegate->Reset();
- ui::TouchEvent press4(
- ui::ET_TOUCH_PRESSED, gfx::Point(103, 203), kTouchId2, tes.Now());
+ ui::TouchEvent press4(ui::ET_TOUCH_PRESSED, gfx::PointF(103.f, 203.f),
+ kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press4);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -1932,7 +1920,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_2_EVENTS(delegate->events(),
@@ -1942,8 +1930,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Move the touch-point enough so that it is considered as a scroll. This
// should generate both SCROLL_BEGIN and SCROLL_UPDATE gestures.
delegate->Reset();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301),
- kTouchId1, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(130.f, 301.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
EXPECT_3_EVENTS(delegate->events(),
ui::ET_GESTURE_TAP_CANCEL,
@@ -1953,7 +1941,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Press the second finger. It should cause pinch-begin. Note that we will not
// transition to two finger tap here because the touch points are far enough.
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_BEGIN);
@@ -1962,8 +1950,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Move the first finger.
delegate->Reset();
- ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201),
- kTouchId1, tes.Now());
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(95.f, 201.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_UPDATE,
@@ -1973,8 +1961,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Now move the second finger.
delegate->Reset();
- ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15),
- kTouchId2, tes.Now());
+ ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::PointF(55.f, 15.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move4);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_UPDATE,
@@ -1984,7 +1972,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Release the first finger. This should end pinch.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&release);
EXPECT_2_EVENTS(delegate->events(),
@@ -1995,8 +1983,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromScroll) {
// Move the second finger. This should still generate a scroll.
delegate->Reset();
- ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10),
- kTouchId2, tes.Now());
+ ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::PointF(25.f, 10.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move5);
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE);
EXPECT_TRUE(delegate->bounding_box().IsEmpty());
@@ -2014,11 +2002,11 @@ scoped_ptr<GestureEventConsumeDelegate> delegate(
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 301.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_FALSE(delegate->pinch_begin());
@@ -2035,7 +2023,7 @@ scoped_ptr<GestureEventConsumeDelegate> delegate(
// Pinch has started, now release the second finger
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&release);
EXPECT_TRUE(delegate->pinch_end());
@@ -2045,13 +2033,13 @@ scoped_ptr<GestureEventConsumeDelegate> delegate(
// Pinch again
delegate->Reset();
- ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press3);
// Now the touch points are close. So we will go into two finger tap.
// Move the touch-point enough to break two-finger-tap and enter pinch.
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 50),
- kTouchId1, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(101.f, 50.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_TRUE(delegate->pinch_begin());
@@ -2072,7 +2060,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 301.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_2_EVENTS(delegate->events(),
@@ -2082,7 +2070,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
// Press the second finger far enough to break two finger tap.
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_2_EVENTS(delegate->events(),
@@ -2093,8 +2081,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
// Move the first finger.
delegate->Reset();
- ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201),
- kTouchId1, tes.Now());
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 201.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
EXPECT_3_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_BEGIN,
@@ -2105,8 +2093,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
// Now move the second finger.
delegate->Reset();
- ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15),
- kTouchId2, tes.Now());
+ ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::PointF(55.f, 15.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move4);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_UPDATE,
@@ -2116,7 +2104,7 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
// Release the first finger. This should end pinch.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.LeapForward(10));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_2_EVENTS(delegate->events(),
@@ -2127,8 +2115,8 @@ TEST_F(GestureRecognizerTest, GestureEventPinchFromTap) {
// Move the second finger. This should still generate a scroll.
delegate->Reset();
- ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10),
- kTouchId2, tes.Now());
+ ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::PointF(25.f, 10.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move5);
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE);
EXPECT_TRUE(delegate->bounding_box().IsEmpty());
@@ -2139,8 +2127,8 @@ TEST_F(GestureRecognizerTest, GestureEventIgnoresDisconnectedEvents) {
new GestureEventConsumeDelegate());
TimedEvents tes;
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
- 6, tes.Now());
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f), 6,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -2177,52 +2165,61 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) {
windows[i] = CreateTestWindowWithDelegate(
delegates[i], i, window_bounds[i], root_window());
windows[i]->set_id(i);
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i].origin(),
- i, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
+ gfx::PointF(window_bounds[i].origin()), i, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
}
// Touches should now be associated with the closest touch within
// ui::GestureConfiguration::max_separation_for_gesture_touches_in_pixels
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 11), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(11.f, 11.f), -1);
EXPECT_EQ("0", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 11), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(511.f, 11.f), -1);
EXPECT_EQ("1", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 511), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(11.f, 511.f), -1);
EXPECT_EQ("2", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 511), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(511.f, 511.f), -1);
EXPECT_EQ("3", WindowIDAsString(target));
// Add a touch in the middle associated with windows[2]
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(0.f, 500.f),
kNumWindows, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250),
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(250.f, 250.f),
kNumWindows, tes.Now());
DispatchEventUsingWindowDispatcher(&move);
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(250.f, 250.f), -1);
EXPECT_EQ("2", WindowIDAsString(target));
// Make sure that ties are broken by distance to a current touch
// Closer to the point in the bottom right.
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(380, 380), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(380.f, 380.f), -1);
EXPECT_EQ("3", WindowIDAsString(target));
// This touch is closer to the point in the middle
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(300, 300), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(300.f, 300.f), -1);
EXPECT_EQ("2", WindowIDAsString(target));
// A touch too far from other touches won't be locked to anything
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(1000.f, 1000.f), -1);
EXPECT_TRUE(target == NULL);
// Move a touch associated with windows[2] to 1000, 1000
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000),
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(1000.f, 1000.f),
kNumWindows, tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000), -1);
+ target =
+ gesture_recognizer->GetTargetForLocation(gfx::PointF(1000.f, 1000.f), -1);
EXPECT_EQ("2", WindowIDAsString(target));
for (int i = 0; i < kNumWindows; ++i) {
@@ -2245,13 +2242,13 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockIgnoresOtherScreens) {
const int kTouchId2 = 2;
TimedEvents tes;
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(5, 5),
- kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(5.f, 5.f), kTouchId1,
+ tes.Now());
ui::EventTestApi test_press1(&press1);
test_press1.set_source_device_id(1);
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(20.f, 20.f),
kTouchId2, tes.Now());
ui::EventTestApi test_press2(&press2);
test_press2.set_source_device_id(2);
@@ -2271,11 +2268,11 @@ TEST_F(GestureRecognizerTest, GestureEventOutsideRootWindowTap) {
scoped_ptr<aura::Window> window(CreateTestWindowWithBounds(
gfx::Rect(-100, -100, 2000, 2000), root_window()));
- gfx::Point pos1(-10, -10);
+ gfx::PointF pos1(-10.f, -10.f);
ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, pos1, 0, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- gfx::Point pos2(1000, 1000);
+ gfx::PointF pos2(1000.f, 1000.f);
ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, pos2, 1, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
@@ -2300,10 +2297,10 @@ TEST_F(GestureRecognizerTest, NoTapWithPreventDefaultedRelease) {
delegate->set_window(window.get());
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2329,12 +2326,12 @@ TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) {
{
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(15, 25), kTouchId1,
- tes.Now());
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 95), kTouchId1,
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(15.f, 25.f),
+ kTouchId1, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 95.f), kTouchId1,
tes.LeapForward(200));
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(15, 25), kTouchId1,
- tes.LeapForward(50));
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(15.f, 25.f),
+ kTouchId1, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&press);
DispatchEventUsingWindowDispatcher(&move);
DispatchEventUsingWindowDispatcher(&release);
@@ -2361,18 +2358,18 @@ TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) {
delegate->events(), ui::ET_GESTURE_SCROLL_END, ui::ET_GESTURE_END);
}
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(15, 25), kTouchId1,
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(15.f, 25.f), kTouchId1,
tes.Now());
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 95), kTouchId1,
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 95.f), kTouchId1,
tes.LeapForward(200));
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(15, 25), kTouchId1,
- tes.LeapForward(50));
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 25), kTouchId2,
- tes.Now());
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(145, 85), kTouchId2,
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(15.f, 25.f),
+ kTouchId1, tes.LeapForward(50));
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(55.f, 25.f),
+ kTouchId2, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(145.f, 85.f), kTouchId2,
tes.LeapForward(1000));
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(145, 85), kTouchId2,
- tes.LeapForward(14));
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(145.f, 85.f),
+ kTouchId2, tes.LeapForward(14));
// Do a pinch.
DispatchEventUsingWindowDispatcher(&press);
@@ -2476,12 +2473,10 @@ TEST_F(GestureRecognizerTest, CaptureDoesNotCancelFinishedTouches) {
TimedEvents tes;
// Generate two touch-press events on the window.
- scoped_ptr<ui::TouchEvent> touch0(new ui::TouchEvent(ui::ET_TOUCH_PRESSED,
- gfx::Point(20, 20), 0,
- tes.Now()));
- scoped_ptr<ui::TouchEvent> touch1(new ui::TouchEvent(ui::ET_TOUCH_PRESSED,
- gfx::Point(30, 30), 1,
- tes.Now()));
+ scoped_ptr<ui::TouchEvent> touch0(new ui::TouchEvent(
+ ui::ET_TOUCH_PRESSED, gfx::PointF(20.f, 20.f), 0, tes.Now()));
+ scoped_ptr<ui::TouchEvent> touch1(new ui::TouchEvent(
+ ui::ET_TOUCH_PRESSED, gfx::PointF(30.f, 30.f), 1, tes.Now()));
generator.Dispatch(touch0.get());
generator.Dispatch(touch1.get());
RunAllPendingInMessageLoop();
@@ -2492,10 +2487,10 @@ TEST_F(GestureRecognizerTest, CaptureDoesNotCancelFinishedTouches) {
// End the two touches, one by a touch-release and one by a touch-cancel; to
// cover both cases.
- touch0.reset(new ui::TouchEvent(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0,
- tes.Now()));
- touch1.reset(new ui::TouchEvent(ui::ET_TOUCH_CANCELLED, gfx::Point(30, 30), 1,
- tes.Now()));
+ touch0.reset(new ui::TouchEvent(ui::ET_TOUCH_RELEASED,
+ gfx::PointF(20.f, 20.f), 0, tes.Now()));
+ touch1.reset(new ui::TouchEvent(ui::ET_TOUCH_CANCELLED,
+ gfx::PointF(30.f, 30.f), 1, tes.Now()));
generator.Dispatch(touch0.get());
generator.Dispatch(touch1.get());
RunAllPendingInMessageLoop();
@@ -2523,7 +2518,8 @@ TEST_F(GestureRecognizerTest, PressDoesNotCrash) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, gfx::Rect(10, 10, 300, 300), root_window()));
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(45, 45), 7, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(45.f, 45.f), 7,
+ tes.Now());
press.set_radius_x(40);
DispatchEventUsingWindowDispatcher(&press);
EXPECT_TRUE(delegate->tap_down());
@@ -2531,7 +2527,8 @@ TEST_F(GestureRecognizerTest, PressDoesNotCrash) {
delegate->bounding_box().ToString());
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now());
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(55.f, 45.f), 7,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
// FIXME(tdresser): this should not generate a tap down; however,
@@ -2556,14 +2553,14 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_2_EVENTS(
delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_2_EVENTS(
@@ -2571,11 +2568,11 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) {
// Little bit of touch move should not affect our state.
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202),
- kTouchId1, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(102.f, 202.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202),
- kTouchId2, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(131.f, 202.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_3_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_BEGIN,
ui::ET_GESTURE_SCROLL_UPDATE, ui::ET_GESTURE_SCROLL_UPDATE);
@@ -2583,7 +2580,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) {
// Make sure there is enough delay before the touch is released so that it is
// recognized as a tap.
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
@@ -2594,7 +2591,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTap) {
// Make sure there is enough delay before the touch is released so that it is
// recognized as a tap.
delegate->Reset();
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -2615,18 +2612,18 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
// Send release event after sufficient delay so that two finger time expires.
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.LeapForward(1000));
DispatchEventUsingWindowDispatcher(&release1);
@@ -2636,7 +2633,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapExpired) {
// Make sure there is enough delay before the touch is released so that it is
// recognized as a tap.
delegate->Reset();
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -2659,12 +2656,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
@@ -2675,7 +2672,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2690,12 +2687,12 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
@@ -2706,7 +2703,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapChangesToPinch) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2729,13 +2726,13 @@ TEST_F(GestureRecognizerTest, NoTwoFingerTapWhenFirstFingerHasScrolled) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
tes.SendScrollEvent(event_processor(), 130, 230, kTouchId1, delegate.get());
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
@@ -2744,7 +2741,7 @@ TEST_F(GestureRecognizerTest, NoTwoFingerTapWhenFirstFingerHasScrolled) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2830,17 +2827,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
delegate->Reset();
- ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201),
+ ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::PointF(130.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&cancel);
EXPECT_FALSE(delegate->two_finger_tap());
@@ -2848,7 +2845,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2862,17 +2859,17 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
delegate->Reset();
- ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201),
+ ui::TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&cancel);
EXPECT_FALSE(delegate->two_finger_tap());
@@ -2880,7 +2877,7 @@ TEST_F(GestureRecognizerTest, TwoFingerTapCancelled) {
// Make sure there is enough delay before the touch is released so that it
// is recognized as a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -2901,7 +2898,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_FALSE(delegate->tap());
@@ -2914,7 +2911,7 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) {
EXPECT_FALSE(delegate->two_finger_tap());
delegate->Reset();
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(430.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_FALSE(delegate->tap());
@@ -2928,8 +2925,8 @@ TEST_F(GestureRecognizerTest, VeryWideTwoFingerTouchDownShouldBeAPinch) {
EXPECT_FALSE(delegate->pinch_begin());
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(530, 301),
- kTouchId2, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(530.f, 301.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
@@ -2955,10 +2952,10 @@ TEST_F(GestureRecognizerTest, FlushAllOnHide) {
const int kTouchId2 = 2;
TimedEvents tes;
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(20.f, 20.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
window->Hide();
@@ -2979,7 +2976,7 @@ TEST_F(GestureRecognizerTest, LongPressTimerStopsOnPreventDefaultedTouchMoves) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
// Scroll around, to cancel the long press
@@ -3033,7 +3030,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(delegate->tap());
@@ -3060,7 +3057,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) {
// Release the touch back at the start point. This should end without causing
// a tap.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(130, 230),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(130.f, 230.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(delegate->tap());
@@ -3090,7 +3087,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) {
delegate.get(), -1234, bounds, root_window()));
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
tes.SendScrollEvent(event_processor(), 131, 231, kTouchId1, delegate.get());
@@ -3101,7 +3098,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) {
delegate->Reset();
// Second finger touches down and moves.
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&press2);
tes.SendScrollEvent(event_processor(), 161, 231, kTouchId2, delegate.get());
@@ -3125,9 +3122,9 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTwoFingerTouchMoveConsumed) {
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE);
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId1, tes.Now());
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(130, 201),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(130.f, 201.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&release1);
DispatchEventUsingWindowDispatcher(&release2);
@@ -3153,7 +3150,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(delegate->tap());
@@ -3223,7 +3220,7 @@ TEST_F(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) {
// Release the touch.
delegate->Reset();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(delegate->tap());
@@ -3251,19 +3248,19 @@ TEST_F(GestureRecognizerTest, GestureEventDoubleTap) {
TimedEvents tes;
// First tap (tested in GestureEventTap)
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(104.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(104.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
delegate->Reset();
// Second tap
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 203.f),
kTouchId, tes.LeapForward(200));
DispatchEventUsingWindowDispatcher(&press2);
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(102.f, 206.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -3292,10 +3289,10 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) {
TimedEvents tes;
// First tap (tested in GestureEventTap)
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(104, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(104.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(104, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(104.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
@@ -3303,10 +3300,10 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) {
delegate->Reset();
// Second tap (tested in GestureEventDoubleTap)
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 203),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 203.f),
kTouchId, tes.LeapForward(200));
DispatchEventUsingWindowDispatcher(&press2);
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(102.f, 206.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -3314,25 +3311,21 @@ TEST_F(GestureRecognizerTest, GestureEventTripleTap) {
delegate->Reset();
// Third tap
- ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(102, 206),
+ ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::PointF(102.f, 206.f),
kTouchId, tes.LeapForward(200));
DispatchEventUsingWindowDispatcher(&press3);
- ui::TouchEvent release3(ui::ET_TOUCH_RELEASED, gfx::Point(102, 206),
+ ui::TouchEvent release3(ui::ET_TOUCH_RELEASED, gfx::PointF(102.f, 206.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release3);
// Third, Fourth and Fifth Taps. Taps after the third should have their
// |tap_count| wrap around back to 1.
for (int i = 3; i < 5; ++i) {
- ui::TouchEvent press3(ui::ET_TOUCH_PRESSED,
- gfx::Point(102, 206),
- kTouchId,
- tes.LeapForward(200));
+ ui::TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::PointF(102.f, 206.f),
+ kTouchId, tes.LeapForward(200));
DispatchEventUsingWindowDispatcher(&press3);
- ui::TouchEvent release3(ui::ET_TOUCH_RELEASED,
- gfx::Point(102, 206),
- kTouchId,
- tes.LeapForward(50));
+ ui::TouchEvent release3(ui::ET_TOUCH_RELEASED, gfx::PointF(102.f, 206.f),
+ kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release3);
EXPECT_TRUE(delegate->tap());
@@ -3360,19 +3353,19 @@ TEST_F(GestureRecognizerTest, TwoTapsFarApart) {
TimedEvents tes;
// First tap (tested in GestureEventTap)
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
delegate->Reset();
// Second tap, close in time but far in distance
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(201, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(201.f, 201.f),
kTouchId, tes.LeapForward(200));
DispatchEventUsingWindowDispatcher(&press2);
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(201, 201),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(201.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -3402,19 +3395,19 @@ TEST_F(GestureRecognizerTest, TwoTapsWithDelayBetween) {
TimedEvents tes;
// First tap (tested in GestureEventTap)
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
delegate->Reset();
// Second tap, close in distance but after some delay
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(2000));
DispatchEventUsingWindowDispatcher(&press2);
- ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release2);
@@ -3444,16 +3437,15 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) {
delegate.get(), -1234, bounds, root_window()));
TimedEvents tes;
- ui::TouchEvent press1(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->bounding_box().IsEmpty());
delegate->Reset();
- ui::TouchEvent press2(
- ui::ET_TOUCH_PRESSED, gfx::Point(201, 201), kTouchId2,
- tes.LeapForward(400));
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(201.f, 201.f),
+ kTouchId2, tes.LeapForward(400));
press2.set_radius_x(5);
DispatchEventUsingWindowDispatcher(&press2);
EXPECT_FALSE(delegate->pinch_begin());
@@ -3462,7 +3454,7 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) {
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(50, 50), kTouchId,
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(50.f, 50.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_TRUE(delegate->pinch_begin());
@@ -3472,8 +3464,8 @@ TEST_F(GestureRecognizerTest, BoundingBoxRadiusChange) {
delegate->Reset();
// The position doesn't move, but the radius changes.
- ui::TouchEvent move2(
- ui::ET_TOUCH_MOVED, gfx::Point(50, 50), kTouchId, tes.LeapForward(40));
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(50.f, 50.f), kTouchId,
+ tes.LeapForward(40));
move2.set_radius_x(50);
move2.set_radius_y(60);
DispatchEventUsingWindowDispatcher(&move2);
@@ -3500,21 +3492,21 @@ TEST_F(GestureRecognizerTest, NoDriftInScroll) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press1(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 208), kTouchId, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 208.f),
+ kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->begin());
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(101, 206), kTouchId,
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(101.f, 206.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_FALSE(delegate->scroll_begin());
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 204), kTouchId,
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(101.f, 204.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_TRUE(delegate->tap_cancel());
@@ -3526,14 +3518,14 @@ TEST_F(GestureRecognizerTest, NoDriftInScroll) {
delegate->Reset();
- ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(101, 204), kTouchId,
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(101.f, 204.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move3);
EXPECT_FALSE(delegate->scroll_update());
delegate->Reset();
- ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(101, 203), kTouchId,
+ ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::PointF(101.f, 203.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move4);
EXPECT_TRUE(delegate->scroll_update());
@@ -3555,7 +3547,7 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveCanFireTapCancel) {
TimedEvents tes;
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
delegate->set_consume_touch_move(false);
@@ -3593,20 +3585,20 @@ TEST_F(GestureRecognizerTest, CancelAllActiveTouches) {
// Start a gesture sequence on |window|. Then cancel all touches.
// Make sure |window| receives a touch-cancel event.
delegate->Reset();
- ui::TouchEvent press(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 201), kTouchId1, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_2_EVENTS(
delegate->events(), ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_TAP_DOWN);
delegate->Reset();
- ui::TouchEvent p2(
- ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), kTouchId2, tes.Now());
+ ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::PointF(50.f, 50.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&p2);
EXPECT_2_EVENTS(
delegate->events(), ui::ET_GESTURE_TAP_CANCEL, ui::ET_GESTURE_BEGIN);
delegate->Reset();
- ui::TouchEvent move(
- ui::ET_TOUCH_MOVED, gfx::Point(350, 300), kTouchId2, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(350.f, 300.f), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
EXPECT_3_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_BEGIN,
@@ -3630,8 +3622,8 @@ TEST_F(GestureRecognizerTest, CancelAllActiveTouches) {
ui::ET_GESTURE_END);
const std::vector<gfx::PointF>& points = handler->cancelled_touch_points();
EXPECT_EQ(2U, points.size());
- EXPECT_EQ(gfx::Point(101, 201), points[0]);
- EXPECT_EQ(gfx::Point(350, 300), points[1]);
+ EXPECT_EQ(gfx::PointF(101.f, 201.f), points[0]);
+ EXPECT_EQ(gfx::PointF(350.f, 300.f), points[1]);
}
// Check that appropriate touch events generate show press events
@@ -3648,7 +3640,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPress) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
@@ -3664,7 +3656,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPress) {
EXPECT_FALSE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->long_press());
@@ -3688,7 +3680,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressCancelledByScroll) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
@@ -3705,7 +3697,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressCancelledByScroll) {
EXPECT_TRUE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(10));
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_FALSE(delegate->show_press());
@@ -3726,7 +3718,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressSentOnTap) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
@@ -3736,7 +3728,7 @@ TEST_F(GestureRecognizerTest, GestureEventShowPressSentOnTap) {
EXPECT_FALSE(delegate->tap_cancel());
delegate->Reset();
- ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release1);
EXPECT_TRUE(delegate->show_press());
@@ -3755,21 +3747,21 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveScrollTest) {
delegate.get(), -1234, bounds, root_window()));
delegate->set_window(window.get());
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(0.f, 0.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
delegate->ReceivedAck();
// A touch move within the slop region is never consumed in web contents. The
// unified GR won't prevent scroll if a touch move within the slop region is
// consumed, so make sure this touch move exceeds the slop region.
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(10, 10),
- kTouchId, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(10.f, 10.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
delegate->ReceivedAckPreventDefaulted();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20),
- kTouchId, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(20.f, 20.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
delegate->ReceivedAck();
@@ -3790,18 +3782,18 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveTapTest) {
delegate.get(), -1234, bounds, root_window()));
delegate->set_window(window.get());
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(0.f, 0.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
delegate->ReceivedAck();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(2, 2),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(2.f, 2.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->ReceivedAckPreventDefaulted();
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(2, 2),
- kTouchId, tes.LeapForward(50));
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(2.f, 2.f), kTouchId,
+ tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
delegate->ReceivedAck();
@@ -3823,13 +3815,13 @@ TEST_F(GestureRecognizerTest, GestureEventConsumedTouchMoveLongPressTest) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->ReceivedAck();
- ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(103, 203),
- kTouchId, tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::PointF(103.f, 203.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move);
delegate->ReceivedAckPreventDefaulted();
@@ -3852,14 +3844,14 @@ TEST_F(GestureRecognizerTest, TestExceedingSlopSlowly) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press(
- ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId, tes.Now());
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press);
EXPECT_FALSE(delegate->scroll_begin());
EXPECT_FALSE(delegate->scroll_update());
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(11, 10), kTouchId,
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(11.f, 10.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_FALSE(delegate->scroll_begin());
@@ -3868,7 +3860,7 @@ TEST_F(GestureRecognizerTest, TestExceedingSlopSlowly) {
EXPECT_EQ(0, delegate->scroll_x_hint());
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(12, 10), kTouchId,
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(12.f, 10.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_FALSE(delegate->scroll_begin());
@@ -3887,7 +3879,7 @@ TEST_F(GestureRecognizerTest, TestExceedingSlopSlowly) {
EXPECT_FLOAT_EQ(3.1f, delegate->scroll_x_hint());
delegate->Reset();
- ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(14, 10), kTouchId,
+ ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::PointF(14.f, 10.f), kTouchId,
tes.LeapForward(40));
DispatchEventUsingWindowDispatcher(&move4);
EXPECT_FALSE(delegate->scroll_begin());
@@ -3914,8 +3906,8 @@ TEST_F(GestureRecognizerTest, ScrollAlternatelyConsumedTest) {
int x = 0;
int y = 0;
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(x, y),
- kTouchId, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(x, y), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->ReceivedAck();
EXPECT_FALSE(delegate->scroll_begin());
@@ -3924,8 +3916,8 @@ TEST_F(GestureRecognizerTest, ScrollAlternatelyConsumedTest) {
x += 100;
y += 100;
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(x, y),
- kTouchId, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
delegate->ReceivedAck();
EXPECT_TRUE(delegate->scroll_begin());
@@ -3935,8 +3927,8 @@ TEST_F(GestureRecognizerTest, ScrollAlternatelyConsumedTest) {
for (int i = 0; i < 3; ++i) {
x += 10;
y += 10;
- ui::TouchEvent move2(
- ui::ET_TOUCH_MOVED, gfx::Point(x, y), kTouchId, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
delegate->ReceivedAck();
EXPECT_FALSE(delegate->scroll_begin());
@@ -3947,8 +3939,8 @@ TEST_F(GestureRecognizerTest, ScrollAlternatelyConsumedTest) {
x += 20;
y += 20;
- ui::TouchEvent move3(
- ui::ET_TOUCH_MOVED, gfx::Point(x, y), kTouchId, tes.Now());
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
delegate->ReceivedAckPreventDefaulted();
EXPECT_FALSE(delegate->scroll_begin());
@@ -3971,8 +3963,8 @@ TEST_F(GestureRecognizerTest, PinchAlternatelyConsumedTest) {
delegate->set_window(window.get());
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
- kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(0.f, 0.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->ReceivedAck();
EXPECT_FALSE(delegate->scroll_begin());
@@ -3982,8 +3974,8 @@ TEST_F(GestureRecognizerTest, PinchAlternatelyConsumedTest) {
int x = 0;
int y = 0;
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(x, y),
- kTouchId2, tes.Now());
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(x, y), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
delegate->ReceivedAck();
EXPECT_FALSE(delegate->scroll_begin());
@@ -3995,8 +3987,8 @@ TEST_F(GestureRecognizerTest, PinchAlternatelyConsumedTest) {
x += 100;
y += 100;
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(x, y),
- kTouchId2, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
delegate->ReceivedAck();
EXPECT_TRUE(delegate->scroll_begin());
@@ -4010,8 +4002,8 @@ TEST_F(GestureRecognizerTest, PinchAlternatelyConsumedTest) {
for (int i = 0; i < 3; ++i) {
x += 50;
y += 50;
- ui::TouchEvent move2(
- ui::ET_TOUCH_MOVED, gfx::Point(x, y), kTouchId2, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
delegate->ReceivedAck();
EXPECT_FALSE(delegate->scroll_begin());
@@ -4027,8 +4019,8 @@ TEST_F(GestureRecognizerTest, PinchAlternatelyConsumedTest) {
x += 100;
y += 100;
- ui::TouchEvent move3(
- ui::ET_TOUCH_MOVED, gfx::Point(x, y), kTouchId2, tes.Now());
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(x, y), kTouchId2,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
delegate->ReceivedAckPreventDefaulted();
EXPECT_FALSE(delegate->scroll_begin());
@@ -4055,15 +4047,15 @@ TEST_F(GestureRecognizerTest, GestureEventFlagsPassedFromTouchEvent) {
delegate->Reset();
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(delegate->tap_down());
int default_flags = delegate->flags();
- ui::TouchEvent move1(
- ui::ET_TOUCH_MOVED, gfx::Point(397, 149), kTouchId, tes.LeapForward(50));
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(397.f, 149.f), kTouchId,
+ tes.LeapForward(50));
move1.set_flags(992);
DispatchEventUsingWindowDispatcher(&move1);
@@ -4104,10 +4096,8 @@ TEST_F(GestureRecognizerTest, GestureEventLongPressDeletingWindow) {
&delegate, -1234, bounds, root_window()));
delegate.set_window(&window);
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED,
- gfx::Point(101, 201),
- kTouchId,
- ui::EventTimeForNow());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
+ kTouchId, ui::EventTimeForNow());
DispatchEventUsingWindowDispatcher(&press1);
EXPECT_TRUE(window != NULL);
@@ -4128,17 +4118,17 @@ TEST_F(GestureRecognizerWithSwitchTest, GestureEventSmallPinchDisabled) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
- kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 301.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
// Move the first finger.
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(65, 201),
- kTouchId1, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 201.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_3_EVENTS(delegate->events(),
@@ -4149,8 +4139,8 @@ TEST_F(GestureRecognizerWithSwitchTest, GestureEventSmallPinchDisabled) {
// No pinch update occurs, as kCompensateForUnstablePinchZoom is on and
// |min_pinch_update_span_delta| was nonzero, and this is a very small pinch.
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(65, 202),
- kTouchId1, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 202.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE);
}
@@ -4167,17 +4157,17 @@ TEST_F(GestureRecognizerTest, GestureEventSmallPinchEnabled) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, bounds, root_window()));
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
- kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 301.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
+ ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::PointF(10.f, 10.f),
kTouchId2, tes.Now());
DispatchEventUsingWindowDispatcher(&press2);
// Move the first finger.
delegate->Reset();
- ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(65, 201),
- kTouchId1, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 201.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
EXPECT_3_EVENTS(delegate->events(),
@@ -4186,8 +4176,8 @@ TEST_F(GestureRecognizerTest, GestureEventSmallPinchEnabled) {
ui::ET_GESTURE_PINCH_BEGIN);
delegate->Reset();
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(65, 202),
- kTouchId1, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 202.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_2_EVENTS(delegate->events(),
ui::ET_GESTURE_SCROLL_UPDATE,
@@ -4207,10 +4197,10 @@ TEST_F(GestureRecognizerTest, EagerGestureDetection) {
delegate->set_window(window.get());
delegate->Reset();
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 201.f),
kTouchId, tes.Now());
DispatchEventUsingWindowDispatcher(&press);
- ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::PointF(101.f, 201.f),
kTouchId, tes.LeapForward(50));
DispatchEventUsingWindowDispatcher(&release);
@@ -4243,8 +4233,8 @@ TEST_F(GestureRecognizerTest, IgnoredEventsDontBreakGestureRecognition) {
delegate.get(), -1234, bounds, root_window()));
delegate->set_window(window.get());
- ui::TouchEvent press1(
- ui::ET_TOUCH_PRESSED, gfx::Point(101, 301), kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(101.f, 301.f),
+ kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->ReceivedAck();
@@ -4253,8 +4243,8 @@ TEST_F(GestureRecognizerTest, IgnoredEventsDontBreakGestureRecognition) {
// Move the first finger.
delegate->Reset();
- ui::TouchEvent move1(
- ui::ET_TOUCH_MOVED, gfx::Point(65, 201), kTouchId1, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 201.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
delegate->ReceivedAck();
@@ -4266,15 +4256,15 @@ TEST_F(GestureRecognizerTest, IgnoredEventsDontBreakGestureRecognition) {
delegate->Reset();
// Send a valid event, but don't ack it.
- ui::TouchEvent move2(
- ui::ET_TOUCH_MOVED, gfx::Point(65, 202), kTouchId1, tes.Now());
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 202.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_0_EVENTS(delegate->events());
// Send a touchmove event at the same location as the previous touchmove
// event. This shouldn't do anything.
- ui::TouchEvent move3(
- ui::ET_TOUCH_MOVED, gfx::Point(65, 202), kTouchId1, tes.Now());
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(65.f, 202.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
// Ack the previous valid event. The intermediary invalid event shouldn't
@@ -4298,38 +4288,38 @@ TEST_F(GestureRecognizerTest,
delegate->set_window(window.get());
// Start a scroll gesture.
- ui::TouchEvent press1(
- ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), kTouchId1, tes.Now());
+ ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::PointF(0.f, 0.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&press1);
delegate->ReceivedAck();
- ui::TouchEvent move1(
- ui::ET_TOUCH_MOVED, gfx::Point(100, 100), kTouchId1, tes.Now());
+ ui::TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::PointF(100.f, 100.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move1);
delegate->ReceivedAck();
delegate->Reset();
// Dispatch a synchronously consumed touch move, which should be ignored.
delegate->set_synchronous_ack_for_next_event(true);
- ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(200, 200), kTouchId1,
+ ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::PointF(200.f, 200.f), kTouchId1,
tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
EXPECT_0_EVENTS(delegate->events());
// Dispatch a touch move, but don't ack it.
- ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(300, 300), kTouchId1,
+ ui::TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::PointF(300.f, 300.f), kTouchId1,
tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
// Dispatch two synchronously consumed touch moves, which should be ignored.
delegate->set_synchronous_ack_for_next_event(true);
- ui::TouchEvent move4(
- ui::ET_TOUCH_MOVED, gfx::Point(400, 400), kTouchId1, tes.Now());
+ ui::TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::PointF(400.f, 400.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move4);
delegate->set_synchronous_ack_for_next_event(true);
- ui::TouchEvent move5(
- ui::ET_TOUCH_MOVED, gfx::Point(500, 500), kTouchId1, tes.Now());
+ ui::TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::PointF(500.f, 500.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move5);
EXPECT_0_EVENTS(delegate->events());
@@ -4342,14 +4332,14 @@ TEST_F(GestureRecognizerTest,
// Dispatch a touch move, but don't ack it.
delegate->Reset();
- ui::TouchEvent move6(ui::ET_TOUCH_MOVED, gfx::Point(600, 600), kTouchId1,
+ ui::TouchEvent move6(ui::ET_TOUCH_MOVED, gfx::PointF(600.f, 600.f), kTouchId1,
tes.Now());
DispatchEventUsingWindowDispatcher(&move6);
// Dispatch a synchronously unconsumed touch move.
delegate->set_synchronous_ack_for_next_event(false);
- ui::TouchEvent move7(
- ui::ET_TOUCH_MOVED, gfx::Point(700, 700), kTouchId1, tes.Now());
+ ui::TouchEvent move7(ui::ET_TOUCH_MOVED, gfx::PointF(700.f, 700.f), kTouchId1,
+ tes.Now());
DispatchEventUsingWindowDispatcher(&move7);
// The synchronous ack is stuck behind the pending touch move.

Powered by Google App Engine
This is Rietveld 408576698