summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-26 08:51:16 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-06-26 09:54:55 -0400
commit4fe13887cab6c42154f3a5d846f5c01c7e3df5d7 (patch)
treed1a67e27fd9560f59290b4808c7e43940fbb3cf8
parent132d3dfb92dea3fcd2fde947b9b41a614be7b24f (diff)
downloadefl-4fe13887cab6c42154f3a5d846f5c01c7e3df5d7.tar.gz
efl_input_interface: add tests for mouse wheel emitting
Summary: this tests if z and direction is correctly emitted Depends on D9169 Reviewers: zmike, segfaultxavi Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9170
-rw-r--r--src/tests/elementary/efl_ui_test_win.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_win.c b/src/tests/elementary/efl_ui_test_win.c
index 2f362467cd..cfc57a7834 100644
--- a/src/tests/elementary/efl_ui_test_win.c
+++ b/src/tests/elementary/efl_ui_test_win.c
@@ -334,6 +334,38 @@ EFL_START_TEST(efl_ui_win_test_efl_input_interface_pointer_in_out)
}
EFL_END_TEST
+static void
+_check_pointer_wheel_cb(void *data, const Efl_Event *ev)
+{
+ Eina_Bool *called = data;
+ ck_assert_int_eq(efl_input_timestamp_get(ev->info), TIMESTAMP);
+ ck_assert_int_eq(efl_input_pointer_wheel_delta_get(ev->info), 2);
+ ck_assert_int_eq(efl_input_pointer_wheel_horizontal_get(ev->info), 1);
+ ck_assert_int_eq(efl_input_pointer_double_click_get(ev->info), 0);
+ ck_assert_int_eq(efl_input_pointer_triple_click_get(ev->info), 0);
+ ck_assert_int_eq(efl_input_pointer_button_flags_get(ev->info), 0);
+ ck_assert_int_eq(efl_input_pointer_touch_id_get(ev->info), 0);
+ position_eq(efl_input_pointer_position_get(ev->info), EINA_POSITION2D(20, 20));
+ ck_assert_int_eq(efl_input_pointer_button_get(ev->info), 0);
+ ck_assert_int_eq(efl_input_pointer_action_get(ev->info), EFL_POINTER_ACTION_WHEEL );
+ *called = EINA_TRUE;
+}
+
+EFL_START_TEST(efl_ui_win_test_efl_input_interface_pointer_wheel)
+{
+ Efl_Ui_Win *win;
+ Eina_Bool pointer_wheel = EINA_FALSE;
+ Efl_Canvas_Object *rect;
+
+ create_environment(&win, &rect);
+
+ efl_event_callback_add(rect, EFL_EVENT_POINTER_WHEEL, _check_pointer_wheel_cb, &pointer_wheel);
+
+ evas_event_feed_mouse_move(evas_object_evas_get(win), 20, 20, TIMESTAMP, NULL);
+ evas_event_feed_mouse_wheel(evas_object_evas_get(win), 1, 2, TIMESTAMP, NULL);
+ ck_assert_int_eq(pointer_wheel, EINA_TRUE);
+}
+EFL_END_TEST
void
efl_ui_test_win(TCase *tc)
{
@@ -346,4 +378,5 @@ efl_ui_test_win(TCase *tc)
tcase_add_test(tc, efl_ui_win_test_efl_input_interface_pointer_down);
tcase_add_test(tc, efl_ui_win_test_efl_input_interface_pointer_up);
tcase_add_test(tc, efl_ui_win_test_efl_input_interface_pointer_in_out);
+ tcase_add_test(tc, efl_ui_win_test_efl_input_interface_pointer_wheel);
}