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

Unified Diff: ash/wm/system_gesture_event_filter_unittest.cc

Issue 11591006: Track input latency with UMA stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added per event type histograms Created 7 years, 11 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 | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « ash/wm/custom_frame_view_ash_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698