summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-09 10:05:32 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-30 17:06:51 +0100
commit9809cec2210963f6584bed9664929f07748ae2b3 (patch)
treeb85ecc5f8e7795e524bc0d263498f724e29d2234
parent635d998f67d6216b9cde1c60094bb07672256626 (diff)
tests/gesture: add longpress tests
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11084
-rw-r--r--src/tests/elementary/efl_ui_test_gesture.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_gesture.c b/src/tests/elementary/efl_ui_test_gesture.c
index 1697a53401..c0d48581b0 100644
--- a/src/tests/elementary/efl_ui_test_gesture.c
+++ b/src/tests/elementary/efl_ui_test_gesture.c
@@ -4,6 +4,9 @@
4 4
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include "efl_ui_suite.h" 6#include "efl_ui_suite.h"
7/* mouse feeding */
8#include <Evas_Legacy.h>
9#include <evas_canvas_eo.h>
7 10
8/* 11/*
9typedef enum 12typedef enum
@@ -126,6 +129,73 @@ EFL_START_TEST(test_efl_ui_gesture_taps)
126} 129}
127EFL_END_TEST 130EFL_END_TEST
128 131
132EFL_START_TEST(test_efl_ui_gesture_long_tap)
133{
134 Eo *rect = setup();
135 double timeout = 1.2;
136 Eina_Value *val;
137 Eo *e = efl_provider_find(rect, EVAS_CANVAS_CLASS);
138
139 val = efl_gesture_manager_config_get(efl_provider_find(rect, EFL_CANVAS_GESTURE_MANAGER_CLASS), "glayer_long_tap_start_timeout");
140 eina_value_get(val, &timeout);
141
142 /* press */
143 press_object(rect);
144 CHECK_ALL(TAP, 1, 0, 0, 0);
145 CHECK_ALL(LONG_TAP, 1, 0, 0, 0);
146 CHECK_ALL(DOUBLE_TAP, 1, 0, 0, 0);
147 CHECK_ALL(TRIPLE_TAP, 1, 0, 0, 0);
148 CHECK_ZERO(MOMENTUM);
149 CHECK_ZERO(FLICK);
150 CHECK_ZERO(ZOOM);
151
152 RESET;
153
154 wait_timer(timeout + 0.01);
155
156 /* verify longpress */
157 CHECK_ALL(TAP, 0, 0, 0, 1);
158 CHECK_ALL(LONG_TAP, 0, 1, 0, 0);
159 CHECK_ALL(DOUBLE_TAP, 0, 0, 0, 1);
160 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1);
161 CHECK_ZERO(MOMENTUM);
162 CHECK_ZERO(FLICK);
163 CHECK_ZERO(ZOOM);
164
165 RESET;
166 evas_event_feed_mouse_up(e, 1, 0, 2, NULL);
167
168 CHECK_ZERO(TAP);
169 CHECK_ALL(LONG_TAP, 0, 0, 1, 0);
170 CHECK_ZERO(DOUBLE_TAP);
171 CHECK_ZERO(TRIPLE_TAP);
172 CHECK_ZERO(MOMENTUM);
173 CHECK_ZERO(FLICK);
174 CHECK_ZERO(ZOOM);
175
176 RESET;
177
178 press_object_at(rect, 0, 0);
179 RESET;
180
181 /* move off-canvas */
182 evas_event_feed_mouse_move(e, -1, 0, 2, NULL);
183 wait_timer(timeout + 0.01);
184
185 /* verify longpress */
186 CHECK_ALL(TAP, 0, 1, 0, 0);
187 CHECK_ALL(LONG_TAP, 0, 1, 0, 0);
188 CHECK_ALL(DOUBLE_TAP, 0, 0, 0, 1);
189 CHECK_ALL(TRIPLE_TAP, 0, 0, 0, 1);
190 CHECK_ALL(MOMENTUM, 1, 0, 0, 0);
191 CHECK_ALL(FLICK, 1, 0, 0, 0);
192 CHECK_ZERO(ZOOM);
193
194 RESET;
195 evas_event_feed_mouse_up(e, 1, 0, 3, NULL);
196}
197EFL_END_TEST
198
129EFL_START_TEST(test_efl_ui_gesture_flick) 199EFL_START_TEST(test_efl_ui_gesture_flick)
130{ 200{
131 int moves, i; 201 int moves, i;
@@ -309,5 +379,6 @@ EFL_END_TEST
309void efl_ui_test_gesture(TCase *tc) 379void efl_ui_test_gesture(TCase *tc)
310{ 380{
311 tcase_add_test(tc, test_efl_ui_gesture_taps); 381 tcase_add_test(tc, test_efl_ui_gesture_taps);
382 tcase_add_test(tc, test_efl_ui_gesture_long_tap);
312 tcase_add_test(tc, test_efl_ui_gesture_flick); 383 tcase_add_test(tc, test_efl_ui_gesture_flick);
313} 384}