| Index: ash/wm/system_gesture_event_filter_unittest.cc
|
| diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
|
| index fa93f8fc748f3364e5afeccfba1524b0a71c4ed4..abde0e6d3fca1cb7452fc42f419f633981a70ff8 100644
|
| --- a/ash/wm/system_gesture_event_filter_unittest.cc
|
| +++ b/ash/wm/system_gesture_event_filter_unittest.cc
|
| @@ -25,6 +25,7 @@
|
| #include "ui/aura/test/event_generator.h"
|
| #include "ui/aura/test/test_windows.h"
|
| #include "ui/base/events/event.h"
|
| +#include "ui/base/events/event_utils.h"
|
| #include "ui/base/hit_test.h"
|
| #include "ui/base/ui_base_switches.h"
|
| #include "ui/gfx/screen.h"
|
| @@ -243,8 +244,10 @@ TEST_F(SystemGestureEventFilterTest, TapOutsideRootWindow) {
|
| const int kTouchId = 5;
|
|
|
| // A touch outside the root window will be associated with the root window
|
| - ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(-10, -10), kTouchId,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
|
| + gfx::Point(-10, -10),
|
| + kTouchId,
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
|
|
| scoped_ptr<ui::GestureEvent> event(CreateGesture(
|
| @@ -278,7 +281,7 @@ void MoveToDeviceControlBezelStartPosition(
|
| ui::TouchEvent press1(ui::ET_TOUCH_PRESSED,
|
| gfx::Point(-10, ypos + ypos_half),
|
| touch_id,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
|
|
|
| // There is a noise filter which will require several calls before it
|
| @@ -401,9 +404,10 @@ TEST_F(SystemGestureEventFilterTest, DeviceControl) {
|
| EXPECT_TRUE(consumed);
|
| EXPECT_EQ(2, delegate->handle_percent_count());
|
|
|
| - ui::TouchEvent release(
|
| - ui::ET_TOUCH_RELEASED, gfx::Point(2 * xpos, ypos + ypos_half), kTouchId,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + ui::TouchEvent release(ui::ET_TOUCH_RELEASED,
|
| + gfx::Point(2 * xpos, ypos + ypos_half),
|
| + kTouchId,
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
|
|
|
| // Check that huge changes will be interpreted as noise as well.
|
| @@ -464,9 +468,9 @@ TEST_F(SystemGestureEventFilterTest, ApplicationControl) {
|
|
|
| // Get a target for kTouchId
|
| ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
|
| - gfx::Point(-10, ypos + ypos_half),
|
| - kTouchId,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + gfx::Point(-10, ypos + ypos_half),
|
| + kTouchId,
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
|
|
| scoped_ptr<ui::GestureEvent> event1(CreateGesture(
|
| @@ -514,9 +518,10 @@ TEST_F(SystemGestureEventFilterTest, ApplicationControl) {
|
| EXPECT_TRUE(consumed);
|
| EXPECT_EQ(ash::wm::GetActiveWindow(), active_window);
|
|
|
| - ui::TouchEvent release(
|
| - ui::ET_TOUCH_RELEASED, gfx::Point(2 * xpos, ypos + ypos_half), kTouchId,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + ui::TouchEvent release(ui::ET_TOUCH_RELEASED,
|
| + gfx::Point(2 * xpos, ypos + ypos_half),
|
| + kTouchId,
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
|
|
|
| // Remove the launcher items again.
|
| @@ -546,8 +551,10 @@ TEST_F(SystemGestureEventFilterTest, LongPressAffordanceStateOnCaptureLoss) {
|
| EXPECT_TRUE(window1->HasCapture());
|
|
|
| // Send touch event to first window.
|
| - ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), kTouchId,
|
| - base::Time::NowFromSystemTime() - base::Time());
|
| + ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
|
| + gfx::Point(10, 10),
|
| + kTouchId,
|
| + ui::EventTimeForNow());
|
| root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
| EXPECT_TRUE(window1->HasCapture());
|
|
|
|
|