| Index: ui/events/test/cocoa_test_event_utils.mm
|
| diff --git a/ui/events/test/cocoa_test_event_utils.mm b/ui/events/test/cocoa_test_event_utils.mm
|
| index b27cd12259923336123469f0761ce4899ddd7dac..bbc7ac3bf3f635821016183a2d58e7a1ff48ddc8 100644
|
| --- a/ui/events/test/cocoa_test_event_utils.mm
|
| +++ b/ui/events/test/cocoa_test_event_utils.mm
|
| @@ -72,10 +72,10 @@ NSEvent* MouseEventWithType(NSEventType type, NSUInteger modifiers) {
|
| return MouseEventAtPoint(NSZeroPoint, type, modifiers);
|
| }
|
|
|
| -static NSEvent* MouseEventAtPointInWindow(NSPoint point,
|
| - NSEventType type,
|
| - NSWindow* window,
|
| - NSUInteger clickCount) {
|
| +NSEvent* MouseEventAtPointInWindow(NSPoint point,
|
| + NSEventType type,
|
| + NSWindow* window,
|
| + NSUInteger clickCount) {
|
| return [NSEvent mouseEventWithType:type
|
| location:point
|
| modifierFlags:0
|
| @@ -114,6 +114,17 @@ std::pair<NSEvent*,NSEvent*> MouseClickInView(NSView* view,
|
| return std::make_pair(down, up);
|
| }
|
|
|
| +std::pair<NSEvent*, NSEvent*> RightMouseClickInView(NSView* view,
|
| + NSUInteger clickCount) {
|
| + const NSRect bounds = [view convertRect:[view bounds] toView:nil];
|
| + const NSPoint mid_point = NSMakePoint(NSMidX(bounds), NSMidY(bounds));
|
| + NSEvent* down = MouseEventAtPointInWindow(mid_point, NSRightMouseDown,
|
| + [view window], clickCount);
|
| + NSEvent* up = MouseEventAtPointInWindow(mid_point, NSRightMouseUp,
|
| + [view window], clickCount);
|
| + return std::make_pair(down, up);
|
| +}
|
| +
|
| NSEvent* KeyEventWithCharacter(unichar c) {
|
| return KeyEventWithKeyCode(0, c, NSKeyDown, 0);
|
| }
|
|
|