| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "ui/base/test/cocoa_test_event_utils.h" | 7 #include "ui/base/test/cocoa_test_event_utils.h" |
| 8 | 8 |
| 9 ScopedClassSwizzler::ScopedClassSwizzler(Class target, Class source, | 9 ScopedClassSwizzler::ScopedClassSwizzler(Class target, Class source, |
| 10 SEL selector) { | 10 SEL selector) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 location:point | 38 location:point |
| 39 modifierFlags:modifiers | 39 modifierFlags:modifiers |
| 40 timestamp:0 | 40 timestamp:0 |
| 41 windowNumber:0 | 41 windowNumber:0 |
| 42 context:nil | 42 context:nil |
| 43 eventNumber:0 | 43 eventNumber:0 |
| 44 clickCount:1 | 44 clickCount:1 |
| 45 pressure:1.0]; | 45 pressure:1.0]; |
| 46 } | 46 } |
| 47 | 47 |
| 48 NSEvent* MakeMouseEvent(NSEventType type, NSUInteger modifiers) { | 48 NSEvent* MouseEventWithType(NSEventType type, NSUInteger modifiers) { |
| 49 return MouseEventAtPoint(NSMakePoint(0, 0), type, modifiers); | 49 return MouseEventAtPoint(NSMakePoint(0, 0), type, modifiers); |
| 50 } | 50 } |
| 51 | 51 |
| 52 static NSEvent* MouseEventAtPointInWindow(NSPoint point, | 52 static NSEvent* MouseEventAtPointInWindow(NSPoint point, |
| 53 NSEventType type, | 53 NSEventType type, |
| 54 NSWindow* window, | 54 NSWindow* window, |
| 55 NSUInteger clickCount) { | 55 NSUInteger clickCount) { |
| 56 return [NSEvent mouseEventWithType:type | 56 return [NSEvent mouseEventWithType:type |
| 57 location:point | 57 location:point |
| 58 modifierFlags:0 | 58 modifierFlags:0 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 modifierFlags:0 | 90 modifierFlags:0 |
| 91 timestamp:0.0 | 91 timestamp:0.0 |
| 92 windowNumber:0 | 92 windowNumber:0 |
| 93 context:nil | 93 context:nil |
| 94 characters:chars | 94 characters:chars |
| 95 charactersIgnoringModifiers:chars | 95 charactersIgnoringModifiers:chars |
| 96 isARepeat:NO | 96 isARepeat:NO |
| 97 keyCode:0]; | 97 keyCode:0]; |
| 98 } | 98 } |
| 99 | 99 |
| 100 NSEvent* KeyEventWithType(NSEventType event_type, NSUInteger modifiers) { |
| 101 return [NSEvent keyEventWithType:event_type |
| 102 location:NSZeroPoint |
| 103 modifierFlags:modifiers |
| 104 timestamp:0 |
| 105 windowNumber:0 |
| 106 context:nil |
| 107 characters:@"x" |
| 108 charactersIgnoringModifiers:@"x" |
| 109 isARepeat:NO |
| 110 keyCode:0x78]; |
| 111 } |
| 112 |
| 113 NSEvent* EnterExitEventWithType(NSEventType event_type) { |
| 114 return [NSEvent enterExitEventWithType:event_type |
| 115 location:NSZeroPoint |
| 116 modifierFlags:0 |
| 117 timestamp:0 |
| 118 windowNumber:0 |
| 119 context:nil |
| 120 eventNumber:0 |
| 121 trackingNumber:0 |
| 122 userData:NULL]; |
| 123 } |
| 124 |
| 125 NSEvent* OtherEventWithType(NSEventType event_type) { |
| 126 return [NSEvent otherEventWithType:event_type |
| 127 location:NSZeroPoint |
| 128 modifierFlags:0 |
| 129 timestamp:0 |
| 130 windowNumber:0 |
| 131 context:nil |
| 132 subtype:0 |
| 133 data1:0 |
| 134 data2:0]; |
| 135 } |
| 136 |
| 100 } // namespace cocoa_test_event_utils | 137 } // namespace cocoa_test_event_utils |
| OLD | NEW |