mmi-manager-tests : add ecore event dispatcher 06/264306/1
authorulgal-park <ulgal.park@samsung.com>
Wed, 15 Sep 2021 12:20:09 +0000 (21:20 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Wed, 15 Sep 2021 12:41:37 +0000 (21:41 +0900)
Change-Id: Ifb026263da1b7e2f8c55cbd34c6bef614cf2b038

tests/ecore-event-dispatcher.cpp [new file with mode: 0644]
tests/meson.build
tests/mmi-manager-tests.h

diff --git a/tests/ecore-event-dispatcher.cpp b/tests/ecore-event-dispatcher.cpp
new file mode 100644 (file)
index 0000000..739bc3a
--- /dev/null
@@ -0,0 +1,23 @@
+#include <Ecore.h>
+
+Ecore_Idle_Enterer *_idle_before = nullptr;
+bool g_flag_wait_done = false;
+
+static Eina_Bool _e_cb_idle_before(void *data)
+{
+       (void) data;
+
+       g_flag_wait_done = true;
+       return ECORE_CALLBACK_RENEW;
+}
+
+void wait_for_dispatch()
+{
+       g_flag_wait_done = false;
+       _idle_before = ecore_idle_enterer_before_add(_e_cb_idle_before, NULL);
+       while (!g_flag_wait_done)
+       {
+               ecore_main_loop_iterate();
+       }
+       ecore_idle_enterer_del(_idle_before);
+}
\ No newline at end of file
index 27643968ce840e559275cfd6146a8b0f2b2401fa..4c707d1952ab6c29f1c387b51a40a04c19c86b59 100644 (file)
@@ -2,7 +2,8 @@ mmi_manager_tests_srcs = [
        'mmi-manager-tests.cpp',
        'mmi-provider-tests.cpp',
        'mmi-client-tests.cpp',
-       'mmi-fusion-tests.cpp'
+       'mmi-fusion-tests.cpp',
+       'ecore-event-dispatcher.cpp'
        ]
 
 gmock_dep = dependency('gmock', method : 'pkg-config')
index 2273dfac4923d187f1a1693a4fe8c6bc0d5a076e..5f3bf6783a0f4eb2b65350fbc54cdbb609d2de58 100644 (file)
@@ -30,6 +30,8 @@
 
 #define PRINT printf
 
+extern void wait_for_dispatch();
+
 using ::testing::TestWithParam;
 using ::testing::Bool;
 using ::testing::Values;