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

Unified Diff: ui/events/gestures/motion_event_aura_unittest.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | ui/events/mojo/event_struct_traits.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 8ada5f6d19a76dd0623e46e82c61fdab82d6189d..b7df75a6903ef6a90c4307351ba4a27893198a64 100644
--- a/ui/events/gestures/motion_event_aura_unittest.cc
+++ b/ui/events/gestures/motion_event_aura_unittest.cc
@@ -15,8 +15,7 @@
namespace {
ui::TouchEvent TouchWithType(ui::EventType type, int id) {
- return ui::TouchEvent(type, gfx::Point(0, 0), id,
- base::TimeDelta::FromMilliseconds(0));
+ return ui::TouchEvent(type, gfx::Point(0, 0), id, base::TimeTicks());
}
ui::TouchEvent TouchWithPosition(ui::EventType type,
@@ -25,8 +24,8 @@ ui::TouchEvent TouchWithPosition(ui::EventType type,
float y,
float raw_x,
float raw_y) {
- ui::TouchEvent event(type, gfx::Point(), 0, id,
- base::TimeDelta::FromMilliseconds(0), 0, 0, 0, 0);
+ ui::TouchEvent event(type, gfx::Point(), 0, id, base::TimeTicks(), 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;
@@ -38,21 +37,19 @@ ui::TouchEvent TouchWithTapParams(ui::EventType type,
float radius_y,
float rotation_angle,
float pressure) {
- ui::TouchEvent event(type, gfx::Point(1, 1), 0, id,
- base::TimeDelta::FromMilliseconds(0), radius_x, radius_y,
- rotation_angle, pressure);
+ ui::TouchEvent event(type, gfx::Point(1, 1), 0, id, base::TimeTicks(),
+ radius_x, radius_y, rotation_angle, pressure);
return event;
}
-ui::TouchEvent TouchWithTime(ui::EventType type, int id, int ms) {
- return ui::TouchEvent(type, gfx::Point(0, 0), id,
- base::TimeDelta::FromMilliseconds(ms));
-}
-
base::TimeTicks MsToTicks(int ms) {
return base::TimeTicks() + base::TimeDelta::FromMilliseconds(ms);
}
+ui::TouchEvent TouchWithTime(ui::EventType type, int id, int ms) {
+ return ui::TouchEvent(type, gfx::Point(0, 0), id, MsToTicks(ms));
+}
+
} // namespace
namespace ui {
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | ui/events/mojo/event_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698