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

Side by Side Diff: ash/wm/system_gesture_event_filter_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 unified diff | Download patch
« no previous file with comments | « ash/wm/gestures/overview_gesture_handler_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/system_gesture_event_filter.h" 5 #include "ash/wm/system_gesture_event_filter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/accelerators/accelerator_controller.h" 9 #include "ash/accelerators/accelerator_controller.h"
10 #include "ash/aura/wm_window_aura.h" 10 #include "ash/aura/wm_window_aura.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 }; 137 };
138 138
139 ui::GestureEvent* CreateGesture(ui::EventType type, 139 ui::GestureEvent* CreateGesture(ui::EventType type,
140 int x, 140 int x,
141 int y, 141 int y,
142 float delta_x, 142 float delta_x,
143 float delta_y, 143 float delta_y,
144 int touch_id) { 144 int touch_id) {
145 ui::GestureEventDetails details = 145 ui::GestureEventDetails details =
146 ui::GestureEventDetails(type, delta_x, delta_y); 146 ui::GestureEventDetails(type, delta_x, delta_y);
147 return new ui::GestureEvent(x, y, 0, 147 return new ui::GestureEvent(x, y, 0, base::TimeTicks::Now(),
148 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000), 148 ui::GestureEventDetails(type, delta_x, delta_y));
149 ui::GestureEventDetails(type, delta_x, delta_y));
150 } 149 }
151 150
152 TEST_F(SystemGestureEventFilterTest, TwoFingerDrag) { 151 TEST_F(SystemGestureEventFilterTest, TwoFingerDrag) {
153 gfx::Rect bounds(0, 0, 600, 600); 152 gfx::Rect bounds(0, 0, 600, 600);
154 aura::Window* root_window = Shell::GetPrimaryRootWindow(); 153 aura::Window* root_window = Shell::GetPrimaryRootWindow();
155 views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds( 154 views::Widget* toplevel = views::Widget::CreateWindowWithContextAndBounds(
156 new ResizableWidgetDelegate, root_window, bounds); 155 new ResizableWidgetDelegate, root_window, bounds);
157 toplevel->Show(); 156 toplevel->Show();
158 157
159 const int kSteps = 15; 158 const int kSteps = 15;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 for (int i = 1; i <= 3; ++i) 477 for (int i = 1; i <= 3; ++i)
479 GetEventGenerator().ReleaseTouchId(i); 478 GetEventGenerator().ReleaseTouchId(i);
480 EXPECT_EQ(event_handler.num_gesture_events(), 479 EXPECT_EQ(event_handler.num_gesture_events(),
481 delegate.GetGestureCountAndReset()); 480 delegate.GetGestureCountAndReset());
482 481
483 aura::Env::GetInstance()->RemovePreTargetHandler(&event_handler); 482 aura::Env::GetInstance()->RemovePreTargetHandler(&event_handler);
484 } 483 }
485 484
486 } // namespace test 485 } // namespace test
487 } // namespace ash 486 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/gestures/overview_gesture_handler_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698