summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-19 12:57:26 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-03 10:54:37 +0100
commit6aa9299cc9a55d3cfdb7a9b4dd0caf0739c32923 (patch)
treef7920bd8b87e10028aecead24b4c92a9c41d9724
parentdb5fcd13db38115506ef1adcc4f795c14ee0d338 (diff)
tests/gesture: verify rotate gesture event counting in existing tests
these magically pass already Differential Revision: https://phab.enlightenment.org/D11390
-rw-r--r--src/tests/elementary/efl_ui_test_gesture.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_gesture.c b/src/tests/elementary/efl_ui_test_gesture.c
index 0efd168f68..4d96297c9e 100644
--- a/src/tests/elementary/efl_ui_test_gesture.c
+++ b/src/tests/elementary/efl_ui_test_gesture.c
@@ -31,6 +31,7 @@ enum
31 TRIPLE_TAP, 31 TRIPLE_TAP,
32 MOMENTUM, 32 MOMENTUM,
33 FLICK, 33 FLICK,
34 ROTATE,
34 ZOOM, 35 ZOOM,
35 CUSTOM, 36 CUSTOM,
36 CUSTOM2, 37 CUSTOM2,
@@ -92,6 +93,7 @@ setup(void)
92 WATCH(TRIPLE_TAP); 93 WATCH(TRIPLE_TAP);
93 WATCH(MOMENTUM); 94 WATCH(MOMENTUM);
94 WATCH(FLICK); 95 WATCH(FLICK);
96 WATCH(ROTATE);
95 WATCH(ZOOM); 97 WATCH(ZOOM);
96 98
97 get_me_to_those_events(win); 99 get_me_to_those_events(win);
@@ -110,6 +112,7 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
110 CHECK_ALL(TRIPLE_TAP, 1, 1, 0, 0); 112 CHECK_ALL(TRIPLE_TAP, 1, 1, 0, 0);
111 CHECK_ZERO(MOMENTUM); 113 CHECK_ZERO(MOMENTUM);
112 CHECK_ZERO(FLICK); 114 CHECK_ZERO(FLICK);
115 CHECK_ZERO(ROTATE);
113 CHECK_ZERO(ZOOM); 116 CHECK_ZERO(ZOOM);
114 117
115 RESET; 118 RESET;
@@ -123,6 +126,7 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
123 CHECK_ALL(TRIPLE_TAP, 0, 2, 0, 0); 126 CHECK_ALL(TRIPLE_TAP, 0, 2, 0, 0);
124 CHECK_ZERO(MOMENTUM); 127 CHECK_ZERO(MOMENTUM);
125 CHECK_ZERO(FLICK); 128 CHECK_ZERO(FLICK);
129 CHECK_ZERO(ROTATE);
126 CHECK_ZERO(ZOOM); 130 CHECK_ZERO(ZOOM);
127 131
128 RESET; 132 RESET;
@@ -136,6 +140,7 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
136 CHECK_ALL(TRIPLE_TAP, 0, 1, 1, 0); 140 CHECK_ALL(TRIPLE_TAP, 0, 1, 1, 0);
137 CHECK_ZERO(MOMENTUM); 141 CHECK_ZERO(MOMENTUM);
138 CHECK_ZERO(FLICK); 142 CHECK_ZERO(FLICK);
143 CHECK_ZERO(ROTATE);
139 CHECK_ZERO(ZOOM); 144 CHECK_ZERO(ZOOM);
140 145
141 /* clear states */ 146 /* clear states */
@@ -152,6 +157,7 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
152 CHECK_ALL(TRIPLE_TAP, 1, 3, 0, 0); 157 CHECK_ALL(TRIPLE_TAP, 1, 3, 0, 0);
153 CHECK_ZERO(MOMENTUM); 158 CHECK_ZERO(MOMENTUM);
154 CHECK_ZERO(FLICK); 159 CHECK_ZERO(FLICK);
160 CHECK_ZERO(ROTATE);
155 CHECK_ZERO(ZOOM); 161 CHECK_ZERO(ZOOM);
156 162
157 /* clear states */ 163 /* clear states */
@@ -166,6 +172,8 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
166 CHECK_ALL(TRIPLE_TAP, 1, 1, 0, 0); 172 CHECK_ALL(TRIPLE_TAP, 1, 1, 0, 0);
167 CHECK_ZERO(MOMENTUM); 173 CHECK_ZERO(MOMENTUM);
168 CHECK_ZERO(FLICK); 174 CHECK_ZERO(FLICK);
175 /* this is two fingers, so we have a rotate start */
176 CHECK_ALL(ROTATE, 1, 0, 0, 1);
169 /* this is two fingers, so we have a zoom start */ 177 /* this is two fingers, so we have a zoom start */
170 CHECK_ALL(ZOOM, 1, 0, 0, 1); 178 CHECK_ALL(ZOOM, 1, 0, 0, 1);
171 179
@@ -179,6 +187,8 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
179 CHECK_ALL(TRIPLE_TAP, 0, 2, 0, 0); 187 CHECK_ALL(TRIPLE_TAP, 0, 2, 0, 0);
180 CHECK_ZERO(MOMENTUM); 188 CHECK_ZERO(MOMENTUM);
181 CHECK_ZERO(FLICK); 189 CHECK_ZERO(FLICK);
190 /* this is two fingers, so we have a rotate start */
191 CHECK_ALL(ROTATE, 1, 0, 0, 1);
182 /* this is two fingers, so we have a zoom start */ 192 /* this is two fingers, so we have a zoom start */
183 CHECK_ALL(ZOOM, 1, 0, 0, 1); 193 CHECK_ALL(ZOOM, 1, 0, 0, 1);
184 194
@@ -192,6 +202,8 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
192 CHECK_ALL(TRIPLE_TAP, 0, 1, 1, 0); 202 CHECK_ALL(TRIPLE_TAP, 0, 1, 1, 0);
193 CHECK_ZERO(MOMENTUM); 203 CHECK_ZERO(MOMENTUM);
194 CHECK_ZERO(FLICK); 204 CHECK_ZERO(FLICK);
205 /* this is two fingers, so we have a rotate start */
206 CHECK_ALL(ROTATE, 1, 0, 0, 1);
195 /* this is two fingers, so we have a zoom start */ 207 /* this is two fingers, so we have a zoom start */
196 CHECK_ALL(ZOOM, 1, 0, 0, 1); 208 CHECK_ALL(ZOOM, 1, 0, 0, 1);
197 /* clear states */ 209 /* clear states */
@@ -205,6 +217,8 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
205 CHECK_ALL(TRIPLE_TAP, 1, 0, 0, 1); 217 CHECK_ALL(TRIPLE_TAP, 1, 0, 0, 1);
206 CHECK_ZERO(MOMENTUM); 218 CHECK_ZERO(MOMENTUM);
207 CHECK_ZERO(FLICK); 219 CHECK_ZERO(FLICK);
220 /* this is two fingers, so we have a rotate start */
221 CHECK_ALL(ROTATE, 1, 0, 0, 1);
208 /* this is two fingers, so we have a zoom start */ 222 /* this is two fingers, so we have a zoom start */
209 CHECK_ALL(ZOOM, 1, 0, 0, 1); 223 CHECK_ALL(ZOOM, 1, 0, 0, 1);
210 RESET; 224 RESET;
@@ -230,6 +244,7 @@ EFL_START_TEST(test_efl_ui_gesture_long_press)
230 CHECK_ALL(TRIPLE_TAP, 1, 0, 0, 0); 244 CHECK_ALL(TRIPLE_TAP, 1, 0, 0, 0);
231 CHECK_ZERO(MOMENTUM); 245 CHECK_ZERO(MOMENTUM);
232 CHECK_ZERO(FLICK); 246 CHECK_ZERO(FLICK);
247 CHECK_ZERO(ROTATE);
233 CHECK_ZERO(ZOOM); 248 CHECK_ZERO(ZOOM);
234 249
235 RESET; 250 RESET;
@@ -243,6 +258,7 @@ EFL_START_TEST(test_efl_ui_gesture_long_press)
243 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1); 258 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1);
244 CHECK_ZERO(MOMENTUM); 259 CHECK_ZERO(MOMENTUM);
245 CHECK_ZERO(FLICK); 260 CHECK_ZERO(FLICK);
261 CHECK_ZERO(ROTATE);
246 CHECK_ZERO(ZOOM); 262 CHECK_ZERO(ZOOM);
247 263
248 RESET; 264 RESET;
@@ -254,6 +270,7 @@ EFL_START_TEST(test_efl_ui_gesture_long_press)
254 CHECK_ZERO(TRIPLE_TAP); 270 CHECK_ZERO(TRIPLE_TAP);
255 CHECK_ZERO(MOMENTUM); 271 CHECK_ZERO(MOMENTUM);
256 CHECK_ZERO(FLICK); 272 CHECK_ZERO(FLICK);
273 CHECK_ZERO(ROTATE);
257 CHECK_ZERO(ZOOM); 274 CHECK_ZERO(ZOOM);
258 275
259 RESET; 276 RESET;
@@ -272,6 +289,7 @@ EFL_START_TEST(test_efl_ui_gesture_long_press)
272 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1); 289 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1);
273 CHECK_ALL(MOMENTUM, 1, 0, 0, 0); 290 CHECK_ALL(MOMENTUM, 1, 0, 0, 0);
274 CHECK_ALL(FLICK, 1, 0, 0, 0); 291 CHECK_ALL(FLICK, 1, 0, 0, 0);
292 CHECK_ZERO(ROTATE);
275 CHECK_ZERO(ZOOM); 293 CHECK_ZERO(ZOOM);
276 294
277 RESET; 295 RESET;
@@ -301,6 +319,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
301 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1); 319 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1);
302 /* triggered */ 320 /* triggered */
303 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0); 321 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0);
322 CHECK_ZERO(ROTATE);
304 CHECK_ZERO(ZOOM); 323 CHECK_ZERO(ZOOM);
305 324
306 RESET; 325 RESET;
@@ -322,6 +341,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
322 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1); 341 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1);
323 /* triggered */ 342 /* triggered */
324 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0); 343 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0);
344 CHECK_ZERO(ROTATE);
325 CHECK_ZERO(ZOOM); 345 CHECK_ZERO(ZOOM);
326 346
327 RESET; 347 RESET;
@@ -340,6 +360,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
340 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1); 360 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1);
341 /* triggered */ 361 /* triggered */
342 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0); 362 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0);
363 CHECK_ZERO(ROTATE);
343 CHECK_ZERO(ZOOM); 364 CHECK_ZERO(ZOOM);
344 365
345 RESET; 366 RESET;
@@ -358,6 +379,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
358 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1); 379 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1);
359 /* triggered */ 380 /* triggered */
360 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0); 381 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0);
382 CHECK_ZERO(ROTATE);
361 CHECK_ZERO(ZOOM); 383 CHECK_ZERO(ZOOM);
362 384
363 RESET; 385 RESET;
@@ -377,6 +399,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
377 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1); 399 CHECK_ALL(MOMENTUM, 1, DRAG_OBJECT_NUM_MOVES - 1, 0, 1);
378 /* triggered */ 400 /* triggered */
379 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0); 401 CHECK_ALL(FLICK, 1, DRAG_OBJECT_NUM_MOVES - 1, 1, 0);
402 CHECK_ZERO(ROTATE);
380 CHECK_ZERO(ZOOM); 403 CHECK_ZERO(ZOOM);
381 404
382 RESET; 405 RESET;
@@ -397,6 +420,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
397 CHECK_START(FLICK, 1); 420 CHECK_START(FLICK, 1);
398 CHECK_FINISH(FLICK, 1); 421 CHECK_FINISH(FLICK, 1);
399 CHECK_CANCEL(FLICK, 0); 422 CHECK_CANCEL(FLICK, 0);
423 CHECK_ZERO(ROTATE);
400 CHECK_ZERO(ZOOM); 424 CHECK_ZERO(ZOOM);
401 425
402 RESET; 426 RESET;
@@ -413,6 +437,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
413 CHECK_ALL(MOMENTUM, 1, moves - 2, 1, 0); 437 CHECK_ALL(MOMENTUM, 1, moves - 2, 1, 0);
414 /* NOT triggered; this is going to have some crazy number of update events since it ignores a bunch */ 438 /* NOT triggered; this is going to have some crazy number of update events since it ignores a bunch */
415 CHECK_FINISH(FLICK, 0); 439 CHECK_FINISH(FLICK, 0);
440 CHECK_ZERO(ROTATE);
416 CHECK_ZERO(ZOOM); 441 CHECK_ZERO(ZOOM);
417 442
418 RESET; 443 RESET;
@@ -436,6 +461,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
436 CHECK_FINISH(FLICK, 0); 461 CHECK_FINISH(FLICK, 0);
437 /* flick checks a tolerance value for straight lines, so "start" will be >= 1 */ 462 /* flick checks a tolerance value for straight lines, so "start" will be >= 1 */
438 ck_assert_int_ge(count[FLICK][EFL_GESTURE_STATE_CANCELED - 1], 1); 463 ck_assert_int_ge(count[FLICK][EFL_GESTURE_STATE_CANCELED - 1], 1);
464 CHECK_ZERO(ROTATE);
439 CHECK_ZERO(ZOOM); 465 CHECK_ZERO(ZOOM);
440 466
441 RESET; 467 RESET;
@@ -459,6 +485,7 @@ EFL_START_TEST(test_efl_ui_gesture_flick)
459 CHECK_FINISH(FLICK, 0); 485 CHECK_FINISH(FLICK, 0);
460 /* flick checks a tolerance value for straight lines, so "start" will be >= 1 */ 486 /* flick checks a tolerance value for straight lines, so "start" will be >= 1 */
461 ck_assert_int_ge(count[FLICK][EFL_GESTURE_STATE_CANCELED - 1], 1); 487 ck_assert_int_ge(count[FLICK][EFL_GESTURE_STATE_CANCELED - 1], 1);
488 CHECK_ZERO(ROTATE);
462 CHECK_ZERO(ZOOM); 489 CHECK_ZERO(ZOOM);
463 490
464 RESET; 491 RESET;
@@ -487,6 +514,8 @@ EFL_START_TEST(test_efl_ui_gesture_zoom)
487 514
488 /* only finish is verifiable */ 515 /* only finish is verifiable */
489 CHECK_FINISH(FLICK, 0); 516 CHECK_FINISH(FLICK, 0);
517 /* started then canceled */
518 CHECK_ALL(ROTATE, 1, 0, 0, 1);
490 /* started 1x */ 519 /* started 1x */
491 CHECK_START(ZOOM, 1); 520 CHECK_START(ZOOM, 1);
492 /* 2 touch points tracked, so this will be roughly (2 * moves) but probably less */ 521 /* 2 touch points tracked, so this will be roughly (2 * moves) but probably less */
@@ -515,6 +544,8 @@ EFL_START_TEST(test_efl_ui_gesture_zoom)
515 544
516 /* only finish is verifiable */ 545 /* only finish is verifiable */
517 CHECK_FINISH(FLICK, 0); 546 CHECK_FINISH(FLICK, 0);
547 /* started then canceled */
548 CHECK_ALL(ROTATE, 1, 0, 0, 1);
518 /* started 1x */ 549 /* started 1x */
519 CHECK_START(ZOOM, 1); 550 CHECK_START(ZOOM, 1);
520 /* 2 touch points tracked, so this will be roughly (2 * moves) but probably less */ 551 /* 2 touch points tracked, so this will be roughly (2 * moves) but probably less */