diff options
author | Vitor Sousa <vitorsousasilva@gmail.com> | 2016-09-14 20:45:16 -0300 |
---|---|---|
committer | Vitor Sousa <vitorsousasilva@gmail.com> | 2016-09-14 21:04:00 -0300 |
commit | 93d7b480fd390603b1d9f1b3779449d56c337fc1 (patch) | |
tree | 64d76e17cde9efb122589d24d2cd17b9ce924827 | |
parent | 351af26271f5a3fe4d5dd03fb2a8381e5f067400 (diff) | |
download | efl-93d7b480fd390603b1d9f1b3779449d56c337fc1.tar.gz |
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
-rw-r--r-- | src/tests/elementary/elm_test_fileselector.c | 11 |
1 files 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); |