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

Unified Diff: ui/events/gestures/gesture_provider_aura_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-event: mandol_line Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/events/gestures/gesture_recognizer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/gesture_provider_aura_unittest.cc
diff --git a/ui/events/gestures/gesture_provider_aura_unittest.cc b/ui/events/gestures/gesture_provider_aura_unittest.cc
index 79e06a8dc95fb9d9238550310622b54e11a79eb0..3dffa70565bcd468317ce0c120052ab1c8c4c5c6 100644
--- a/ui/events/gestures/gesture_provider_aura_unittest.cc
+++ b/ui/events/gestures/gesture_provider_aura_unittest.cc
@@ -32,11 +32,11 @@ class GestureProviderAuraTest : public testing::Test,
TEST_F(GestureProviderAuraTest, IgnoresExtraPressEvents) {
base::TimeDelta time = ui::EventTimeForNow();
- TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time);
+ TouchEvent press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, time);
EXPECT_TRUE(provider()->OnTouchEvent(&press1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent press2(ET_TOUCH_PRESSED, gfx::PointF(30, 40), 0, time);
+ TouchEvent press2(ET_TOUCH_PRESSED, gfx::Point(30, 40), 0, time);
// TODO(tdresser): this redundant press with same id should be
// ignored; however, there is at least one case where we need to
// allow a touch press from a currently used touch id. See
@@ -46,19 +46,19 @@ TEST_F(GestureProviderAuraTest, IgnoresExtraPressEvents) {
TEST_F(GestureProviderAuraTest, IgnoresExtraMoveOrReleaseEvents) {
base::TimeDelta time = ui::EventTimeForNow();
- TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time);
+ TouchEvent press1(ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, time);
EXPECT_TRUE(provider()->OnTouchEvent(&press1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent release1(ET_TOUCH_RELEASED, gfx::PointF(30, 40), 0, time);
+ TouchEvent release1(ET_TOUCH_RELEASED, gfx::Point(30, 40), 0, time);
EXPECT_TRUE(provider()->OnTouchEvent(&release1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent release2(ET_TOUCH_RELEASED, gfx::PointF(30, 45), 0, time);
+ TouchEvent release2(ET_TOUCH_RELEASED, gfx::Point(30, 45), 0, time);
EXPECT_FALSE(provider()->OnTouchEvent(&release1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent move1(ET_TOUCH_MOVED, gfx::PointF(70, 75), 0, time);
+ TouchEvent move1(ET_TOUCH_MOVED, gfx::Point(70, 75), 0, time);
EXPECT_FALSE(provider()->OnTouchEvent(&move1));
}
@@ -71,83 +71,45 @@ TEST_F(GestureProviderAuraTest, IgnoresIdenticalMoveEvents) {
const int kTouchId1 = 3;
base::TimeDelta time = ui::EventTimeForNow();
- TouchEvent press0_1(ET_TOUCH_PRESSED, gfx::PointF(9, 10), kTouchId0, time);
+ TouchEvent press0_1(ET_TOUCH_PRESSED, gfx::Point(9, 10), kTouchId0, time);
EXPECT_TRUE(provider()->OnTouchEvent(&press0_1));
- TouchEvent press1_1(ET_TOUCH_PRESSED, gfx::PointF(40, 40), kTouchId1, time);
+ TouchEvent press1_1(ET_TOUCH_PRESSED, gfx::Point(40, 40), kTouchId1, time);
EXPECT_TRUE(provider()->OnTouchEvent(&press1_1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent move0_1(ET_TOUCH_MOVED,
- gfx::PointF(10, 10),
- 0,
- kTouchId0,
- time,
- kRadiusX,
- kRadiusY,
- kAngle,
- kForce);
+ TouchEvent move0_1(ET_TOUCH_MOVED, gfx::Point(10, 10), 0, kTouchId0, time,
+ kRadiusX, kRadiusY, kAngle, kForce);
EXPECT_TRUE(provider()->OnTouchEvent(&move0_1));
- TouchEvent move1_1(ET_TOUCH_MOVED,
- gfx::PointF(100, 200),
- 0,
- kTouchId1,
- time,
- kRadiusX,
- kRadiusY,
- kAngle,
- kForce);
+ TouchEvent move1_1(ET_TOUCH_MOVED, gfx::Point(100, 200), 0, kTouchId1, time,
+ kRadiusX, kRadiusY, kAngle, kForce);
EXPECT_TRUE(provider()->OnTouchEvent(&move1_1));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent move0_2(ET_TOUCH_MOVED,
- gfx::PointF(10, 10),
- 0,
- kTouchId0,
- time,
- kRadiusX,
- kRadiusY,
- kAngle,
- kForce);
+ TouchEvent move0_2(ET_TOUCH_MOVED, gfx::Point(10, 10), 0, kTouchId0, time,
+ kRadiusX, kRadiusY, kAngle, kForce);
// Nothing has changed, so ignore the move.
EXPECT_FALSE(provider()->OnTouchEvent(&move0_2));
- TouchEvent move1_2(ET_TOUCH_MOVED,
- gfx::PointF(100, 200),
- 0,
- kTouchId1,
- time,
- kRadiusX,
- kRadiusY,
- kAngle,
- kForce);
+ TouchEvent move1_2(ET_TOUCH_MOVED, gfx::Point(100, 200), 0, kTouchId1, time,
+ kRadiusX, kRadiusY, kAngle, kForce);
// Nothing has changed, so ignore the move.
EXPECT_FALSE(provider()->OnTouchEvent(&move1_2));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent move0_3(ET_TOUCH_MOVED,
- gfx::PointF(70, 75.1f),
- 0,
- kTouchId0,
- time,
- kRadiusX,
- kRadiusY,
- kAngle,
- kForce);
+ TouchEvent move0_3(ET_TOUCH_MOVED, gfx::Point(), 0, kTouchId0, time, kRadiusX,
+ kRadiusY, kAngle, kForce);
+ move0_3.set_location_f(gfx::PointF(70, 75.1f));
+ move0_3.set_root_location_f(gfx::PointF(70, 75.1f));
// Position has changed, so don't ignore the move.
EXPECT_TRUE(provider()->OnTouchEvent(&move0_3));
time += base::TimeDelta::FromMilliseconds(10);
- TouchEvent move0_4(ET_TOUCH_MOVED,
- gfx::PointF(70, 75.1f),
- 0,
- kTouchId0,
- time,
- kRadiusX,
- kRadiusY + 1,
- kAngle,
- kForce);
+ TouchEvent move0_4(ET_TOUCH_MOVED, gfx::Point(), 0, kTouchId0, time, kRadiusX,
+ kRadiusY + 1, kAngle, kForce);
+ move0_4.set_location_f(gfx::PointF(70, 75.1f));
+ move0_4.set_root_location_f(gfx::PointF(70, 75.1f));
}
// TODO(jdduke): Test whether event marked as scroll trigger.
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/events/gestures/gesture_recognizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698