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

Unified Diff: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm

Issue 886893002: Add GesturePinchBegin/End events on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update OWNERS file Created 5 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 | « chrome/browser/renderer_host/OWNERS ('k') | content/browser/renderer_host/render_widget_host_view_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm
index 471b9213899170ca37ca7eff2642a34ed27f61eb..c064f72084e1361b2d893145b052c0e2c9432e5e 100644
--- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm
+++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_browsertest.mm
@@ -124,6 +124,26 @@ class ChromeRenderWidgetHostViewMacHistorySwiperTest
// Create mock events --------------------------------------------------------
+ // Create a gesture event with no useful data. Used to create Begin and End
+ // events.
+ id MockGestureEvent(NSEventType type) {
+ id event = [OCMockObject mockForClass:[NSEvent class]];
+ NSPoint locationInWindow = NSMakePoint(0, 0);
+ CGFloat deltaX = 0;
+ CGFloat deltaY = 0;
+ NSTimeInterval timestamp = 0;
+ NSUInteger modifierFlags = 0;
+ [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(type)] type];
+ [(NSEvent*)[[event stub]
+ andReturnValue:OCMOCK_VALUE(locationInWindow)] locationInWindow];
+ [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(deltaX)] deltaX];
+ [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(deltaY)] deltaY];
+ [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(timestamp)] timestamp];
+ [(NSEvent*)[[event stub]
+ andReturnValue:OCMOCK_VALUE(modifierFlags)] modifierFlags];
+ return event;
+ }
+
// Creates a mock scroll wheel event that is backed by a real CGEvent.
id MockScrollWheelEvent(NSPoint delta, NSEventType type) {
CGEventRef cg_event =
@@ -189,18 +209,14 @@ class ChromeRenderWidgetHostViewMacHistorySwiperTest
// Queues a gesture begin event (e.g. [NSView gestureDidBegin:])
void QueueGestureBegin() {
- id event = [OCMockObject mockForClass:[NSEvent class]];
- NSEventType type = NSEventTypeBeginGesture;
- [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(type)] type];
- QueueEvent(event, DEPLOYMENT_GESTURE_BEGIN, NO);
+ QueueEvent(MockGestureEvent(NSEventTypeBeginGesture),
+ DEPLOYMENT_GESTURE_BEGIN, NO);
}
// Queues a gesture end event (e.g. [NSView gestureDidEnd:])
void QueueGestureEnd() {
- id event = [OCMockObject mockForClass:[NSEvent class]];
- NSEventType type = NSEventTypeEndGesture;
- [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(type)] type];
- QueueEvent(event, DEPLOYMENT_GESTURE_END, NO);
+ QueueEvent(MockGestureEvent(NSEventTypeEndGesture),
+ DEPLOYMENT_GESTURE_BEGIN, NO);
}
// Queues a touch event with absolute coordinates |x| and |y|.
« no previous file with comments | « chrome/browser/renderer_host/OWNERS ('k') | content/browser/renderer_host/render_widget_host_view_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698