summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2018-11-20 15:44:15 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-17 09:12:22 +0100
commitd840a645506d6131331c7e5491dc696880d83a9a (patch)
treef97169c94cdf456525ad7a3e8376d32f721c20d7
parent2df601d589ad405ddb54626d991807be65f74e57 (diff)
downloadefl-d840a645506d6131331c7e5491dc696880d83a9a.tar.gz
elm-test: add a test for checking the focus_next_object_set
The object which is set by elm_object_focus_next_object_set should be considered first when focus moved. ref T7389 Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de> Differential Revision: https://phab.enlightenment.org/D7310
-rw-r--r--src/tests/elementary/elm_test_spinner.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_spinner.c b/src/tests/elementary/elm_test_spinner.c
index a6da140dda..ca4e1c1d52 100644
--- a/src/tests/elementary/elm_test_spinner.c
+++ b/src/tests/elementary/elm_test_spinner.c
@@ -41,9 +41,42 @@ EFL_START_TEST (elm_atspi_role_get)
}
EFL_END_TEST
+
+EFL_START_TEST (elm_spinner_focus_next_object)
+{
+ Evas_Object *win, *box, *spinner, *btn, *o;
+
+ win = win_add(NULL, "spinner", ELM_WIN_BASIC);
+
+ box = elm_box_add(win);
+ elm_win_resize_object_add(win, box);
+ evas_object_show(box);
+
+ spinner = elm_spinner_add(box);
+ elm_box_pack_end(box, spinner);
+ evas_object_show(spinner);
+
+ btn = elm_button_add(box);
+ elm_box_pack_end(box, btn);
+ evas_object_show(btn);
+
+ evas_object_show(win);
+
+ elm_object_focus_set(spinner, EINA_TRUE);
+
+ elm_object_focus_next_object_set(spinner, btn, EFL_UI_FOCUS_DIRECTION_UP);
+ o = elm_object_focus_next_object_get(spinner, EFL_UI_FOCUS_DIRECTION_UP);
+ ck_assert_ptr_eq(o, btn);
+
+ elm_object_focus_next(win, EFL_UI_FOCUS_DIRECTION_UP);
+ ck_assert_ptr_eq(elm_object_focused_object_get(win), btn);
+}
+EFL_END_TEST
+
void elm_test_spinner(TCase *tc)
{
tcase_add_test(tc, elm_spinner_legacy_type_check);
tcase_add_test(tc, elm_atspi_role_get);
+ tcase_add_test(tc, elm_spinner_focus_next_object);
}