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

Side by Side Diff: ui/aura/test/event_generator.h

Issue 10823218: ash: Add some test coverage for WM gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doc Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | ui/aura/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698