OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ | 5 #ifndef UI_AURA_TEST_EVENT_GENERATOR_H_ |
6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ | 6 #define UI_AURA_TEST_EVENT_GENERATOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Generates press, move, release touch-events to generate a sequence of | 122 // Generates press, move, release touch-events to generate a sequence of |
123 // scroll events. |duration| and |steps| affect the velocity of the scroll, | 123 // scroll events. |duration| and |steps| affect the velocity of the scroll, |
124 // and depending on these values, this may also generate FLING scroll | 124 // and depending on these values, this may also generate FLING scroll |
125 // gestures. If velocity/fling is irrelevant for the test, then any non-zero | 125 // gestures. If velocity/fling is irrelevant for the test, then any non-zero |
126 // values for these should be sufficient. | 126 // values for these should be sufficient. |
127 void GestureScrollSequence(const gfx::Point& start, | 127 void GestureScrollSequence(const gfx::Point& start, |
128 const gfx::Point& end, | 128 const gfx::Point& end, |
129 const base::TimeDelta& duration, | 129 const base::TimeDelta& duration, |
130 int steps); | 130 int steps); |
131 | 131 |
| 132 // Generates press, move, release touch-events to generate a sequence of |
| 133 // multi-finger scroll events. |count| specifies the number of touch-points |
| 134 // that should generate the scroll events. |start| are the starting positions |
| 135 // of all the touch points. |steps| and |event_separation_time_ms| are |
| 136 // relevant when testing velocity/fling/swipe, otherwise these can be any |
| 137 // non-zero value. |delta_x| and |delta_y| are the amount that each finger |
| 138 // should be moved. |
| 139 void GestureMultiFingerScroll(int count, |
| 140 const gfx::Point* start, |
| 141 int event_separation_time_ms, |
| 142 int steps, |
| 143 int move_x, |
| 144 int move_y); |
| 145 |
132 // Generates a key press event. On platforms except Windows and X11, a key | 146 // Generates a key press event. On platforms except Windows and X11, a key |
133 // event without native_event() is generated. Note that ui::EF_ flags should | 147 // event without native_event() is generated. Note that ui::EF_ flags should |
134 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>. | 148 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>. |
135 // TODO(yusukes): Support native_event() on all platforms. | 149 // TODO(yusukes): Support native_event() on all platforms. |
136 void PressKey(ui::KeyboardCode key_code, int flags); | 150 void PressKey(ui::KeyboardCode key_code, int flags); |
137 | 151 |
138 // Generates a key release event. On platforms except Windows and X11, a key | 152 // Generates a key release event. On platforms except Windows and X11, a key |
139 // event without native_event() is generated. Note that ui::EF_ flags should | 153 // event without native_event() is generated. Note that ui::EF_ flags should |
140 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>. | 154 // be passed as |flags|, not the native ones like 'ShiftMask' in <X11/X.h>. |
141 // TODO(yusukes): Support native_event() on all platforms. | 155 // TODO(yusukes): Support native_event() on all platforms. |
(...skipping 10 matching lines...) Expand all Loading... |
152 int flags_; | 166 int flags_; |
153 gfx::Point current_location_; | 167 gfx::Point current_location_; |
154 | 168 |
155 DISALLOW_COPY_AND_ASSIGN(EventGenerator); | 169 DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
156 }; | 170 }; |
157 | 171 |
158 } // namespace test | 172 } // namespace test |
159 } // namespace aura | 173 } // namespace aura |
160 | 174 |
161 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ | 175 #endif // UI_AURA_TEST_EVENT_GENERATOR_H_ |
OLD | NEW |