elementary: restore quick exit from wait loop in fileselector test.

The test was not expecting both callback to be set when the wait loop
was started. By moving them around, it fixes the test case to only have
one relevant callback set at a time.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8490
This commit is contained in:
Cedric BAIL 2019-03-27 14:24:57 -07:00 committed by Marcel Hollerbach
parent 197210cde2
commit 07e017c510
1 changed files with 6 additions and 2 deletions

View File

@ -86,6 +86,8 @@ _ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED
{
Eina_Bool *ret = data;
*ret = EINA_TRUE;
ecore_main_loop_quit();
}
EFL_START_TEST(elm_fileselector_selected)
@ -116,7 +118,6 @@ EFL_START_TEST(elm_fileselector_selected)
fileselector = elm_fileselector_add(win);
evas_object_smart_callback_add(fileselector, "directory,open", _ready_cb, &open);
evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected);
ck_assert(!elm_fileselector_selected_set(fileselector, no_exist));
@ -126,10 +127,13 @@ EFL_START_TEST(elm_fileselector_selected)
ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
selected = EINA_FALSE;
evas_object_smart_callback_del(fileselector, "directory,open", _ready_cb);
evas_object_smart_callback_add(fileselector, "selected", _ready_cb, &selected);
ck_assert(elm_fileselector_selected_set(fileselector, exist));
ck_assert(fileselector_test_helper_wait_flag(10, &selected));
ck_assert(selected == EINA_TRUE);
ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
eina_stringshare_del(exist);