From 93d7b480fd390603b1d9f1b3779449d56c337fc1 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Wed, 14 Sep 2016 20:45:16 -0300 Subject: [PATCH] elm fileselector: fix test to wait for the right event Fileselector test was waiting for the wrong event. It caused the test to fail in some situations, since it could check the object when it is not ready. Fix T4502 @fix --- src/tests/elementary/elm_test_fileselector.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c index 4a86d999a6..880054324f 100644 --- a/src/tests/elementary/elm_test_fileselector.c +++ b/src/tests/elementary/elm_test_fileselector.c @@ -25,7 +25,7 @@ START_TEST (elm_atspi_role_get) END_TEST static void -_directory_open_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +_ready_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Eina_Bool *ret = data; *ret = EINA_TRUE; @@ -38,7 +38,7 @@ START_TEST (elm_fileselector_selected) Eina_Stringshare *exist, *no_exist; FILE *fp; char *path; - Eina_Bool selected; + Eina_Bool open, selected; elm_init(1, NULL); @@ -60,13 +60,14 @@ START_TEST (elm_fileselector_selected) win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC); fileselector = elm_fileselector_add(win); - evas_object_smart_callback_add(fileselector, "directory,open", _directory_open_cb, &selected); + 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)); - selected = EINA_FALSE; + open = EINA_FALSE; ck_assert(elm_fileselector_selected_set(fileselector, path)); - ck_assert(elm_test_helper_wait_flag(10, &selected)); + ck_assert(elm_test_helper_wait_flag(10, &open)); ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);