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

Unified Diff: ui/views/widget/root_view_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/views/widget/root_view_unittest.cc
diff --git a/ui/views/widget/root_view_unittest.cc b/ui/views/widget/root_view_unittest.cc
index 26a9b3d9495782568874d479d9ca7c85502ba19a..7c414a29223d4dc09eedc40c071a445ad25f68d8 100644
--- a/ui/views/widget/root_view_unittest.cc
+++ b/ui/views/widget/root_view_unittest.cc
@@ -202,15 +202,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) {
// |parent_view| should not show a context menu as a result of a long press on
// |gesture_handling_child_view|.
ui::GestureEvent long_press1(
- 5,
- 5,
- 0,
- base::TimeDelta(),
+ 5, 5, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
ui::EventDispatchDetails details = root_view->OnEventFromSource(&long_press1);
- ui::GestureEvent end1(
- 5, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end1(5, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end1);
EXPECT_FALSE(details.target_destroyed);
@@ -221,15 +218,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) {
// |parent_view| should show a context menu as a result of a long press on
// |other_child_view|.
ui::GestureEvent long_press2(
- 25,
- 5,
- 0,
- base::TimeDelta(),
+ 25, 5, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
details = root_view->OnEventFromSource(&long_press2);
- ui::GestureEvent end2(
- 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end2(25, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end2);
EXPECT_FALSE(details.target_destroyed);
@@ -240,15 +234,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) {
// |parent_view| should show a context menu as a result of a long press on
// itself.
ui::GestureEvent long_press3(
- 50,
- 50,
- 0,
- base::TimeDelta(),
+ 50, 50, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
details = root_view->OnEventFromSource(&long_press3);
- ui::GestureEvent end3(
- 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end3(25, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end3);
EXPECT_FALSE(details.target_destroyed);
@@ -287,15 +278,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) {
// |parent_view| should not show a context menu as a result of a long press on
// |gesture_handling_child_view|.
ui::GestureEvent long_press1(
- 5,
- 5,
- 0,
- base::TimeDelta(),
+ 5, 5, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
ui::EventDispatchDetails details = root_view->OnEventFromSource(&long_press1);
- ui::GestureEvent end1(
- 5, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end1(5, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end1);
EXPECT_FALSE(details.target_destroyed);
@@ -306,15 +294,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) {
// |parent_view| should not show a context menu as a result of a long press on
// |other_child_view|.
ui::GestureEvent long_press2(
- 25,
- 5,
- 0,
- base::TimeDelta(),
+ 25, 5, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
details = root_view->OnEventFromSource(&long_press2);
- ui::GestureEvent end2(
- 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end2(25, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end2);
EXPECT_FALSE(details.target_destroyed);
@@ -325,15 +310,12 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) {
// |parent_view| should not show a context menu as a result of a long press on
// itself.
ui::GestureEvent long_press3(
- 50,
- 50,
- 0,
- base::TimeDelta(),
+ 50, 50, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS));
details = root_view->OnEventFromSource(&long_press3);
- ui::GestureEvent end3(
- 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END));
+ ui::GestureEvent end3(25, 5, 0, base::TimeTicks(),
+ ui::GestureEventDetails(ui::ET_GESTURE_END));
details = root_view->OnEventFromSource(&end3);
EXPECT_FALSE(details.target_destroyed);

Powered by Google App Engine
This is Rietveld 408576698