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

Side by Side Diff: ui/events/test/event_generator.cc

Issue 577833003: Revert of Clean up GestureEventDetails constructors and fix unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « ui/events/gesture_event_details.cc ('k') | ui/views/controls/button/custom_button_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/events/test/event_generator.h" 5 #include "ui/events/test/event_generator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 MoveTouch(point); 241 MoveTouch(point);
242 ReleaseTouch(); 242 ReleaseTouch();
243 } 243 }
244 244
245 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(EventTarget* window) { 245 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(EventTarget* window) {
246 PressMoveAndReleaseTouchTo(CenterOfWindow(window)); 246 PressMoveAndReleaseTouchTo(CenterOfWindow(window));
247 } 247 }
248 248
249 void EventGenerator::GestureEdgeSwipe() { 249 void EventGenerator::GestureEdgeSwipe() {
250 ui::GestureEvent gesture( 250 ui::GestureEvent gesture(
251 0, 0, 0, Now(), ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE)); 251 0,
252 0,
253 0,
254 Now(),
255 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0));
252 Dispatch(&gesture); 256 Dispatch(&gesture);
253 } 257 }
254 258
255 void EventGenerator::GestureTapAt(const gfx::Point& location) { 259 void EventGenerator::GestureTapAt(const gfx::Point& location) {
256 const int kTouchId = 2; 260 const int kTouchId = 2;
257 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, 261 ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
258 location, 262 location,
259 kTouchId, 263 kTouchId,
260 Now()); 264 Now());
261 Dispatch(&press); 265 Dispatch(&press);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return default_delegate; 627 return default_delegate;
624 } 628 }
625 629
626 EventGeneratorDelegate* EventGenerator::delegate() { 630 EventGeneratorDelegate* EventGenerator::delegate() {
627 return const_cast<EventGeneratorDelegate*>( 631 return const_cast<EventGeneratorDelegate*>(
628 const_cast<const EventGenerator*>(this)->delegate()); 632 const_cast<const EventGenerator*>(this)->delegate());
629 } 633 }
630 634
631 } // namespace test 635 } // namespace test
632 } // namespace ui 636 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_event_details.cc ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698