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

Side by Side Diff: ui/events/test/cocoa_test_event_utils.h

Issue 1061733002: Remove windows/mac/ios specific code from //ui (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix default try set Created 5 years, 8 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/platform/platform_event_utils.h ('k') | ui/events/test/cocoa_test_event_utils.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_
6 #define UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_
7
8 #include <utility>
9
10 #import <objc/objc-class.h>
11
12 #include "base/basictypes.h"
13
14 namespace cocoa_test_event_utils {
15
16 // Create synthetic mouse events for testing. Currently these are very
17 // basic, flesh out as needed. Points are all in window coordinates;
18 // where the window is not specified, coordinate system is undefined
19 // (but will be repeated when the event is queried).
20 NSEvent* MouseEventWithType(NSEventType type, NSUInteger modifiers);
21 NSEvent* MouseEventAtPoint(NSPoint point, NSEventType type,
22 NSUInteger modifiers);
23 NSEvent* LeftMouseDownAtPoint(NSPoint point);
24 NSEvent* LeftMouseDownAtPointInWindow(NSPoint point, NSWindow* window);
25 NSEvent* RightMouseDownAtPoint(NSPoint point);
26 NSEvent* RightMouseDownAtPointInWindow(NSPoint point, NSWindow* window);
27
28 // Return a mouse down and an up event with the given |clickCount| at
29 // |view|'s midpoint.
30 std::pair<NSEvent*, NSEvent*> MouseClickInView(NSView* view,
31 NSUInteger clickCount);
32
33 // Returns a key event with the given character.
34 NSEvent* KeyEventWithCharacter(unichar c);
35
36 // Returns a key event with the given type and modifier flags.
37 NSEvent* KeyEventWithType(NSEventType event_type, NSUInteger modifiers);
38
39 // Returns a key event with the given key code, type, and modifier flags.
40 NSEvent* KeyEventWithKeyCode(unsigned short key_code,
41 unichar c,
42 NSEventType event_type,
43 NSUInteger modifiers);
44
45 // Returns a mouse enter/exit event with the given type.
46 NSEvent* EnterExitEventWithType(NSEventType event_type);
47
48 // Return an "other" event with the given type.
49 NSEvent* OtherEventWithType(NSEventType event_type);
50
51 } // namespace cocoa_test_event_utils
52
53 #endif // UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_
OLDNEW
« no previous file with comments | « ui/events/platform/platform_event_utils.h ('k') | ui/events/test/cocoa_test_event_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698