bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c05d8cfe759df05b29fb7ec04facb37b76ecee0a

commit c05d8cfe759df05b29fb7ec04facb37b76ecee0a
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Jan 9 10:02:26 2020 -0500

    tests/elm: add util function to automatically delay loop by given time
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11082
---
 src/tests/elementary/suite_helpers.c | 14 ++++++++++++++
 src/tests/elementary/suite_helpers.h |  1 +
 2 files changed, 15 insertions(+)

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);

-- 


Reply via email to