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
This commit is contained in:
Yeongjong Lee 2018-11-20 15:44:15 +00:00 committed by Marcel Hollerbach
parent 2df601d589
commit d840a64550
1 changed files with 33 additions and 0 deletions

View File

@ -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);
}