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

Unified Diff: ui/chromeos/touch_exploration_controller_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, 7 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/chromeos/touch_exploration_controller_unittest.cc
diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc
index 651dd12ac2e92fcb447ccc99225e0291da52fa82..c05bd3d9019798bad0f0a63bf3d22a812bd7afdf 100644
--- a/ui/chromeos/touch_exploration_controller_unittest.cc
+++ b/ui/chromeos/touch_exploration_controller_unittest.cc
@@ -388,11 +388,10 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
return touch_exploration_controller_->GetSlopDistanceFromEdge();
}
- base::TimeDelta Now() {
+ base::TimeTicks Now() {
// This is the same as what EventTimeForNow() does, but here we do it
// with our simulated clock.
- return base::TimeDelta::FromInternalValue(
- simulated_clock_->NowTicks().ToInternalValue());
+ return simulated_clock_->NowTicks();
}
std::unique_ptr<test::EventGenerator> generator_;
@@ -836,10 +835,10 @@ TEST_F(TouchExplorationTest, DoubleTapLongPress) {
ASSERT_EQ(2U, captured_events.size());
EXPECT_EQ(ui::ET_TOUCH_PRESSED, captured_events[0]->type());
EXPECT_EQ(tap_location, captured_events[0]->location());
- base::TimeDelta pressed_time = captured_events[0]->time_stamp();
+ base::TimeTicks pressed_time = captured_events[0]->time_stamp();
EXPECT_EQ(ui::ET_TOUCH_RELEASED, captured_events[1]->type());
EXPECT_EQ(tap_location, captured_events[1]->location());
- base::TimeDelta released_time = captured_events[1]->time_stamp();
+ base::TimeTicks released_time = captured_events[1]->time_stamp();
EXPECT_EQ(released_time - pressed_time,
gesture_detector_config_.longpress_timeout);
}
@@ -1047,10 +1046,10 @@ TEST_F(TouchExplorationTest, SplitTapLongPress) {
ASSERT_EQ(2U, captured_events.size());
EXPECT_EQ(ui::ET_TOUCH_PRESSED, captured_events[0]->type());
EXPECT_EQ(initial_touch_location, captured_events[0]->location());
- base::TimeDelta pressed_time = captured_events[0]->time_stamp();
+ base::TimeTicks pressed_time = captured_events[0]->time_stamp();
EXPECT_EQ(ui::ET_TOUCH_RELEASED, captured_events[1]->type());
EXPECT_EQ(initial_touch_location, captured_events[1]->location());
- base::TimeDelta released_time = captured_events[1]->time_stamp();
+ base::TimeTicks released_time = captured_events[1]->time_stamp();
EXPECT_EQ(gesture_detector_config_.longpress_timeout,
released_time - pressed_time);
}
@@ -1094,10 +1093,10 @@ TEST_F(TouchExplorationTest, SplitTapReleaseLongPress) {
ASSERT_EQ(2U, captured_events.size());
EXPECT_EQ(ui::ET_TOUCH_PRESSED, captured_events[0]->type());
EXPECT_EQ(initial_touch_location, captured_events[0]->location());
- base::TimeDelta pressed_time = captured_events[0]->time_stamp();
+ base::TimeTicks pressed_time = captured_events[0]->time_stamp();
EXPECT_EQ(ui::ET_TOUCH_RELEASED, captured_events[1]->type());
EXPECT_EQ(initial_touch_location, captured_events[1]->location());
- base::TimeDelta released_time = captured_events[1]->time_stamp();
+ base::TimeTicks released_time = captured_events[1]->time_stamp();
EXPECT_EQ(gesture_detector_config_.longpress_timeout,
released_time - pressed_time);
}

Powered by Google App Engine
This is Rietveld 408576698