summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-09 10:02:26 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-30 17:06:45 +0100
commitc05d8cfe759df05b29fb7ec04facb37b76ecee0a (patch)
tree0638e020789e81c76c9676269b3b37a1b44c56a8
parenteb0dd2262dd143512891a5d2bc5ed400481ab36a (diff)
downloadefl-c05d8cfe759df05b29fb7ec04facb37b76ecee0a.tar.gz
tests/elm: add util function to automatically delay loop by given time
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11082
-rw-r--r--src/tests/elementary/suite_helpers.c14
-rw-r--r--src/tests/elementary/suite_helpers.h1
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);