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

Unified Diff: ui/events/gestures/motion_event_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/gestures/motion_event_aura.cc ('k') | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/motion_event_aura_unittest.cc
diff --git a/ui/events/gestures/motion_event_aura_unittest.cc b/ui/events/gestures/motion_event_aura_unittest.cc
index 6cd5a2767d3a9081690c9626fc1ca453ec88e7c8..0ff715b95886683d83b53a8cdd62b53efb0ecb82 100644
--- a/ui/events/gestures/motion_event_aura_unittest.cc
+++ b/ui/events/gestures/motion_event_aura_unittest.cc
@@ -15,8 +15,8 @@
namespace {
ui::TouchEvent TouchWithType(ui::EventType type, int id) {
- return ui::TouchEvent(
- type, gfx::PointF(0, 0), id, base::TimeDelta::FromMilliseconds(0));
+ return ui::TouchEvent(type, gfx::Point(0, 0), id,
+ base::TimeDelta::FromMilliseconds(0));
}
ui::TouchEvent TouchWithPosition(ui::EventType type,
@@ -25,16 +25,10 @@ ui::TouchEvent TouchWithPosition(ui::EventType type,
float y,
float raw_x,
float raw_y) {
- ui::TouchEvent event(type,
- gfx::PointF(x, y),
- 0,
- id,
- base::TimeDelta::FromMilliseconds(0),
- 0,
- 0,
- 0,
- 0);
- event.set_root_location(gfx::PointF(raw_x, raw_y));
+ ui::TouchEvent event(type, gfx::Point(), 0, id,
+ base::TimeDelta::FromMilliseconds(0), 0, 0, 0, 0);
+ event.set_location_f(gfx::PointF(x, y));
+ event.set_root_location_f(gfx::PointF(raw_x, raw_y));
return event;
}
@@ -44,22 +38,15 @@ ui::TouchEvent TouchWithTapParams(ui::EventType type,
float radius_y,
float rotation_angle,
float pressure) {
- ui::TouchEvent event(type,
- gfx::PointF(1, 1),
- 0,
- id,
- base::TimeDelta::FromMilliseconds(0),
- radius_x,
- radius_y,
- rotation_angle,
- pressure);
- event.set_root_location(gfx::PointF(1, 1));
+ ui::TouchEvent event(type, gfx::Point(1, 1), 0, id,
+ base::TimeDelta::FromMilliseconds(0), radius_x, radius_y,
+ rotation_angle, pressure);
return event;
}
ui::TouchEvent TouchWithTime(ui::EventType type, int id, int ms) {
- return ui::TouchEvent(
- type, gfx::PointF(0, 0), id, base::TimeDelta::FromMilliseconds(ms));
+ return ui::TouchEvent(type, gfx::Point(0, 0), id,
+ base::TimeDelta::FromMilliseconds(ms));
}
base::TimeTicks MsToTicks(int ms) {
@@ -360,7 +347,7 @@ TEST(MotionEventAuraTest, Timestamps) {
TouchEvent move0 = TouchWithTime(
ui::ET_TOUCH_MOVED, ids[0], times_in_ms[2]);
- move0.set_location(gfx::PointF(12, 21));
+ move0.set_location(gfx::Point(12, 21));
EXPECT_TRUE(event.OnTouch(move0));
EXPECT_EQ(MsToTicks(times_in_ms[2]), event.GetEventTime());
@@ -391,7 +378,7 @@ TEST(MotionEventAuraTest, CachedAction) {
EXPECT_EQ(1, clone->GetActionIndex());
TouchEvent move0 = TouchWithType(ET_TOUCH_MOVED, ids[0]);
- move0.set_location(gfx::PointF(10, 12));
+ move0.set_location(gfx::Point(10, 12));
EXPECT_TRUE(event.OnTouch(move0));
EXPECT_EQ(MotionEvent::ACTION_MOVE, event.GetAction());
EXPECT_EQ(2U, event.GetPointerCount());
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | ui/events/ozone/evdev/event_factory_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698