summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_test_fileselector.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-06 14:26:08 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2018-08-15 10:20:55 +0200
commit672cacaaf6766e3740a39d71b4379e3a62d42ab3 (patch)
treef923d58f4bebaa922eebd9d38efa0e7c4d0b7058 /src/tests/elementary/elm_test_fileselector.c
parente47c2d7006a1641910857a97e2a2f314841fe0cb (diff)
tests/elm: remove elm_test_helper.(c|h) files
these timer functions are only used by fileselector and I'm trying to consolidate timer usage no functional changes Differential Revision: https://phab.enlightenment.org/D6768
Diffstat (limited to '')
-rw-r--r--src/tests/elementary/elm_test_fileselector.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/tests/elementary/elm_test_fileselector.c b/src/tests/elementary/elm_test_fileselector.c
index dd22df1a57..52eb5c8840 100644
--- a/src/tests/elementary/elm_test_fileselector.c
+++ b/src/tests/elementary/elm_test_fileselector.c
@@ -6,6 +6,46 @@
6#include <Elementary.h> 6#include <Elementary.h>
7#include "elm_suite.h" 7#include "elm_suite.h"
8 8
9static Eina_Bool
10timer_expired_cb(void *user_data)
11{
12 Eina_Bool *did_timeout = user_data;
13
14 *did_timeout = EINA_TRUE;
15 ecore_main_loop_quit();
16
17 return EINA_TRUE;
18}
19
20static Eina_Bool
21idler_done_cb(void *user_data)
22{
23 Eina_Bool *done = user_data;
24
25 if (*done) ecore_main_loop_quit();
26
27 return EINA_TRUE;
28}
29
30static Eina_Bool
31fileselector_test_helper_wait_flag(double in, Eina_Bool *done)
32{
33 Eina_Bool did_timeout = EINA_FALSE;
34 Ecore_Timer *tm;
35 Ecore_Idle_Enterer *idle;
36
37 tm = ecore_timer_add(in, timer_expired_cb, &did_timeout);
38 idle = ecore_idle_enterer_add(idler_done_cb, done);
39
40 ecore_main_loop_begin();
41
42 ecore_idle_enterer_del(idle);
43 ecore_timer_del(tm);
44
45 return !did_timeout;
46}
47
48
9EFL_START_TEST (elm_fileselector_legacy_type_check) 49EFL_START_TEST (elm_fileselector_legacy_type_check)
10{ 50{
11 Evas_Object *win, *fileselector; 51 Evas_Object *win, *fileselector;
@@ -84,13 +124,13 @@ EFL_START_TEST (elm_fileselector_selected)
84 124
85 open = EINA_FALSE; 125 open = EINA_FALSE;
86 ck_assert(elm_fileselector_selected_set(fileselector, path)); 126 ck_assert(elm_fileselector_selected_set(fileselector, path));
87 ck_assert(elm_test_helper_wait_flag(10, &open)); 127 ck_assert(fileselector_test_helper_wait_flag(10, &open));
88 128
89 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path); 129 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), path);
90 130
91 selected = EINA_FALSE; 131 selected = EINA_FALSE;
92 ck_assert(elm_fileselector_selected_set(fileselector, exist)); 132 ck_assert(elm_fileselector_selected_set(fileselector, exist));
93 ck_assert(elm_test_helper_wait_flag(10, &selected)); 133 ck_assert(fileselector_test_helper_wait_flag(10, &selected));
94 134
95 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist); 135 ck_assert_str_eq(elm_fileselector_selected_get(fileselector), exist);
96 136