diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2020-01-09 10:02:26 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2020-01-23 15:24:12 -0500 |
commit | 590e392976e76bcfecda65d5f9c12703761af67f (patch) | |
tree | a364508cce3eba92e42b1f6e6a51a518aab603fd | |
parent | 35ca4e09883174787d38d35e490ef7650533f69f (diff) | |
download | efl-590e392976e76bcfecda65d5f9c12703761af67f.tar.gz |
tests/elm: add util function to automatically delay loop by given time
Differential Revision: https://phab.enlightenment.org/D11082
-rw-r--r-- | src/tests/elementary/suite_helpers.c | 14 | ||||
-rw-r--r-- | src/tests/elementary/suite_helpers.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index 49d611be1b..165777c929 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -144,6 +144,20 @@ real_timer_add(double in, Ecore_Task_Cb cb, void *data) return ecore_timer_add(in, cb, data); } +static Eina_Bool +_timer_quit() +{ + ecore_main_loop_quit(); + return EINA_FALSE; +} + +void +wait_timer(double in) +{ + ecore_timer_add(in, _timer_quit, NULL); + ecore_main_loop_begin(); +} + static void _win_manual_render(void *data, const Efl_Event *event EINA_UNUSED) { diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index 7c9c9bbc3d..b3ccab556b 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -10,6 +10,7 @@ int suite_setup(Eina_Bool legacy); void _elm2_suite_init(void); void _elm_suite_shutdown(void); void *real_timer_add(double in, Ecore_Task_Cb cb, void *data); +void wait_timer(double in); void fail_on_errors_teardown(void); void fail_on_errors_setup(void); Eina_Bool is_forked(void); |