From e2aeec211efb4358420f6416d0a29dfd8a8909d7 Mon Sep 17 00:00:00 2001 From: jeon Date: Fri, 28 Dec 2018 14:19:03 +0900 Subject: [PATCH 01/16] 0009_input: add edge swipe gesture testcases Change-Id: Ibfd9bc5013d9328dee95fb1ecd97ee1c2e049191 --- src/e_test_event.cpp | 226 ++++++++++++++++++++++++++++++++++++++++++-- src/e_test_event.h | 15 ++- src/e_test_util.h | 1 + src/testcase/0009_input.cpp | 80 ++++++++++++++++ 4 files changed, 314 insertions(+), 8 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 62725e0..fea6f23 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -20,6 +20,52 @@ _cb_resource_id(void *data, etRunner::get().finishWork(); } +static void +_cb_geometry(void *data EINA_UNUSED, + struct wl_output *wl_output EINA_UNUSED, + int x, int y, int w, int h, + int subpixel EINA_UNUSED, + const char *make EINA_UNUSED, + const char *model EINA_UNUSED, + int transform EINA_UNUSED) +{ + etRunner::get().output.x = x; + etRunner::get().output.y = y; + etRunner::get().output.w = w; + etRunner::get().output.h = h; +} + +static void +_cb_mode(void *data EINA_UNUSED, + struct wl_output *wl_output EINA_UNUSED, + unsigned int flags, + int w, int h, + int refresh EINA_UNUSED) +{ + if (flags & WL_OUTPUT_MODE_CURRENT) + { + etRunner::get().output.w = w; + etRunner::get().output.h = h; + } + + etRunner::get().finishWork(); +} + +static void +_cb_done(void *data EINA_UNUSED, + struct wl_output *output EINA_UNUSED) +{ + ; +} + +static void +_cb_scale(void *data EINA_UNUSED, + struct wl_output *output EINA_UNUSED, + int scale EINA_UNUSED) +{ + ; +} + /* callbacks - method */ static void _cb_method_win_info_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); static void _cb_method_win_info_list_get(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); @@ -53,9 +99,11 @@ static Eina_Bool _ev_wait_timeout(void *data); /* callbacks - gesture */ static Eina_Bool _cb_gesture_tap(void *data, int type, void *event); +static Eina_Bool _cb_gesture_edge_swipe(void *data, int type, void *event); /* functions - gesture */ static void _gesture_tap_generate(etRunner *runner); +static void _gesture_edge_swipe_generate(etRunner *runner); /********************** listeners @@ -65,6 +113,14 @@ static const struct tizen_resource_listener _e_test_tizen_resource_listener = _cb_resource_id, }; +static const struct wl_output_listener _e_test_output_listener = +{ + _cb_geometry, + _cb_mode, + _cb_done, + _cb_scale +}; + /********************** class etRunner **********************/ @@ -995,6 +1051,11 @@ etRunner::waitEvent(E_TC_Event_Type ev_type) _gesture_tap_generate(this); break; + case E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE: + eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE, _cb_gesture_edge_swipe, this); + _gesture_edge_swipe_generate(this); + break; + default: goto finish; break; @@ -1173,6 +1234,23 @@ etRunner::initProtocols() &tizen_launch_effect_interface, (global->version > 1)? 1 : global->version); } + if (!strcmp(global->interface, "wl_output")) + { + wlOutput = (struct wl_output *) + wl_registry_bind(registry, + global->id, + &wl_output_interface, + (global->version > 2)? 2 : global->version); + wl_output_add_listener(wlOutput, &_e_test_output_listener, NULL); + + work(); + + if (wlOutput) + { + wl_output_destroy(wlOutput); + wlOutput = NULL; + } + } } EINA_SAFETY_ON_NULL_GOTO(tzPolicy, err); @@ -1713,7 +1791,7 @@ _cb_gesture_tap_delay_timer(void *data) } } - runner->ev.gesture.tap.timer = NULL; + runner->ev.gesture.timer = NULL; runner->ev.gesture.tap.pressed = !runner->ev.gesture.tap.pressed; if (!runner->ev.gesture.tap.pressed) @@ -1723,9 +1801,9 @@ _cb_gesture_tap_delay_timer(void *data) if (runner->ev.gesture.tap.current_repeats > 0) { - runner->ev.gesture.tap.timer = ecore_timer_add(0.11, - _cb_gesture_tap_delay_timer, - runner); + runner->ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_tap_delay_timer, + runner); } return ECORE_CALLBACK_CANCEL; @@ -1737,7 +1815,141 @@ _gesture_tap_generate(etRunner *runner) runner->ev.gesture.tap.current_repeats = runner->ev.gesture.tap.repeats; runner->ev.gesture.tap.pressed = EINA_FALSE; - runner->ev.gesture.tap.timer = ecore_timer_add(1.0, - _cb_gesture_tap_delay_timer, - runner); + runner->ev.gesture.timer = ecore_timer_add(1.0, + _cb_gesture_tap_delay_timer, + runner); } + +static Eina_Bool +_cb_gesture_edge_swipe(void *data, int type, void *event) +{ + etRunner *runner = (etRunner *)data; + efl_util_event_gesture_edge_swipe_s *ev = + (efl_util_event_gesture_edge_swipe_s *)event; + + if ((ev->fingers == (unsigned int)runner->ev.gesture.edge_swipe.fingers) && + (ev->edge == (unsigned int)runner->ev.gesture.edge_swipe.edge)) + { + runner->ev.response = E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE; + if (runner->ev.gesture.timer) + { + runner->ev.gesture.edge_swipe.get_event = EINA_TRUE; + } + else + elm_exit(); + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_cb_gesture_edge_swipe_delay_timer(void *data) +{ + etRunner *runner = (etRunner *)data; + int i, cnt, fingers, w, h; + efl_util_gesture_edge_e edge; + + cnt = ++runner->ev.gesture.edge_swipe.touch_count; + fingers = runner->ev.gesture.edge_swipe.fingers; + edge = runner->ev.gesture.edge_swipe.edge; + w = runner->output.w - 1; + h = runner->output.h - 1; + + if (cnt == 1) + { + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchDown(i, 100 * (i + 1), 1); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchDown(i, w - 1, 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchDown(i, 100 * (i + 1), h - 1); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchDown(i, 1, 100 * (i + 1)); + break; + default: + break; + } + } + } + else if (cnt < 5) + { + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchMove(i, 100 * (i + 1), 40 * cnt * cnt); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchMove(i, (w - 1) - (40 * cnt * cnt), 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchMove(i, 100 * (i + 1), (h - 1) - (40 * cnt * cnt)); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchMove(i, 40 * cnt * cnt, 100 * (i + 1)); + break; + default: + break; + } + } + } + else + { + cnt--; + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchUp(i, 100 * (i + 1), 40 * cnt * cnt); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchUp(i, (w - 1) - (40 * cnt * cnt), 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchUp(i, 100 * (i + 1), (h - 1) - (40 * cnt * cnt)); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchUp(i, 40 * cnt * cnt, 100 * (i + 1)); + break; + default: + break; + } + } + + runner->ev.gesture.timer = NULL; + if (runner->ev.gesture.edge_swipe.get_event) + { + runner->ev.gesture.edge_swipe.get_event = EINA_FALSE; + elm_exit(); + } + return ECORE_CALLBACK_CANCEL; + } + + runner->ev.gesture.timer = NULL; + runner->ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_edge_swipe_delay_timer, + runner); + + return ECORE_CALLBACK_CANCEL; +} + +static void +_gesture_edge_swipe_generate(etRunner *runner) +{ + runner->ev.gesture.edge_swipe.touch_count = 0; + runner->ev.gesture.edge_swipe.get_event = EINA_FALSE; + + runner->ev.gesture.timer = ecore_timer_add(1.0, + _cb_gesture_edge_swipe_delay_timer, + runner); +} + diff --git a/src/e_test_event.h b/src/e_test_event.h index faf4513..81373c2 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -18,6 +18,7 @@ private: tzSurface = NULL; tzlaunch_effect = NULL; tzlaunch_splash = NULL; + wlOutput = NULL; ev.expire_timer = NULL; ev.request = E_TC_EVENT_TYPE_NONE; ev.response = E_TC_EVENT_TYPE_NONE; @@ -55,6 +56,7 @@ private: struct tizen_surface *tzSurface; struct tizen_launch_effect *tzlaunch_effect; struct tizen_launch_splash *tzlaunch_splash; + struct wl_output *wlOutput; Eina_List *listWinInfo; @@ -79,16 +81,27 @@ public: /* TODO: make it hidden */ } effect; struct { + Ecore_Timer *timer; struct { - Ecore_Timer *timer; int fingers; int repeats; int current_repeats; Eina_Bool pressed; } tap; + struct + { + int fingers; + efl_util_gesture_edge_e edge; + int touch_count; + Eina_Bool get_event; + } edge_swipe; } gesture; } ev; + struct + { + int x, y, w, h; + } output; public: Eina_Bool init(); diff --git a/src/e_test_util.h b/src/e_test_util.h index b16a76e..cbc05cd 100644 --- a/src/e_test_util.h +++ b/src/e_test_util.h @@ -80,6 +80,7 @@ typedef enum _E_TC_Event_Type E_TC_EVENT_TYPE_EFFECT_EVAS_CB, E_TC_EVENT_TYPE_EFFECT, E_TC_EVENT_TYPE_GESTURE_TAP, + E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE, E_TC_EVENT_TYPE_MAX } E_TC_Event_Type; diff --git a/src/testcase/0009_input.cpp b/src/testcase/0009_input.cpp index c2226aa..da194a6 100644 --- a/src/testcase/0009_input.cpp +++ b/src/testcase/0009_input.cpp @@ -13,6 +13,7 @@ protected: etWin *tw_topposition = NULL; etWin *tw_orexcl = NULL; etWin *tw_excl = NULL; + etWin *tw_gesture = NULL; }; TEST_F(etTestInput, keygrab_nowin_shared) @@ -357,4 +358,83 @@ TEST_F(etTestInput, gesture_tap23) efl_util_gesture_tap_free(gesture_h, tap_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; +} + +static void +_test_gesture_edge_swipe(int fingers, efl_util_gesture_edge_e edge) +{ + int ret = EFL_UTIL_ERROR_NONE; + efl_util_gesture_h gesture_h; + efl_util_gesture_data edge_swipe_d; + + gesture_h = efl_util_gesture_initialize(); + ASSERT_TRUE(gesture_h != NULL) << "failed to initialize gesture system"; + + edge_swipe_d = efl_util_gesture_edge_swipe_new(gesture_h, fingers, edge); + ASSERT_TRUE(edge_swipe_d != NULL) << "failed to generate edge swipe grab data"; + + ret = efl_util_gesture_grab(gesture_h, edge_swipe_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge swipe gesture: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + etRunner::get().ev.gesture.edge_swipe.fingers = fingers; + etRunner::get().ev.gesture.edge_swipe.edge = edge; + + ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE); + ASSERT_TRUE(ret); + + etRunner::get().ev.gesture.edge_swipe.fingers = 0; + etRunner::get().ev.gesture.edge_swipe.edge = EFL_UTIL_GESTURE_EDGE_NONE;; + + ret = efl_util_gesture_ungrab(gesture_h, edge_swipe_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge swipe gesture: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + ret = efl_util_gesture_edge_swipe_free(gesture_h, edge_swipe_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + ret = efl_util_gesture_deinitialize(gesture_h); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to deinitialize gesture system: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; +} + +TEST_F(etTestInput, gesture_edge_swipe11) +{ + _test_gesture_edge_swipe(1, EFL_UTIL_GESTURE_EDGE_TOP); +} + +TEST_F(etTestInput, gesture_edge_swipe12) +{ + _test_gesture_edge_swipe(1, EFL_UTIL_GESTURE_EDGE_RIGHT); +} + +TEST_F(etTestInput, gesture_edge_swipe13) +{ + _test_gesture_edge_swipe(1, EFL_UTIL_GESTURE_EDGE_BOTTOM); +} + +TEST_F(etTestInput, gesture_edge_swipe14) +{ + _test_gesture_edge_swipe(1, EFL_UTIL_GESTURE_EDGE_LEFT); +} + +TEST_F(etTestInput, gesture_edge_swipe21) +{ + _test_gesture_edge_swipe(2, EFL_UTIL_GESTURE_EDGE_TOP); +} + +TEST_F(etTestInput, gesture_edge_swipe22) +{ + _test_gesture_edge_swipe(2, EFL_UTIL_GESTURE_EDGE_RIGHT); +} + +TEST_F(etTestInput, gesture_edge_swipe23) +{ + _test_gesture_edge_swipe(2, EFL_UTIL_GESTURE_EDGE_BOTTOM); +} + +TEST_F(etTestInput, gesture_edge_swipe24) +{ + _test_gesture_edge_swipe(2, EFL_UTIL_GESTURE_EDGE_LEFT); } \ No newline at end of file -- 2.7.4 From 3dcc74385ff1e530654921d789b9a54df9b597a2 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Wed, 2 Jan 2019 14:09:52 +0900 Subject: [PATCH 02/16] Packaging: update version to 0.4.0 Change-Id: I576e82afad297d3f8b51d85db26e1a7f8a308513 --- packaging/e-tizen-unittests.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-tizen-unittests.spec b/packaging/e-tizen-unittests.spec index 3998908..86259bd 100644 --- a/packaging/e-tizen-unittests.spec +++ b/packaging/e-tizen-unittests.spec @@ -1,5 +1,5 @@ Name: e-tizen-unittests -Version: 0.3.3 +Version: 0.4.0 Release: 1 Summary: The test case runner for enlightenment URL: http://www.enlightenment.org -- 2.7.4 From 6c5a6b92197e57b1b42c62eca13ca469f30c889b Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Wed, 2 Jan 2019 14:18:12 +0900 Subject: [PATCH 03/16] 0008_focus: fixed warnings Change-Id: I743ca82783358b5ced3a3206a395e2b72983b0bb --- src/testcase/0008_focus.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/testcase/0008_focus.cpp b/src/testcase/0008_focus.cpp index 7abca43..9832cad 100644 --- a/src/testcase/0008_focus.cpp +++ b/src/testcase/0008_focus.cpp @@ -653,7 +653,6 @@ TEST_F(etTestFocus, focus_visibility) TEST_F(etTestFocus, focus_move) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true @@ -681,7 +680,6 @@ TEST_F(etTestFocus, focus_move) TEST_F(etTestFocus, DISABLED_focus_move2) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true -- 2.7.4 From 1286d74ebba2214d5cb8a9d889129da5028d8989 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 2 Jan 2019 17:13:06 +0900 Subject: [PATCH 04/16] 0009_input: add edge drag gesture testcases Change-Id: If22e9578d21c478ae9ad22e5888e8132e52ffd8b --- src/e_test_event.cpp | 149 +++++++++++++++++++++++++++++++++++++++++--- src/e_test_event.h | 2 +- src/e_test_util.h | 1 + src/testcase/0009_input.cpp | 87 ++++++++++++++++++++++++-- 4 files changed, 224 insertions(+), 15 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index fea6f23..b176064 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -100,10 +100,12 @@ static Eina_Bool _ev_wait_timeout(void *data); /* callbacks - gesture */ static Eina_Bool _cb_gesture_tap(void *data, int type, void *event); static Eina_Bool _cb_gesture_edge_swipe(void *data, int type, void *event); +static Eina_Bool _cb_gesture_edge_drag(void *data, int type, void *event); /* functions - gesture */ static void _gesture_tap_generate(etRunner *runner); static void _gesture_edge_swipe_generate(etRunner *runner); +static void _gesture_edge_drag_generate(etRunner *runner); /********************** listeners @@ -1056,6 +1058,11 @@ etRunner::waitEvent(E_TC_Event_Type ev_type) _gesture_edge_swipe_generate(this); break; + case E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG: + eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_DRAG, _cb_gesture_edge_drag, this); + _gesture_edge_drag_generate(this); + break; + default: goto finish; break; @@ -1827,13 +1834,13 @@ _cb_gesture_edge_swipe(void *data, int type, void *event) efl_util_event_gesture_edge_swipe_s *ev = (efl_util_event_gesture_edge_swipe_s *)event; - if ((ev->fingers == (unsigned int)runner->ev.gesture.edge_swipe.fingers) && - (ev->edge == (unsigned int)runner->ev.gesture.edge_swipe.edge)) + if ((ev->fingers == (unsigned int)runner->ev.gesture.edge.fingers) && + (ev->edge == (unsigned int)runner->ev.gesture.edge.edge)) { runner->ev.response = E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE; if (runner->ev.gesture.timer) { - runner->ev.gesture.edge_swipe.get_event = EINA_TRUE; + runner->ev.gesture.edge.get_event = EINA_TRUE; } else elm_exit(); @@ -1849,9 +1856,9 @@ _cb_gesture_edge_swipe_delay_timer(void *data) int i, cnt, fingers, w, h; efl_util_gesture_edge_e edge; - cnt = ++runner->ev.gesture.edge_swipe.touch_count; - fingers = runner->ev.gesture.edge_swipe.fingers; - edge = runner->ev.gesture.edge_swipe.edge; + cnt = ++runner->ev.gesture.edge.touch_count; + fingers = runner->ev.gesture.edge.fingers; + edge = runner->ev.gesture.edge.edge; w = runner->output.w - 1; h = runner->output.h - 1; @@ -1926,9 +1933,9 @@ _cb_gesture_edge_swipe_delay_timer(void *data) } runner->ev.gesture.timer = NULL; - if (runner->ev.gesture.edge_swipe.get_event) + if (runner->ev.gesture.edge.get_event) { - runner->ev.gesture.edge_swipe.get_event = EINA_FALSE; + runner->ev.gesture.edge.get_event = EINA_FALSE; elm_exit(); } return ECORE_CALLBACK_CANCEL; @@ -1945,11 +1952,133 @@ _cb_gesture_edge_swipe_delay_timer(void *data) static void _gesture_edge_swipe_generate(etRunner *runner) { - runner->ev.gesture.edge_swipe.touch_count = 0; - runner->ev.gesture.edge_swipe.get_event = EINA_FALSE; + runner->ev.gesture.edge.touch_count = 0; + runner->ev.gesture.edge.get_event = EINA_FALSE; runner->ev.gesture.timer = ecore_timer_add(1.0, _cb_gesture_edge_swipe_delay_timer, runner); } +static Eina_Bool +_cb_gesture_edge_drag(void *data, int type, void *event) +{ + etRunner *runner = (etRunner *)data; + efl_util_event_gesture_edge_drag_s *ev = + (efl_util_event_gesture_edge_drag_s *)event; + + if ((ev->fingers == (unsigned int)runner->ev.gesture.edge.fingers) && + (ev->edge == (unsigned int)runner->ev.gesture.edge.edge) && + (ev->mode == EFL_UTIL_GESTURE_MODE_END)) + { + runner->ev.response = E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG; + elm_exit(); + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_cb_gesture_edge_drag_delay_timer(void *data) +{ + etRunner *runner = (etRunner *)data; + int i, cnt, fingers, w, h; + efl_util_gesture_edge_e edge; + + cnt = ++runner->ev.gesture.edge.touch_count; + fingers = runner->ev.gesture.edge.fingers; + edge = runner->ev.gesture.edge.edge; + w = runner->output.w - 1; + h = runner->output.h - 1; + + if (cnt == 1) + { + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchDown(i, 100 * (i + 1), 1); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchDown(i, w - 1, 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchDown(i, 100 * (i + 1), h - 1); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchDown(i, 1, 100 * (i + 1)); + break; + default: + break; + } + } + } + else if (cnt < 5) + { + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchMove(i, 100 * (i + 1), 50 * cnt); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchMove(i, (w - 1) - (50 * cnt), 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchMove(i, 100 * (i + 1), (h - 1) - (50 * cnt)); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchMove(i, 50 * cnt, 100 * (i + 1)); + break; + default: + break; + } + } + } + else + { + cnt--; + for (i = 0; i < fingers; i++) + { + switch (edge) + { + case EFL_UTIL_GESTURE_EDGE_TOP: + runner->generateTouchUp(i, 100 * (i + 1), 50 * cnt); + break; + case EFL_UTIL_GESTURE_EDGE_RIGHT: + runner->generateTouchUp(i, (w - 1) - (50 * cnt), 100 * (i + 1)); + break; + case EFL_UTIL_GESTURE_EDGE_BOTTOM: + runner->generateTouchUp(i, 100 * (i + 1), (h - 1) - (50 * cnt)); + break; + case EFL_UTIL_GESTURE_EDGE_LEFT: + runner->generateTouchUp(i, 50 * cnt, 100 * (i + 1)); + break; + default: + break; + } + } + + runner->ev.gesture.timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + + runner->ev.gesture.timer = NULL; + runner->ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_edge_drag_delay_timer, + runner); + + return ECORE_CALLBACK_CANCEL; +} + +static void +_gesture_edge_drag_generate(etRunner *runner) +{ + runner->ev.gesture.edge.touch_count = 0; + + runner->ev.gesture.timer = ecore_timer_add(1.0, + _cb_gesture_edge_drag_delay_timer, + runner); +} diff --git a/src/e_test_event.h b/src/e_test_event.h index 81373c2..aa40618 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -95,7 +95,7 @@ public: /* TODO: make it hidden */ efl_util_gesture_edge_e edge; int touch_count; Eina_Bool get_event; - } edge_swipe; + } edge; } gesture; } ev; struct diff --git a/src/e_test_util.h b/src/e_test_util.h index cbc05cd..5abf0f4 100644 --- a/src/e_test_util.h +++ b/src/e_test_util.h @@ -81,6 +81,7 @@ typedef enum _E_TC_Event_Type E_TC_EVENT_TYPE_EFFECT, E_TC_EVENT_TYPE_GESTURE_TAP, E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE, + E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG, E_TC_EVENT_TYPE_MAX } E_TC_Event_Type; diff --git a/src/testcase/0009_input.cpp b/src/testcase/0009_input.cpp index da194a6..15929d6 100644 --- a/src/testcase/0009_input.cpp +++ b/src/testcase/0009_input.cpp @@ -377,14 +377,14 @@ _test_gesture_edge_swipe(int fingers, efl_util_gesture_edge_e edge) ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge swipe gesture: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; - etRunner::get().ev.gesture.edge_swipe.fingers = fingers; - etRunner::get().ev.gesture.edge_swipe.edge = edge; + etRunner::get().ev.gesture.edge.fingers = fingers; + etRunner::get().ev.gesture.edge.edge = edge; ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE); ASSERT_TRUE(ret); - etRunner::get().ev.gesture.edge_swipe.fingers = 0; - etRunner::get().ev.gesture.edge_swipe.edge = EFL_UTIL_GESTURE_EDGE_NONE;; + etRunner::get().ev.gesture.edge.fingers = 0; + etRunner::get().ev.gesture.edge.edge = EFL_UTIL_GESTURE_EDGE_NONE;; ret = efl_util_gesture_ungrab(gesture_h, edge_swipe_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge swipe gesture: (ret: " @@ -437,4 +437,83 @@ TEST_F(etTestInput, gesture_edge_swipe23) TEST_F(etTestInput, gesture_edge_swipe24) { _test_gesture_edge_swipe(2, EFL_UTIL_GESTURE_EDGE_LEFT); +} + +static void +_test_gesture_edge_drag(int fingers, efl_util_gesture_edge_e edge) +{ + int ret = EFL_UTIL_ERROR_NONE; + efl_util_gesture_h gesture_h; + efl_util_gesture_data edge_drag_d; + + gesture_h = efl_util_gesture_initialize(); + ASSERT_TRUE(gesture_h != NULL) << "failed to initialize gesture system"; + + edge_drag_d = efl_util_gesture_edge_drag_new(gesture_h, fingers, edge); + ASSERT_TRUE(edge_drag_d != NULL) << "failed to generate edge drag grab data"; + + ret = efl_util_gesture_grab(gesture_h, edge_drag_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge drag gesture: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + etRunner::get().ev.gesture.edge.fingers = fingers; + etRunner::get().ev.gesture.edge.edge = edge; + + ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG); + ASSERT_TRUE(ret); + + etRunner::get().ev.gesture.edge.fingers = 0; + etRunner::get().ev.gesture.edge.edge = EFL_UTIL_GESTURE_EDGE_NONE;; + + ret = efl_util_gesture_ungrab(gesture_h, edge_drag_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to grab edge drag gesture: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + ret = efl_util_gesture_edge_drag_free(gesture_h, edge_drag_d); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; + + ret = efl_util_gesture_deinitialize(gesture_h); + ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to deinitialize gesture system: (ret: " + << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; +} + +TEST_F(etTestInput, gesture_edge_drag11) +{ + _test_gesture_edge_drag(1, EFL_UTIL_GESTURE_EDGE_TOP); +} + +TEST_F(etTestInput, gesture_edge_drag12) +{ + _test_gesture_edge_drag(1, EFL_UTIL_GESTURE_EDGE_RIGHT); +} + +TEST_F(etTestInput, gesture_edge_drag13) +{ + _test_gesture_edge_drag(1, EFL_UTIL_GESTURE_EDGE_BOTTOM); +} + +TEST_F(etTestInput, gesture_edge_drag14) +{ + _test_gesture_edge_drag(1, EFL_UTIL_GESTURE_EDGE_LEFT); +} + +TEST_F(etTestInput, gesture_edge_drag21) +{ + _test_gesture_edge_drag(2, EFL_UTIL_GESTURE_EDGE_TOP); +} + +TEST_F(etTestInput, gesture_edge_drag22) +{ + _test_gesture_edge_drag(2, EFL_UTIL_GESTURE_EDGE_RIGHT); +} + +TEST_F(etTestInput, gesture_edge_drag23) +{ + _test_gesture_edge_drag(2, EFL_UTIL_GESTURE_EDGE_BOTTOM); +} + +TEST_F(etTestInput, gesture_edge_drag24) +{ + _test_gesture_edge_drag(2, EFL_UTIL_GESTURE_EDGE_LEFT); } \ No newline at end of file -- 2.7.4 From e54538947a3b196d9f8793db851bfb2d00681faf Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Mon, 28 Jan 2019 11:32:07 +0900 Subject: [PATCH 05/16] e_test_event: add initializer of etRunner.output Change-Id: Iee4f7ae20943089de8a072ad138b35debfb0f044 --- src/e_test_event.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/e_test_event.h b/src/e_test_event.h index aa40618..77f06b2 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -28,6 +28,7 @@ private: dbus.proxy = NULL; dbus.obj = NULL; listWinInfo = NULL; + output = {0,}; }; ~etRunner() {} -- 2.7.4 From d8625836fb8bb5fa32a375f29631f8a19f888857 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 4 Jan 2019 16:29:32 +0900 Subject: [PATCH 06/16] e_test_event: supporting multiple event existing e_test_event can support only single event that registered window. this patch makes e_test_event can support multiple event of all of testcase's window. From now on, you can use waitEvent without registerTCWin. but, waitEvent needs etWin pointer to check event. Change-Id: I3cc9d92db78bc5d52d4b11a9b56af45d493a58a2 --- src/Makefile.am | 14 +- src/e_test_base.cpp | 75 +--- src/e_test_base.h | 7 +- src/e_test_event.cpp | 559 ++++++++++++++---------- src/e_test_event.h | 36 +- src/e_test_util.h | 12 +- src/eina_list_ext.h | 2 +- src/testcase/0001_easy.cpp | 47 +- src/testcase/0002_base_operation.cpp | 14 +- src/testcase/0003_base_operation_multi_wins.cpp | 80 +++- src/testcase/0004_transient_for.cpp | 42 +- src/testcase/0005_notification.cpp | 56 +-- src/testcase/0006_tzsh.cpp | 7 +- src/testcase/0007_rotation.cpp | 7 +- src/testcase/0008_focus.cpp | 214 ++++----- src/testcase/0009_input.cpp | 221 +++++----- src/testcase/0010_splash.cpp | 16 +- src/testcase/0011_effect.cpp | 82 ++-- 18 files changed, 812 insertions(+), 679 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1bcbe2a..22619e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,7 @@ e_tizen_unittests_LDADD = \ -lgtest \ @E_TEST_RUNNER_LIBS@ -e_tizen_unittests_TESTCASES = \ +tc_sources = \ testcase/0001_easy.cpp \ testcase/0002_base_operation.cpp \ testcase/0003_base_operation_multi_wins.cpp \ @@ -31,17 +31,7 @@ e_test_base.cpp \ e_test_win.h \ e_test_win.cpp \ e_test_util.h \ -testcase/0001_easy.cpp \ -testcase/0002_base_operation.cpp \ -testcase/0003_base_operation_multi_wins.cpp \ -testcase/0004_transient_for.cpp \ -testcase/0005_notification.cpp \ -testcase/0006_tzsh.cpp \ -testcase/0007_rotation.cpp \ -testcase/0008_focus.cpp \ -testcase/0009_input.cpp \ -testcase/0010_splash.cpp \ -testcase/0011_effect.cpp +${tc_sources} MAINTAINERCLEANFILES = \ Makefile.in diff --git a/src/e_test_base.cpp b/src/e_test_base.cpp index 8654809..0baec02 100644 --- a/src/e_test_base.cpp +++ b/src/e_test_base.cpp @@ -2,12 +2,21 @@ using ::testing::Test; +etTCBase::etTCBase() +{ + etRunner::get().flushEventQueue(); + etRunner::get().setTCStart(); +} + etTCBase::~etTCBase() { etWin *tw = NULL; numGeomTw = 0; numTw = 0; + etRunner::get().setTCEnd(); + etRunner::get().flushEventQueue(); + // if there are any error, print list of window if (HasFailure()) { @@ -15,13 +24,6 @@ etTCBase::~etTCBase() etRunner::get().waitForDestroy(); } - // remove register win - if (tw_register) - { - etRunner::get().deregisterWin(tw_register); - tw_register = NULL; - } - // remove all testcase win if (tw_list) { @@ -29,6 +31,7 @@ etTCBase::~etTCBase() { if (tw) { + deregisterTCWin(tw); tw->hide(); delete tw; tw = NULL; @@ -55,7 +58,7 @@ etTCBase::initFakeWin() etWin * -etTCBase::initNormalWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom) +etTCBase::initNormalWin(const char *name, Eina_Bool usr_geom) { Eina_Bool res = EINA_FALSE; etWin *tw = new etWin(); @@ -69,11 +72,8 @@ etTCBase::initNormalWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom EINA_SAFETY_ON_FALSE_GOTO(res, err); tw->native_win = etRunner::get().getWinId(tw->elm_win); - if (show_win) - { - res = showTCWin(tw); - EINA_SAFETY_ON_FALSE_GOTO(res, err); - } + res = registerTCWin(tw); + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); numTw++; if (usr_geom) numGeomTw++; @@ -88,7 +88,7 @@ err: } etWin * -etTCBase::initNotiWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom, Eina_Bool set_noti_level_normal) +etTCBase::initNotiWin(const char *name, Eina_Bool usr_geom, Eina_Bool set_noti_level_normal) { Eina_Bool res = EINA_FALSE; etWin *tw = new etWin(); @@ -105,11 +105,8 @@ etTCBase::initNotiWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom, if (set_noti_level_normal) etRunner::get().setWinNotiLevel(tw, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM); - if (show_win) - { - res = showTCWin(tw); - EINA_SAFETY_ON_FALSE_GOTO(res, err); - } + res = registerTCWin(tw); + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); numTw++; if (usr_geom) numGeomTw++; @@ -129,21 +126,10 @@ etTCBase::registerTCWin(etWin *tw) Eina_Bool res = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE); - if (tw == tw_register) return EINA_TRUE; - - if (tw_register) - { - res = etRunner::get().deregisterWin(tw_register); - EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - - tw_register = NULL; - } res = etRunner::get().registerWin(tw); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - tw_register = tw; - return EINA_TRUE; } @@ -152,34 +138,23 @@ etTCBase::deregisterTCWin(etWin *tw) { Eina_Bool res = EINA_FALSE; - if (!tw_register) return EINA_TRUE; EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE); - EINA_SAFETY_ON_TRUE_RETURN_VAL(tw != tw_register, EINA_FALSE); res = etRunner::get().deregisterWin(tw); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - tw_register = NULL; - return EINA_TRUE; } Eina_Bool etTCBase::showTCWin(etWin *tw) { - Eina_Bool res = EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(tw->elm_win, EINA_FALSE); - res = registerTCWin(tw); - EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - tw->updateGeometry(); tw->show(); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); - return EINA_TRUE; } @@ -191,39 +166,23 @@ etTCBase::showActivateTCWin(etWin *tw) EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(tw->elm_win, EINA_FALSE); - res = registerTCWin(tw); - EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - tw->updateGeometry(); tw->show(); res = etRunner::get().setWinActivate(tw); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); - return EINA_TRUE; } Eina_Bool etTCBase::removeTCWin(etWin *tw) { - Eina_Bool res = EINA_FALSE; - EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(tw->elm_win, EINA_FALSE); - res = registerTCWin(tw); - EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); - tw->hide(); - - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); - - res = deregisterTCWin(tw); - tw_list = eina_list_remove(tw_list, tw); - delete tw; + deregisterTCWin(tw); return EINA_TRUE; } - diff --git a/src/e_test_base.h b/src/e_test_base.h index c381cce..31abe7c 100644 --- a/src/e_test_base.h +++ b/src/e_test_base.h @@ -8,13 +8,13 @@ using ::testing::Test; class etTCBase : public ::testing::Test { public: - etTCBase() { }; + etTCBase(); ~etTCBase(); public: etWin *initFakeWin(); - etWin *initNormalWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom); - etWin *initNotiWin(const char *name, Eina_Bool show_win, Eina_Bool usr_geom, Eina_Bool set_noti_level_normal); + etWin *initNormalWin(const char *name, Eina_Bool usr_geom); + etWin *initNotiWin(const char *name, Eina_Bool usr_geom, Eina_Bool set_noti_level_normal); Eina_Bool registerTCWin(etWin *tw); Eina_Bool deregisterTCWin(etWin *tw); @@ -23,7 +23,6 @@ class etTCBase : public ::testing::Test Eina_Bool removeTCWin(etWin *tw); private: - etWin *tw_register = NULL; Eina_List *tw_list = NULL; int numTw = 0; // number of wins diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index b176064..69ba1f2 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -72,6 +72,7 @@ static void _cb_method_win_info_list_get(void *data, const Eldbus_Message *msg, static void _cb_method_window_register(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); static void _cb_method_zone_rotation_change(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); static void _cb_method_window_effect(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); +static void _cb_method_set_tc_start_end(void *data, const Eldbus_Message *msg, Eldbus_Pending *p); /* callbacks - signal */ static void _cb_signal_vis_changed(void *data, const Eldbus_Message *msg); @@ -81,8 +82,8 @@ static void _cb_signal_focus_changed(void *data, const Eldbus_Message *msg); static void _cb_signal_render_while_effect_run(void *data, const Eldbus_Message *msg); /* callbacks - ecore */ -static Eina_Bool _cb_ecore_key(void *data, int type, void *event); -static Eina_Bool _cb_key_delay_timer(void *data); +static Eina_Bool _cb_ecore_key_down(void *data, int type, void *event); +static Eina_Bool _cb_ecore_key_up(void *data, int type, void *event); /* callbacks - evas */ static void _cb_evas_key_down(void * data, Evas * evas, Evas_Object * obj, void * event_info); @@ -95,18 +96,12 @@ static void _cb_evas_smart_cb_launch_done(void *data, Evas_Object * obj, void *e /* callbacks - timer */ static Eina_Bool _cb_work_timeout(void *data); -static Eina_Bool _ev_wait_timeout(void *data); /* callbacks - gesture */ static Eina_Bool _cb_gesture_tap(void *data, int type, void *event); static Eina_Bool _cb_gesture_edge_swipe(void *data, int type, void *event); static Eina_Bool _cb_gesture_edge_drag(void *data, int type, void *event); -/* functions - gesture */ -static void _gesture_tap_generate(etRunner *runner); -static void _gesture_edge_swipe_generate(etRunner *runner); -static void _gesture_edge_drag_generate(etRunner *runner); - /********************** listeners **********************/ @@ -166,6 +161,15 @@ etRunner::init() // init input generator inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD); + EINA_SAFETY_ON_NULL_RETURN_VAL(inputGenerator, EINA_FALSE); + + // init gesture handler + gestureHandler = efl_util_gesture_initialize(); + EINA_SAFETY_ON_NULL_RETURN_VAL(gestureHandler, EINA_FALSE); + + // add signal handlers + res = addSignalHandlers(); + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); return EINA_TRUE; } @@ -176,6 +180,7 @@ etRunner::shutdown() eina_log_domain_unregister(logDomain); freeLastWinInfoList(); + delSignalHandlers(); // deinit tizen_extension protocol if (tzPolicy) @@ -210,6 +215,9 @@ etRunner::shutdown() // deinit input generator efl_util_input_deinitialize_generator(inputGenerator); + + // deinit gesture handler + efl_util_gesture_deinitialize(gestureHandler); } Eina_Bool @@ -402,6 +410,52 @@ etRunner::setZoneRotation(int angle) } Eina_Bool +etRunner::setTCStart() +{ + Eldbus_Pending *p = NULL; + Eina_Bool res = EINA_FALSE; + + p = eldbus_proxy_call(dbus.proxy, + "StartTestCase", + _cb_method_set_tc_start_end, + &res, + -1, + ""); + EINA_SAFETY_ON_NULL_GOTO(p, err); + + work(); + + EINA_SAFETY_ON_FALSE_GOTO(res, err); + + return EINA_TRUE; + +err: + setTCEnd(); + return EINA_FALSE; +} + +Eina_Bool +etRunner::setTCEnd() +{ + Eldbus_Pending *p = NULL; + Eina_Bool res = EINA_FALSE; + + p = eldbus_proxy_call(dbus.proxy, + "EndTestCase", + _cb_method_set_tc_start_end, + &res, + -1, + ""); + if (p == NULL) res = EINA_FALSE; + + work(); + + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); + + return EINA_TRUE; +} + +Eina_Bool etRunner::getWinInfo(etWin *tw) { Eldbus_Pending *p = NULL; @@ -790,12 +844,18 @@ etRunner::generateKeyRelease(const char *keyname) return EINA_TRUE; } -void +Eina_Bool etRunner::generateKeyEvent(const char *keyname, double delay) { - this->ev.key.timer = ecore_timer_add(delay, - _cb_key_delay_timer, - this); + Eina_Bool res = EINA_FALSE; + + res = etRunner::get().generateKeyPress(keyname); + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); + + res = etRunner::get().generateKeyRelease(keyname); + EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); + + return res; } Eina_Bool @@ -921,7 +981,7 @@ etRunner::setWinEffect(etWin *tw) Eldbus_Pending *p = NULL; Eina_Bool accepted = EINA_FALSE; - this->ev.win = tw->elm_win; + this->ev.elm_win = tw->elm_win; p = eldbus_proxy_call(dbus.proxy, "RenderTrace", @@ -968,147 +1028,186 @@ etRunner::thawEvent() } Eina_Bool -etRunner::waitEvent(E_TC_Event_Type ev_type) +etRunner::waitEvent(etWin *win, E_TC_Event_Type ev_type) { - Eldbus_Signal_Handler *sh = NULL; - Ecore_Event_Handler *eh = NULL, *eh2 = NULL; + E_TC_Event_Item *recv_item = NULL; Eina_Bool res = EINA_FALSE; - EINA_SAFETY_ON_FALSE_RETURN_VAL((E_TC_EVENT_TYPE_NONE < ev_type), res); - EINA_SAFETY_ON_FALSE_RETURN_VAL((E_TC_EVENT_TYPE_MAX > ev_type), res); - + // swap event switch (ev_type) { case E_TC_EVENT_TYPE_VIS_ON: case E_TC_EVENT_TYPE_VIS_OFF: case E_TC_EVENT_TYPE_VIS_CHANGED: - sh = eldbus_proxy_signal_handler_add(dbus.proxy, - "VisibilityChanged", - _cb_signal_vis_changed, - this); - EINA_SAFETY_ON_NULL_GOTO(sh, finish); + ev_type = E_TC_EVENT_TYPE_VIS_CHANGED; break; - case E_TC_EVENT_TYPE_STACK_RAISE: case E_TC_EVENT_TYPE_STACK_LOWER: case E_TC_EVENT_TYPE_STACK_ABOVE: case E_TC_EVENT_TYPE_STACK_BELOW: - sh = eldbus_proxy_signal_handler_add(dbus.proxy, - "StackChanged", - _cb_signal_stack_changed, - this); - EINA_SAFETY_ON_NULL_GOTO(sh, finish); + case E_TC_EVENT_TYPE_STACK_CHANGED: + ev_type = E_TC_EVENT_TYPE_STACK_CHANGED; break; + } - case E_TC_EVENT_TYPE_WINDOW_ROTATION_CHANGE: - sh = eldbus_proxy_signal_handler_add(dbus.proxy, - "WinRotationChanged", - _cb_signal_win_rot_changed, - this); - EINA_SAFETY_ON_NULL_GOTO(sh, finish); - break; + // Add event callbacks if needs + if (ev_type == E_TC_EVENT_TYPE_EFFECT_EVAS_CB) + { + ev.elm_win = win->elm_win; + ev.native_win = win->native_win; + ev.effect.state_smcb = E_TC_EVAS_SMART_CB_STATE_NONE; - case E_TC_EVENT_TYPE_FOCUS_CHANGED: - sh = eldbus_proxy_signal_handler_add(dbus.proxy, - "FocusChanged", - _cb_signal_focus_changed, - this); - EINA_SAFETY_ON_NULL_GOTO(sh, finish); - break; + evas_object_smart_callback_add(this->ev.elm_win, effect_started, _cb_evas_smart_cb_effect_started, this); + evas_object_smart_callback_add(this->ev.elm_win, effect_done, _cb_evas_smart_cb_effect_done, this); + evas_object_smart_callback_add(this->ev.elm_win, launch_done, _cb_evas_smart_cb_launch_done, this); + } + else if (ev_type == E_TC_EVENT_TYPE_INPUT_EVAS_KEY) + { + ev.elm_win = win->elm_win; + ev.native_win = win->native_win; + evas_object_event_callback_add(this->ev.elm_win, EVAS_CALLBACK_KEY_DOWN, _cb_evas_key_down, this); + evas_object_event_callback_add(this->ev.elm_win, EVAS_CALLBACK_KEY_UP, _cb_evas_key_up, this); - case E_TC_EVENT_TYPE_INPUT_ECORE_KEY: - eh = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _cb_ecore_key, this); - EINA_SAFETY_ON_NULL_GOTO(eh, finish); - eh2 = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _cb_ecore_key, this); - EINA_SAFETY_ON_NULL_GOTO(eh2, finish); + ev.key.evas_state = EINA_FALSE; + } - this->ev.key.state = EINA_FALSE; - this->generateKeyEvent(this->ev.key.name, 1.0); - break; + // pre-waiting events + work(0.5); - case E_TC_EVENT_TYPE_INPUT_EVAS_KEY: - evas_object_event_callback_add(this->ev.win, EVAS_CALLBACK_KEY_DOWN, _cb_evas_key_down, this); - evas_object_event_callback_add(this->ev.win, EVAS_CALLBACK_KEY_UP, _cb_evas_key_up, this); + if (ev.recv_queue == NULL) + { + work(0.5); // waiting additional time + if (ev.recv_queue == NULL) + return EINA_FALSE; + } - this->ev.key.state = EINA_FALSE; - this->generateKeyEvent(this->ev.key.name, 1.0); - break; + EINA_LIST_CAST_FREE(ev.recv_queue, recv_item, E_TC_Event_Item*) + { + if ((recv_item->win == (win?win->native_win:0)) && + (recv_item->type == ev_type)) + { + ev.recv_queue = eina_list_remove(ev.recv_queue, recv_item); + res = EINA_TRUE; + break; + } + } - case E_TC_EVENT_TYPE_EFFECT: - sh = eldbus_proxy_signal_handler_add(dbus.proxy, - "RenderRun", - _cb_signal_render_while_effect_run, - this); - break; + return res; +} - case E_TC_EVENT_TYPE_EFFECT_EVAS_CB: - this->ev.effect.state_smcb = E_TC_EVAS_SMART_CB_STATE_NONE; - evas_object_smart_callback_add(this->ev.win, effect_started, _cb_evas_smart_cb_effect_started, this); - evas_object_smart_callback_add(this->ev.win, effect_done, _cb_evas_smart_cb_effect_done, this); - evas_object_smart_callback_add(this->ev.win, launch_done, _cb_evas_smart_cb_launch_done, this); - break; +void +etRunner::flushEventQueue() +{ + if (ev.recv_queue) + { + ev.recv_queue = eina_list_free(ev.recv_queue); + ev.recv_queue = NULL; + } +} - case E_TC_EVENT_TYPE_GESTURE_TAP: - eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_TAP, _cb_gesture_tap, this); - _gesture_tap_generate(this); - break; +Eina_Bool +etRunner::addEventIntoQueue(Ecore_Window id, E_TC_Event_Type ev_type) +{ + E_TC_Event_Item *item = E_NEW(E_TC_Event_Item, 1); + EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); - case E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE: - eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE, _cb_gesture_edge_swipe, this); - _gesture_edge_swipe_generate(this); - break; + item->win = id; + item->type = ev_type; + ev.recv_queue = eina_list_append(ev.recv_queue, item); - case E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG: - eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_DRAG, _cb_gesture_edge_drag, this); - _gesture_edge_drag_generate(this); - break; + return EINA_TRUE; +} - default: - goto finish; - break; - } +Eina_Bool +etRunner::addSignalHandlers() +{ + Eldbus_Signal_Handler *sh = NULL; + Ecore_Event_Handler *eh = NULL; - if (ev.expire_timer) - ecore_timer_del(ev.expire_timer); + flushEventQueue(); - ev.request = ev_type; - ev.response = E_TC_EVENT_TYPE_NONE; - ev.expire_timer = ecore_timer_add(5.0, _ev_wait_timeout, this); + sh = eldbus_proxy_signal_handler_add(dbus.proxy, + "VisibilityChanged", + _cb_signal_vis_changed, + this); + EINA_SAFETY_ON_NULL_GOTO(sh, err); + ev.sh_list = eina_list_append(ev.sh_list, sh); - elm_run(); + sh = eldbus_proxy_signal_handler_add(dbus.proxy, + "StackChanged", + _cb_signal_stack_changed, + this); + EINA_SAFETY_ON_NULL_GOTO(sh, err); + ev.sh_list = eina_list_append(ev.sh_list, sh); - if (ev.expire_timer) - { - ecore_timer_del(ev.expire_timer); - ev.expire_timer = NULL; - } + sh = eldbus_proxy_signal_handler_add(dbus.proxy, + "WinRotationChanged", + _cb_signal_win_rot_changed, + this); + EINA_SAFETY_ON_NULL_GOTO(sh, err); + ev.sh_list = eina_list_append(ev.sh_list, sh); + + sh = eldbus_proxy_signal_handler_add(dbus.proxy, + "FocusChanged", + _cb_signal_focus_changed, + this); + EINA_SAFETY_ON_NULL_GOTO(sh, err); + ev.sh_list = eina_list_append(ev.sh_list, sh); + + sh = eldbus_proxy_signal_handler_add(dbus.proxy, + "RenderRun", + _cb_signal_render_while_effect_run, + this); + EINA_SAFETY_ON_NULL_GOTO(sh, err); + ev.sh_list = eina_list_append(ev.sh_list, sh); + + eh = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _cb_ecore_key_down, this); + EINA_SAFETY_ON_NULL_GOTO(eh, err); + ev.eh_list = eina_list_append(ev.eh_list, eh); + + eh = ecore_event_handler_add(ECORE_EVENT_KEY_UP, _cb_ecore_key_up, this); + EINA_SAFETY_ON_NULL_GOTO(eh, err); + ev.eh_list = eina_list_append(ev.eh_list, eh); + + eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_TAP, _cb_gesture_tap, this); + EINA_SAFETY_ON_NULL_GOTO(eh, err); + ev.eh_list = eina_list_append(ev.eh_list, eh); + + eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE, _cb_gesture_edge_swipe, this); + EINA_SAFETY_ON_NULL_GOTO(eh, err); + ev.eh_list = eina_list_append(ev.eh_list, eh); + + eh = ecore_event_handler_add(EFL_UTIL_EVENT_GESTURE_EDGE_DRAG, _cb_gesture_edge_drag, this); + EINA_SAFETY_ON_NULL_GOTO(eh, err); + ev.eh_list = eina_list_append(ev.eh_list, eh); - if (sh) eldbus_signal_handler_del(sh); - if (this->ev.sh) eldbus_signal_handler_del(this->ev.sh); + ev.key.ecore_state = EINA_FALSE; - if (eh) ecore_event_handler_del(eh); - if (eh2) ecore_event_handler_del(eh2); + return EINA_TRUE; - if (ev_type == E_TC_EVENT_TYPE_INPUT_EVAS_KEY) +err: + printf("failed to init handlers\n"); + delSignalHandlers(); + return EINA_FALSE; +} + +void +etRunner::delSignalHandlers() +{ + Eldbus_Signal_Handler *sh = NULL; + Ecore_Event_Handler *eh = NULL; + + EINA_LIST_CAST_FREE(ev.sh_list, sh, Eldbus_Signal_Handler*) { - evas_object_event_callback_del(this->ev.win, EVAS_CALLBACK_KEY_DOWN, _cb_evas_key_down); - evas_object_event_callback_del(this->ev.win, EVAS_CALLBACK_KEY_UP, _cb_evas_key_up); + eldbus_signal_handler_del(sh); } - else if (ev_type == E_TC_EVENT_TYPE_EFFECT_EVAS_CB) + + EINA_LIST_CAST_FREE(ev.eh_list, eh, Ecore_Event_Handler*) { - evas_object_smart_callback_del(this->ev.win, effect_started, _cb_evas_smart_cb_effect_started); - evas_object_smart_callback_del(this->ev.win, effect_done, _cb_evas_smart_cb_effect_done); - evas_object_smart_callback_del(this->ev.win, launch_done, _cb_evas_smart_cb_launch_done); + ecore_event_handler_del(eh); } - res = (ev.response == ev.request); - EINA_SAFETY_ON_FALSE_GOTO(res, finish); - -finish: - ev.request = E_TC_EVENT_TYPE_NONE; - ev.response = E_TC_EVENT_TYPE_NONE; - - return res; + flushEventQueue(); } void @@ -1331,7 +1430,6 @@ _cb_method_win_info_list_get(void *data, { const char *name = NULL, *text = NULL, *wname = NULL; Eldbus_Message_Iter *array = NULL, *ec = NULL; - Ecore_Window target_win = 0; Window_Info_List *info_list = (Window_Info_List *)data; Eina_Bool res = EINA_FALSE, animating = EINA_FALSE; @@ -1341,7 +1439,7 @@ _cb_method_win_info_list_get(void *data, res = eldbus_message_error_get(msg, &name, &text); EINA_SAFETY_ON_TRUE_GOTO(res, finish); - res = eldbus_message_arguments_get(msg, "ua(" E_TC_SIGN_WIN_INFO ")", &target_win, &array); + res = eldbus_message_arguments_get(msg, "a(" E_TC_SIGN_WIN_INFO ")", &array); EINA_SAFETY_ON_FALSE_GOTO(res, finish); while (eldbus_message_iter_get_and_next(array, 'r', &ec)) @@ -1484,6 +1582,33 @@ finish: etRunner::get().finishWork(); } +static void +_cb_method_set_tc_start_end(void *data, + const Eldbus_Message *msg, + Eldbus_Pending *p) +{ + const char *name = NULL, *text = NULL; + Eina_Bool res = EINA_FALSE; + Eina_Bool *accept = (Eina_Bool *)data; + + *accept = EINA_FALSE; + + res = eldbus_message_error_get(msg, &name, &text); + EINA_SAFETY_ON_TRUE_GOTO(res, finish); + + res = eldbus_message_arguments_get(msg, "b", accept); + EINA_SAFETY_ON_FALSE_GOTO(res, finish); + EINA_SAFETY_ON_FALSE_GOTO(*accept, finish); + +finish: + if ((name) || (text)) + { + ERR("errname: %s errmsg: %s\n", name, text); + } + + etRunner::get().finishWork(); +} + /* callbacks - signal */ static void _cb_signal_vis_changed(void *data, @@ -1501,14 +1626,7 @@ _cb_signal_vis_changed(void *data, res = eldbus_message_arguments_get(msg, "ub", &id, &vis); EINA_SAFETY_ON_FALSE_GOTO(res, finish); - /* TODO */ - if (((E_TC_EVENT_TYPE_VIS_ON == runner->ev.request) && (vis)) || - ((E_TC_EVENT_TYPE_VIS_OFF == runner->ev.request) && (!vis)) || - (E_TC_EVENT_TYPE_VIS_CHANGED == runner->ev.request)) - { - runner->ev.response = runner->ev.request; - elm_exit(); - } + runner->addEventIntoQueue(id, E_TC_EVENT_TYPE_VIS_CHANGED); finish: if ((name) || (text)) @@ -1524,17 +1642,15 @@ _cb_signal_stack_changed(void *data, etRunner *runner = (etRunner *)data; const char *name = NULL, *text = NULL; Eina_Bool res = EINA_FALSE; + Ecore_Window id = 0; res = eldbus_message_error_get(msg, &name, &text); EINA_SAFETY_ON_TRUE_GOTO(res, finish); - /* TODO */ - if ((E_TC_EVENT_TYPE_STACK_RAISE <= runner->ev.request) && - (E_TC_EVENT_TYPE_STACK_BELOW >= runner->ev.request)) - { - runner->ev.response = runner->ev.request; - elm_exit(); - } + res = eldbus_message_arguments_get(msg, "u", &id); + EINA_SAFETY_ON_FALSE_GOTO(res, finish); + + runner->addEventIntoQueue(id, E_TC_EVENT_TYPE_STACK_CHANGED); finish: if ((name) || (text)) @@ -1560,8 +1676,7 @@ _cb_signal_win_rot_changed(void *data, res = eldbus_message_arguments_get(msg, "ui", &id, &angle); EINA_SAFETY_ON_FALSE_GOTO(res, finish); - runner->ev.response = runner->ev.request; - elm_exit(); + runner->addEventIntoQueue(id, E_TC_EVENT_TYPE_WINDOW_ROTATION_CHANGE); finish: if ((name) || (text)) @@ -1577,15 +1692,15 @@ _cb_signal_focus_changed(void *data, etRunner *runner = (etRunner *)data; const char *name = NULL, *text = NULL; Eina_Bool res = EINA_FALSE; + Ecore_Window id = 0; res = eldbus_message_error_get(msg, &name, &text); EINA_SAFETY_ON_TRUE_GOTO(res, finish); - if (E_TC_EVENT_TYPE_FOCUS_CHANGED == runner->ev.request) - { - runner->ev.response = runner->ev.request; - elm_exit(); - } + res = eldbus_message_arguments_get(msg, "u", &id); + EINA_SAFETY_ON_FALSE_GOTO(res, finish); + + runner->addEventIntoQueue(id, E_TC_EVENT_TYPE_FOCUS_CHANGED); finish: if ((name) || (text)) @@ -1601,12 +1716,15 @@ _cb_signal_render_while_effect_run(void *data, etRunner *runner = (etRunner *)data; const char *name = NULL, *text = NULL; Eina_Bool res = EINA_FALSE; + Ecore_Window id = 0; res = eldbus_message_error_get(msg, &name, &text); EINA_SAFETY_ON_TRUE_GOTO(res, finish); - runner->ev.response = runner->ev.request; - elm_exit(); + res = eldbus_message_arguments_get(msg, "u", &id); + EINA_SAFETY_ON_FALSE_GOTO(res, finish); + + runner->addEventIntoQueue(id, E_TC_EVENT_TYPE_EFFECT); finish: if ((name) || (text)) @@ -1623,41 +1741,42 @@ _cb_work_timeout(void *data) return ECORE_CALLBACK_CANCEL; } +/* callbacks - ecore */ static Eina_Bool -_ev_wait_timeout(void *data) +_cb_ecore_key_down(void *data, int type, void *event) { + Ecore_Event_Key *ev = (Ecore_Event_Key *)event; etRunner *runner = (etRunner *)data; - runner->ev.expire_timer = NULL; - runner->ev.response = E_TC_EVENT_TYPE_TIMEOUT; + if (runner->ev.key.name == NULL) return ECORE_CALLBACK_PASS_ON; - ERR("ev:%d\n", runner->ev.request); - - elm_exit(); + if (!strncmp(runner->ev.key.name, ev->keyname, strlen(ev->keyname))) + { + if (runner->ev.key.ecore_state == EINA_FALSE && + type == ECORE_EVENT_KEY_DOWN) + { + runner->ev.key.ecore_state = EINA_TRUE; + } + } - return ECORE_CALLBACK_DONE; + return ECORE_CALLBACK_PASS_ON; } -/* callbacks - ecore */ static Eina_Bool -_cb_ecore_key(void *data, int type, void *event) +_cb_ecore_key_up(void *data, int type, void *event) { Ecore_Event_Key *ev = (Ecore_Event_Key *)event; etRunner *runner = (etRunner *)data; + if (runner->ev.key.name == NULL) return ECORE_CALLBACK_PASS_ON; + if (!strncmp(runner->ev.key.name, ev->keyname, strlen(ev->keyname))) { - if (runner->ev.key.state == EINA_FALSE && - type == ECORE_EVENT_KEY_DOWN) - { - runner->ev.key.state = EINA_TRUE; - } - else if (runner->ev.key.state == EINA_TRUE && + if (runner->ev.key.ecore_state == EINA_TRUE && type == ECORE_EVENT_KEY_UP) { - runner->ev.response = runner->ev.request; - runner->ev.key.state = EINA_FALSE; - elm_exit(); + runner->ev.key.ecore_state = EINA_FALSE; + runner->addEventIntoQueue(0, E_TC_EVENT_TYPE_INPUT_ECORE_KEY); } } @@ -1675,10 +1794,10 @@ _cb_evas_key_down(void *data, Evas * evas, Evas_Object * obj, void * event_info) if (!strncmp(runner->ev.key.name, ev->keyname, strlen(ev->keyname))) { - if (runner->ev.key.state == EINA_FALSE && - runner->ev.win == obj) + if (runner->ev.key.evas_state == EINA_FALSE && + runner->ev.elm_win == obj) { - runner->ev.key.state = EINA_TRUE; + runner->ev.key.evas_state = EINA_TRUE; } } } @@ -1693,13 +1812,13 @@ _cb_evas_key_up(void * data, Evas * evas, Evas_Object * obj, void * event_info) if (!strncmp(runner->ev.key.name, ev->keyname, strlen(ev->keyname))) { - if (runner->ev.key.state == EINA_TRUE && - runner->ev.win == obj) + if (runner->ev.key.evas_state == EINA_TRUE && + runner->ev.elm_win == obj) { - runner->ev.response = runner->ev.request; - runner->ev.key.state = EINA_FALSE; - runner->ev.win = NULL; - elm_exit(); + runner->ev.key.evas_state = EINA_FALSE; + runner->ev.elm_win = NULL; + + runner->addEventIntoQueue(runner->ev.native_win, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); } } } @@ -1709,7 +1828,7 @@ static void _cb_evas_smart_cb_effect_started(void *data, Evas_Object * obj, void *event_info) { etRunner *runner = (etRunner *)data; - if (runner && runner->ev.win == obj) + if (runner && runner->ev.elm_win == obj) { runner->ev.effect.state_smcb = E_TC_EVAS_SMART_CB_STATE_EFFECT_STARTED; } @@ -1719,16 +1838,15 @@ static void _cb_evas_smart_cb_effect_done(void *data, Evas_Object * obj, void *event_info) { etRunner *runner = (etRunner *)data; - if (runner && runner->ev.win == obj) + if (runner && runner->ev.elm_win == obj) { runner->ev.effect.state_smcb |= E_TC_EVAS_SMART_CB_STATE_EFFECT_DONE; - if((runner->ev.effect.state_smcb & E_TC_EVAS_SMART_CB_STATE_EFFECT_STARTED) && - (runner->ev.effect.state_smcb & E_TC_EVAS_SMART_CB_STATE_EFFECT_DONE)) - { - runner->ev.response = runner->ev.request; - elm_exit(); - } + runner->addEventIntoQueue(runner->ev.native_win, E_TC_EVENT_TYPE_EFFECT_EVAS_CB); + + evas_object_smart_callback_del(runner->ev.elm_win, effect_started, _cb_evas_smart_cb_effect_started); + evas_object_smart_callback_del(runner->ev.elm_win, effect_done, _cb_evas_smart_cb_effect_done); + evas_object_smart_callback_del(runner->ev.elm_win, launch_done, _cb_evas_smart_cb_launch_done); } } @@ -1736,7 +1854,7 @@ static void _cb_evas_smart_cb_launch_done(void *data, Evas_Object * obj, void *event_info) { etRunner *runner = (etRunner *)data; - if (runner && runner->ev.win == obj) + if (runner && runner->ev.elm_win == obj) { runner->ev.effect.state_smcb |= E_TC_EVAS_SMART_CB_STATE_LAUNCH_DONE; @@ -1744,26 +1862,16 @@ _cb_evas_smart_cb_launch_done(void *data, Evas_Object * obj, void *event_info) (runner->ev.effect.state_smcb & E_TC_EVAS_SMART_CB_STATE_EFFECT_DONE) && (runner->ev.effect.state_smcb & E_TC_EVAS_SMART_CB_STATE_LAUNCH_DONE)) { - runner->ev.response = runner->ev.request; - elm_exit(); + runner->addEventIntoQueue(runner->ev.native_win, E_TC_EVENT_TYPE_EFFECT_EVAS_CB); + + evas_object_smart_callback_del(runner->ev.elm_win, effect_started, _cb_evas_smart_cb_effect_started); + evas_object_smart_callback_del(runner->ev.elm_win, effect_done, _cb_evas_smart_cb_effect_done); + evas_object_smart_callback_del(runner->ev.elm_win, launch_done, _cb_evas_smart_cb_launch_done); } } } static Eina_Bool -_cb_key_delay_timer(void *data) -{ - etRunner *runner = (etRunner *)data; - - runner->generateKeyPress(runner->ev.key.name); - runner->generateKeyRelease(runner->ev.key.name); - - runner->ev.key.timer = NULL; - - return ECORE_CALLBACK_CANCEL; -} - -static Eina_Bool _cb_gesture_tap(void *data, int type, void *event) { etRunner *runner = (etRunner *)data; @@ -1773,8 +1881,8 @@ _cb_gesture_tap(void *data, int type, void *event) if ((ev->fingers == (unsigned int)runner->ev.gesture.tap.fingers) && (ev->repeats == (unsigned int)runner->ev.gesture.tap.repeats)) { - runner->ev.response = E_TC_EVENT_TYPE_GESTURE_TAP; - elm_exit(); + runner->addEventIntoQueue(0, E_TC_EVENT_TYPE_GESTURE_TAP); + //ecore_event_handler_del(runner->ev.key.eh); } return ECORE_CALLBACK_PASS_ON; @@ -1816,15 +1924,17 @@ _cb_gesture_tap_delay_timer(void *data) return ECORE_CALLBACK_CANCEL; } -static void -_gesture_tap_generate(etRunner *runner) +Eina_Bool +etRunner::generateTapGesture() { - runner->ev.gesture.tap.current_repeats = runner->ev.gesture.tap.repeats; - runner->ev.gesture.tap.pressed = EINA_FALSE; + ev.gesture.tap.current_repeats = ev.gesture.tap.repeats; + ev.gesture.tap.pressed = EINA_FALSE; - runner->ev.gesture.timer = ecore_timer_add(1.0, - _cb_gesture_tap_delay_timer, - runner); + ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_tap_delay_timer, + this); + + return EINA_TRUE; } static Eina_Bool @@ -1837,13 +1947,8 @@ _cb_gesture_edge_swipe(void *data, int type, void *event) if ((ev->fingers == (unsigned int)runner->ev.gesture.edge.fingers) && (ev->edge == (unsigned int)runner->ev.gesture.edge.edge)) { - runner->ev.response = E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE; if (runner->ev.gesture.timer) - { - runner->ev.gesture.edge.get_event = EINA_TRUE; - } - else - elm_exit(); + runner->ev.gesture.edge.get_event = EINA_TRUE; } return ECORE_CALLBACK_PASS_ON; @@ -1935,8 +2040,8 @@ _cb_gesture_edge_swipe_delay_timer(void *data) runner->ev.gesture.timer = NULL; if (runner->ev.gesture.edge.get_event) { - runner->ev.gesture.edge.get_event = EINA_FALSE; - elm_exit(); + runner->addEventIntoQueue(0, E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE); + //ecore_event_handler_del(runner->ev.key.eh); } return ECORE_CALLBACK_CANCEL; } @@ -1949,15 +2054,17 @@ _cb_gesture_edge_swipe_delay_timer(void *data) return ECORE_CALLBACK_CANCEL; } -static void -_gesture_edge_swipe_generate(etRunner *runner) +Eina_Bool +etRunner::generateEdgeSwipeGesture() { - runner->ev.gesture.edge.touch_count = 0; - runner->ev.gesture.edge.get_event = EINA_FALSE; + ev.gesture.edge.touch_count = 0; + ev.gesture.edge.get_event = EINA_FALSE; - runner->ev.gesture.timer = ecore_timer_add(1.0, - _cb_gesture_edge_swipe_delay_timer, - runner); + ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_edge_swipe_delay_timer, + this); + + return EINA_TRUE; } static Eina_Bool @@ -1971,8 +2078,8 @@ _cb_gesture_edge_drag(void *data, int type, void *event) (ev->edge == (unsigned int)runner->ev.gesture.edge.edge) && (ev->mode == EFL_UTIL_GESTURE_MODE_END)) { - runner->ev.response = E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG; - elm_exit(); + runner->addEventIntoQueue(0, E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG); + //ecore_event_handler_del(runner->ev.key.eh); } return ECORE_CALLBACK_PASS_ON; @@ -2073,12 +2180,14 @@ _cb_gesture_edge_drag_delay_timer(void *data) return ECORE_CALLBACK_CANCEL; } -static void -_gesture_edge_drag_generate(etRunner *runner) +Eina_Bool +etRunner::generateEdgeDragGesture() { - runner->ev.gesture.edge.touch_count = 0; + ev.gesture.edge.touch_count = 0; - runner->ev.gesture.timer = ecore_timer_add(1.0, - _cb_gesture_edge_drag_delay_timer, - runner); + ev.gesture.timer = ecore_timer_add(0.11, + _cb_gesture_edge_drag_delay_timer, + this); + + return EINA_TRUE; } diff --git a/src/e_test_event.h b/src/e_test_event.h index 77f06b2..eb815cd 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -19,10 +19,7 @@ private: tzlaunch_effect = NULL; tzlaunch_splash = NULL; wlOutput = NULL; - ev.expire_timer = NULL; - ev.request = E_TC_EVENT_TYPE_NONE; - ev.response = E_TC_EVENT_TYPE_NONE; - ev.key = {0,}; + ev = {0,}; logDomain = 0; dbus.conn = NULL; dbus.proxy = NULL; @@ -64,15 +61,18 @@ private: public: /* TODO: make it hidden */ struct { - Ecore_Timer *expire_timer; - E_TC_Event_Type request; - E_TC_Event_Type response; - Evas_Object *win; - Eldbus_Signal_Handler *sh; + Evas_Object *elm_win; + Ecore_Window native_win; + + Eina_List *sh_list; + Eina_List *eh_list; + Eina_List *recv_queue; + struct { Eina_Stringshare *name; - Eina_Bool state; + Eina_Bool ecore_state; + Eina_Bool evas_state; Ecore_Timer *timer; } key; struct @@ -128,6 +128,8 @@ public: efl_util_notification_level_e getWinNotiLevel(etWin *tw); Eina_Bool setFocusSkip(etWin *tw, Eina_Bool set); Eina_Bool setZoneRotation(int angle); + Eina_Bool setTCStart(); + Eina_Bool setTCEnd(); Eina_Bool getWinInfo(etWin *tw); Eina_List *getWinInfoList(); void freeWinInfoList(Eina_List *list); @@ -147,24 +149,34 @@ public: Eina_Bool generateMouseUp(int x, int y); Eina_Bool generateKeyPress(const char *key); Eina_Bool generateKeyRelease(const char *key); - void generateKeyEvent(const char *keyname, double delay); + Eina_Bool generateKeyEvent(const char *keyname, double delay); Eina_Bool generateTouchDown(int idx, int x, int y); Eina_Bool generateTouchMove(int idx, int x, int y); Eina_Bool generateTouchUp(int idx, int x, int y); + Eina_Bool generateTapGesture(); + Eina_Bool generateEdgeSwipeGesture(); + Eina_Bool generateEdgeDragGesture(); Eina_Bool setSplashLaunch(const char *path, int type); Eina_Bool setSplashOwner(); Eina_Bool setWinEffect(etWin *tw); Eina_Bool freezeEvent(); Eina_Bool thawEvent(); - Eina_Bool waitEvent(E_TC_Event_Type ev); + Eina_Bool waitEvent(etWin *win, E_TC_Event_Type ev_type); + + void flushEventQueue(); + Eina_Bool addEventIntoQueue(Ecore_Window id, E_TC_Event_Type ev_type); + Eina_Bool addSignalHandlers(); + void delSignalHandlers(); Eldbus_Proxy *getDbusProxy() { return dbus.proxy; } Eldbus_Object *getDbusObject() { return dbus.obj; } int getLogDomain() { return logDomain; } + efl_util_gesture_h getGestureHandler() { return gestureHandler; } protected: Eina_Bool initProtocols(); efl_util_inputgen_h inputGenerator = NULL; + efl_util_gesture_h gestureHandler = NULL; }; #endif // end of __ET_EVENT_LOOP_H__ diff --git a/src/e_test_util.h b/src/e_test_util.h index 5abf0f4..9de90ca 100644 --- a/src/e_test_util.h +++ b/src/e_test_util.h @@ -73,6 +73,7 @@ typedef enum _E_TC_Event_Type E_TC_EVENT_TYPE_STACK_LOWER, E_TC_EVENT_TYPE_STACK_ABOVE, E_TC_EVENT_TYPE_STACK_BELOW, + E_TC_EVENT_TYPE_STACK_CHANGED, E_TC_EVENT_TYPE_WINDOW_ROTATION_CHANGE, E_TC_EVENT_TYPE_FOCUS_CHANGED, E_TC_EVENT_TYPE_INPUT_ECORE_KEY, @@ -170,7 +171,13 @@ typedef struct _Window_Info_List Eina_Bool retry; } Window_Info_List; -# define EFL_UTIL_RETURN_TO_STRING(type) \ +typedef struct _E_TC_Event_Item +{ + Ecore_Window win; + E_TC_Event_Type type; +} E_TC_Event_Item; + +#define EFL_UTIL_RETURN_TO_STRING(type) \ ((type == EFL_UTIL_ERROR_NONE)?"None": \ (type == EFL_UTIL_ERROR_INVALID_PARAMETER)?"Invalid parameter": \ (type == EFL_UTIL_ERROR_OUT_OF_MEMORY)?"Out of memory": \ @@ -182,8 +189,7 @@ typedef struct _Window_Info_List (type == EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL)?"Screenshot init fail": \ (type == EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL)?"Screenshot execution fail": \ (type == EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE)?"No resource available": \ - "Unknown") \ - + "Unknown") #endif // end of E_TC_MAIN_H #ifdef __cplusplus diff --git a/src/eina_list_ext.h b/src/eina_list_ext.h index 9798508..c7a204c 100644 --- a/src/eina_list_ext.h +++ b/src/eina_list_ext.h @@ -32,7 +32,7 @@ EINA_PREFETCH(data), \ l; \ l = l_next, \ - l_next = eina_list_prev(l), \ + l_next = eina_list_next(l), \ EINA_PREFETCH(l_next), \ data = (caster)eina_list_data_get(l), \ EINA_PREFETCH(data)) diff --git a/src/testcase/0001_easy.cpp b/src/testcase/0001_easy.cpp index 1a1d22d..7f13899 100644 --- a/src/testcase/0001_easy.cpp +++ b/src/testcase/0001_easy.cpp @@ -1,7 +1,8 @@ #include "e_test_event.h" #include "e_test_base.h" -#define _WIN_ID 0x123456 +#define _WIN_ID1 0x123456 +#define _WIN_ID2 0x654321 class etTestEasy : public ::etTCBase { @@ -25,7 +26,9 @@ _cb_introspect(void *data, res = eldbus_message_arguments_get(msg, "s", &arg); EINA_SAFETY_ON_FALSE_GOTO(res, finish); - if ((!strstr(arg, "method name=\"RegisterWindow\"" )) || + if ((!strstr(arg, "method name=\"StartTestCase\"" )) || + (!strstr(arg, "method name=\"EndTestCase\"" )) || + (!strstr(arg, "method name=\"RegisterWindow\"" )) || (!strstr(arg, "method name=\"DeregisterWindow\"" )) || (!strstr(arg, "method name=\"ResetRegisterWindow\"" )) || (!strstr(arg, "method name=\"SetWindowStack\"" )) || @@ -45,12 +48,12 @@ _cb_introspect(void *data, (!strstr(arg, "method name=\"HWC\"" )) || (!strstr(arg, "method name=\"GetCurrentZoneRotation\"" )) || (!strstr(arg, "method name=\"ChangeZoneRotation\"" )) || - (!strstr(arg, "method name=\"RenderTrace\"" )) || + (!strstr(arg, "method name=\"RenderTrace\"" )) || (!strstr(arg, "signal name=\"VisibilityChanged\"" )) || (!strstr(arg, "signal name=\"StackChanged\"" )) || (!strstr(arg, "signal name=\"WinRotationChanged\"" )) || (!strstr(arg, "signal name=\"FocusChanged\"" )) || - (!strstr(arg, "signal name=\"RenderRun\"" )) || + (!strstr(arg, "signal name=\"RenderRun\"" )) || (!strstr(arg, "property name=\"Registrant\"" ))) { ERR("missing mehod, signal or property:%s\n", arg); @@ -74,6 +77,7 @@ _cb_prop_registrant(void *data, Eina_Bool *ret = (Eina_Bool *)data; const char *name = NULL, *text = NULL; Eldbus_Message_Iter *variant = NULL; + Eldbus_Message_Iter *arr_of_win = NULL; Ecore_Window win; Eina_Bool res; char *type; @@ -91,14 +95,23 @@ _cb_prop_registrant(void *data, type = eldbus_message_iter_signature_get(variant); EINA_SAFETY_ON_NULL_GOTO(type, finish); - EINA_SAFETY_ON_FALSE_GOTO((type[0] == 'u'), finish); + EINA_SAFETY_ON_TRUE_GOTO(strncmp("au", type, strlen("au")) != 0, finish); - res = eldbus_message_iter_arguments_get(variant, "u", &win); + res = eldbus_message_iter_arguments_get(variant, "au", &arr_of_win); EINA_SAFETY_ON_FALSE_GOTO(res, finish); - EINA_SAFETY_ON_FALSE_GOTO((win == _WIN_ID), finish); *ret = EINA_TRUE; + while (eldbus_message_iter_get_and_next(arr_of_win, 'u', &win)) + { + if (win == _WIN_ID1) + *ret &= EINA_TRUE; + else if (win == _WIN_ID2) + *ret &= EINA_TRUE; + else + *ret = EINA_FALSE; + } + finish: if ((*ret) == EINA_FALSE) { @@ -146,12 +159,19 @@ TEST_F(etTestEasy, win_register) Eina_Bool res = EINA_FALSE; Eldbus_Pending *p = NULL; - etWin *tw = initFakeWin(); - ASSERT_TRUE(tw != NULL); + etWin *tw1 = initFakeWin(); + ASSERT_TRUE(tw1 != NULL); + + etWin *tw2 = initFakeWin(); + ASSERT_TRUE(tw2 != NULL); - tw->native_win = _WIN_ID; + tw1->native_win = _WIN_ID1; + tw2->native_win = _WIN_ID2; - res = etRunner::get().registerWin(tw); + res = etRunner::get().registerWin(tw1); + ASSERT_TRUE(res); + + res = etRunner::get().registerWin(tw2); ASSERT_TRUE(res); p = eldbus_proxy_property_get(etRunner::get().getDbusProxy(), @@ -163,6 +183,9 @@ TEST_F(etTestEasy, win_register) etRunner::get().work(); ASSERT_TRUE(res); - res = etRunner::get().deregisterWin(tw); + res = etRunner::get().deregisterWin(tw1); + ASSERT_TRUE(res); + + res = etRunner::get().deregisterWin(tw2); ASSERT_TRUE(res); } diff --git a/src/testcase/0002_base_operation.cpp b/src/testcase/0002_base_operation.cpp index 89690d9..fc06232 100644 --- a/src/testcase/0002_base_operation.cpp +++ b/src/testcase/0002_base_operation.cpp @@ -16,7 +16,7 @@ class etTestBaseOperation : public ::etTCBase void etTestBaseOperation::initTC(Eina_Bool alpha_set) { - tw = initNormalWin("TCWin_Normal", EINA_FALSE, EINA_TRUE); + tw = initNormalWin("TCWin_Normal", EINA_TRUE); ASSERT_TRUE(tw != NULL) << "failed to initiation window"; if (alpha_set) @@ -28,6 +28,9 @@ etTestBaseOperation::initTC(Eina_Bool alpha_set) TEST_F(etTestBaseOperation, win_show) { initTC(EINA_FALSE); + + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); } TEST_F(etTestBaseOperation, win_stack) @@ -38,6 +41,9 @@ TEST_F(etTestBaseOperation, win_stack) initTC(EINA_FALSE); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); + list = etRunner::get().getWinInfoList(); ASSERT_TRUE(list != NULL); @@ -59,6 +65,9 @@ TEST_F(etTestBaseOperation, win_stack) TEST_F(etTestBaseOperation, alpha_win_show) { initTC(EINA_TRUE); + + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); } TEST_F(etTestBaseOperation, alpha_win_stack) @@ -69,6 +78,9 @@ TEST_F(etTestBaseOperation, alpha_win_stack) initTC(EINA_TRUE); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); + list = etRunner::get().getWinInfoList(); ASSERT_TRUE(list != NULL); diff --git a/src/testcase/0003_base_operation_multi_wins.cpp b/src/testcase/0003_base_operation_multi_wins.cpp index d313416..551812f 100644 --- a/src/testcase/0003_base_operation_multi_wins.cpp +++ b/src/testcase/0003_base_operation_multi_wins.cpp @@ -18,14 +18,29 @@ class etTestBaseMulti : public ::etTCBase void etTestBaseMulti::initTC(Eina_Bool show_win, Eina_Bool usr_geom) { - tw_red = initNormalWin("TCWin_Normal_red", show_win, usr_geom); + tw_red = initNormalWin("TCWin_Normal_red", usr_geom); ASSERT_TRUE(tw_red != NULL) << "failed to initiation window"; + if (show_win) + { + showTCWin(tw_red); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } - tw_green = initNormalWin("TCWin_Normal_green", show_win, usr_geom); + tw_green = initNormalWin("TCWin_Normal_green", usr_geom); ASSERT_TRUE(tw_green != NULL) << "failed to initiation window"; + if (show_win) + { + showTCWin(tw_green); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } - tw_blue = initNormalWin("TCWin_Normal_blue", show_win, usr_geom); + tw_blue = initNormalWin("TCWin_Normal_blue", usr_geom); ASSERT_TRUE(tw_blue != NULL) << "failed to initiation window"; + if (show_win) + { + showTCWin(tw_blue); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } } TEST_F(etTestBaseMulti, multi_all_wins_basic) @@ -85,14 +100,17 @@ TEST_F(etTestBaseMulti, multi_all_wins_show1) // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Blue -> Red [Bottom] @@ -142,14 +160,17 @@ TEST_F(etTestBaseMulti, multi_all_wins_show2) // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Red -> Blue [Bottom] @@ -199,14 +220,17 @@ TEST_F(etTestBaseMulti, multi_all_wins_show3) // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Red -> Blue -> Green [Bottom] @@ -254,7 +278,8 @@ TEST_F(etTestBaseMulti, multi_all_wins_raise1) // Raise Red etRunner::get().setWinStack(tw_red, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected stack res: // [Top] Red -> Blue -> Green [Bottom] @@ -302,7 +327,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_raise2) // Raise Green etRunner::get().setWinStack(tw_green, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_RAISE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -350,7 +375,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_stack_above1) // Raise Red on the Green etRunner::get().setWinStack(tw_red, tw_green, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Blue -> Red -> Green [Bottom] @@ -398,7 +423,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_stack_above2) // Raise Blue on the Red etRunner::get().setWinStack(tw_blue, tw_red, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -446,7 +471,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_stack_above3) // Raise Red on the Blue etRunner::get().setWinStack(tw_red, tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -494,7 +519,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_lower1) // Lower Blue etRunner::get().setWinStack(tw_blue, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_STACK_LOWER); // Expected stack res: // [Top] Green -> Red -> ... -> Blue [Bottom] @@ -558,7 +583,7 @@ TEST_F(etTestBaseMulti, multi_all_wins_lower2) // Lower Green etRunner::get().setWinStack(tw_green, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_LOWER); // Expected stack res: // [Top] Blue -> Red -> ... -> Green [Bottom] @@ -668,14 +693,17 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_show1) // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Blue -> Red [Bottom] @@ -725,14 +753,17 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_show2) // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Red -> Blue [Bottom] @@ -782,14 +813,17 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_show3) // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Red -> Blue -> Green [Bottom] @@ -837,7 +871,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_raise1) // Raise Red etRunner::get().setWinStack(tw_red, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); // Expected stack res: // [Top] Red -> Blue -> Green [Bottom] @@ -885,7 +919,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_raise2) // Raise Green etRunner::get().setWinStack(tw_green, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_RAISE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -933,7 +967,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_stack_above1) // Raise Red on the Green etRunner::get().setWinStack(tw_red, tw_green, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Blue -> Red -> Green [Bottom] @@ -981,7 +1015,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_stack_above2) // Raise Blue on the Red etRunner::get().setWinStack(tw_blue, tw_red, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -1029,7 +1063,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_stack_above3) // Raise Red on the Blue etRunner::get().setWinStack(tw_red, tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected stack res: // [Top] Green-> Blue -> Red [Bottom] @@ -1077,7 +1111,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_lower1) // Lower Blue etRunner::get().setWinStack(tw_blue, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_STACK_LOWER); // Expected stack res: // [Top] Green -> Red -> ... -> Blue [Bottom] @@ -1141,7 +1175,7 @@ TEST_F(etTestBaseMulti, multi_all_full_wins_lower2) // Lower Green etRunner::get().setWinStack(tw_green, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_LOWER); // Expected stack res: // [Top] Blue -> Red -> ... -> Green [Bottom] @@ -1207,10 +1241,12 @@ TEST_F(etTestBaseMulti, multi_2wins_show1) // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Red -> Green [Bottom] @@ -1254,10 +1290,12 @@ TEST_F(etTestBaseMulti, multi_2wins_show2) // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Blue [Bottom] @@ -1301,10 +1339,12 @@ TEST_F(etTestBaseMulti, multi_2wins_show3) // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Blue -> Red [Bottom] @@ -1348,10 +1388,12 @@ TEST_F(etTestBaseMulti, multi_full_2wins_show1) // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Red -> Green [Bottom] @@ -1395,10 +1437,12 @@ TEST_F(etTestBaseMulti, multi_full_2wins_show2) // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // show green res = showTCWin(tw_green); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Green -> Blue [Bottom] @@ -1442,10 +1486,12 @@ TEST_F(etTestBaseMulti, multi_full_2wins_show3) // show red res = showTCWin(tw_red); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // show blue res = showTCWin(tw_blue); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // Expected stack res: // [Top] Blue -> Red [Bottom] diff --git a/src/testcase/0004_transient_for.cpp b/src/testcase/0004_transient_for.cpp index a4e9b47..2f6a8e9 100644 --- a/src/testcase/0004_transient_for.cpp +++ b/src/testcase/0004_transient_for.cpp @@ -18,13 +18,28 @@ class etTestTransientFor : public ::etTCBase void etTestTransientFor::initTC(Eina_Bool show_win, Eina_Bool usr_geom) { - tw_parent = initNormalWin("TCWin_Normal_parent", show_win, usr_geom); + tw_parent = initNormalWin("TCWin_Normal_parent", usr_geom); + if (show_win) + { + showTCWin(tw_parent); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_parent != NULL) << "failed to initiation window"; - tw_child = initNormalWin("TCWin_Normal_child", show_win, usr_geom); + tw_child = initNormalWin("TCWin_Normal_child", usr_geom); + if (show_win) + { + showTCWin(tw_child); + etRunner::get().waitEvent(tw_child, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_child != NULL) << "failed to initiation window"; - tw_base = initNormalWin("TCWin_Normal_normal", show_win, usr_geom); + tw_base = initNormalWin("TCWin_Normal_normal", usr_geom); + if (show_win) + { + showTCWin(tw_base); + etRunner::get().waitEvent(tw_base, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_base != NULL) << "failed to initiation window"; } @@ -41,6 +56,7 @@ TEST_F(etTestTransientFor, transient_for_basic) // set transient_for res = etRunner::get().setWinTransientFor(tw_child, tw_parent, EINA_TRUE); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_child, E_TC_EVENT_TYPE_STACK_CHANGED); // Expected stack res: // [Top] tw_base -> tw_child -> tw_parent [Bottom] @@ -89,14 +105,12 @@ TEST_F(etTestTransientFor, transient_for_raise) // set transient_for res = etRunner::get().setWinTransientFor(tw_child, tw_parent, EINA_TRUE); ASSERT_TRUE(res); - - res = registerTCWin(tw_parent); - EXPECT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_CHANGED); // tw_parent raise res = etRunner::get().setWinStack(tw_parent, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_CHANGED); // Expected stack res: // [Top] tw_child -> tw_parent -> tw_base [Bottom] @@ -146,19 +160,17 @@ TEST_F(etTestTransientFor, transient_for_lower) // set transient_for res = etRunner::get().setWinTransientFor(tw_child, tw_parent, EINA_TRUE); ASSERT_TRUE(res); - - res = registerTCWin(tw_parent); - EXPECT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_RAISE); // tw_parent raise for prepare lower res = etRunner::get().setWinStack(tw_parent, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_RAISE); // tw_parent lower res = etRunner::get().setWinStack(tw_parent, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_LOWER); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_LOWER); // Expected stack res: // [Top] tw_base -> ... -> tw_child -> tw_parent [Bottom] @@ -216,17 +228,15 @@ TEST_F(etTestTransientFor, transient_for_above) // init TC window, show=true, geom=true initTC(EINA_TRUE, EINA_TRUE); - res = registerTCWin(tw_parent); - EXPECT_TRUE(res); - // set transient_for res = etRunner::get().setWinTransientFor(tw_child, tw_parent, EINA_TRUE); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_child, E_TC_EVENT_TYPE_STACK_CHANGED); // tw_parent raise for prepare lower res = etRunner::get().setWinStack(tw_parent, tw_base, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_ABOVE); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_parent, E_TC_EVENT_TYPE_STACK_CHANGED); // Expected stack res: // [Top] tw_child -> tw_parent -> tw_base [Bottom] diff --git a/src/testcase/0005_notification.cpp b/src/testcase/0005_notification.cpp index 28b5ab1..cc41202 100644 --- a/src/testcase/0005_notification.cpp +++ b/src/testcase/0005_notification.cpp @@ -19,13 +19,19 @@ class etTestNotification : public ::etTCBase void etTestNotification::initTC(Eina_Bool usr_geom) { - tw_normal = initNormalWin("TCWin_Normal_normal", EINA_TRUE, usr_geom); + tw_normal = initNormalWin("TCWin_Normal_normal", usr_geom); + showTCWin(tw_normal); + etRunner::get().waitEvent(tw_normal, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(tw_normal != NULL) << "failed to initiation window"; - tw_noti1 = initNotiWin("TCWin_Noti_1", EINA_TRUE, usr_geom, EINA_FALSE); + tw_noti1 = initNotiWin("TCWin_Noti_1", usr_geom, EINA_FALSE); + showTCWin(tw_noti1); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(tw_noti1 != NULL) << "failed to initiation window"; - tw_noti2 = initNotiWin("TCWin_Noti_2", EINA_TRUE, usr_geom, EINA_FALSE); + tw_noti2 = initNotiWin("TCWin_Noti_2", usr_geom, EINA_FALSE); + showTCWin(tw_noti2); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(tw_noti2 != NULL) << "failed to initiation window"; } @@ -46,7 +52,7 @@ TEST_F(etTestNotification, notification_level_default) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT, level); @@ -109,7 +115,7 @@ TEST_F(etTestNotification, notification_level_medium) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM, level); @@ -172,7 +178,7 @@ TEST_F(etTestNotification, notification_level_high) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -235,7 +241,7 @@ TEST_F(etTestNotification, notification_level_top) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); @@ -296,7 +302,7 @@ TEST_F(etTestNotification, notification_level_none) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -304,7 +310,7 @@ TEST_F(etTestNotification, notification_level_none) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); @@ -355,7 +361,7 @@ TEST_F(etTestNotification, notification_level_none) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_NONE, level); @@ -414,7 +420,7 @@ TEST_F(etTestNotification, notification_level_change) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT, level); @@ -422,7 +428,7 @@ TEST_F(etTestNotification, notification_level_change) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM, level); @@ -471,7 +477,7 @@ TEST_F(etTestNotification, notification_level_change) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -520,7 +526,7 @@ TEST_F(etTestNotification, notification_level_change) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); @@ -582,7 +588,7 @@ TEST_F(etTestNotification, notification_fullsize_level_default) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT, level); @@ -645,7 +651,7 @@ TEST_F(etTestNotification, notification_fullsize_level_medium) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM, level); @@ -708,7 +714,7 @@ TEST_F(etTestNotification, notification_fullsize_level_high) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -771,7 +777,7 @@ TEST_F(etTestNotification, notification_fullsize_level_top) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); @@ -832,7 +838,7 @@ TEST_F(etTestNotification, notification_fullsize_level_none) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -840,7 +846,7 @@ TEST_F(etTestNotification, notification_fullsize_level_none) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); @@ -891,7 +897,7 @@ TEST_F(etTestNotification, notification_fullsize_level_none) EXPECT_TRUE(res); // TODO:: add ev_wait for notification level - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_RAISE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_NONE, level); @@ -950,7 +956,7 @@ TEST_F(etTestNotification, notification_fullsize_level_change) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_ABOVE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT, level); @@ -958,7 +964,7 @@ TEST_F(etTestNotification, notification_fullsize_level_change) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_ABOVE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM, level); @@ -1007,7 +1013,7 @@ TEST_F(etTestNotification, notification_fullsize_level_change) res = etRunner::get().setWinNotiLevel(tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti1, E_TC_EVENT_TYPE_STACK_ABOVE); level = etRunner::get().getWinNotiLevel(tw_noti1); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_HIGH, level); @@ -1056,7 +1062,7 @@ TEST_F(etTestNotification, notification_fullsize_level_change) res = etRunner::get().setWinNotiLevel(tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP); EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_noti2, E_TC_EVENT_TYPE_STACK_ABOVE); level = etRunner::get().getWinNotiLevel(tw_noti2); ASSERT_EQ(EFL_UTIL_NOTIFICATION_LEVEL_TOP, level); diff --git a/src/testcase/0006_tzsh.cpp b/src/testcase/0006_tzsh.cpp index 4539723..9bbdcc2 100644 --- a/src/testcase/0006_tzsh.cpp +++ b/src/testcase/0006_tzsh.cpp @@ -43,7 +43,7 @@ class etTestTzsh : public ::etTCBase void etTestTzsh::initTC() { - tw_base = initNormalWin("TCWin_Normal_base", EINA_FALSE, EINA_FALSE); + tw_base = initNormalWin("TCWin_Normal_base", EINA_FALSE); ASSERT_TRUE(tw_base != NULL) << "failed to initiation window"; } @@ -122,9 +122,8 @@ TEST_F(etTestTzsh, scrsaver_basic) tz_scrsaver = tzsh_screensaver_service_create(tzsh, tz_win); ASSERT_TRUE(tz_scrsaver != NULL); - tw_base->updateGeometry(); - tw_base->show(); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + showTCWin(tw_base); + etRunner::get().waitEvent(tw_base, E_TC_EVENT_TYPE_VIS_ON); list = etRunner::get().getWinInfoList(); ASSERT_TRUE(list != NULL); diff --git a/src/testcase/0007_rotation.cpp b/src/testcase/0007_rotation.cpp index 46a41b0..0c02a6b 100644 --- a/src/testcase/0007_rotation.cpp +++ b/src/testcase/0007_rotation.cpp @@ -20,7 +20,9 @@ class etTestRotation : public ::etTCBase void etTestRotation::initTC() { - tw_base = initNormalWin("TCWin_Normal_Rotation",EINA_TRUE, EINA_TRUE); + tw_base = initNormalWin("TCWin_Normal_Rotation", EINA_TRUE); + showTCWin(tw_base); + etRunner::get().waitEvent(tw_base, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(tw_base != NULL) << "failed to initiation window"; // available rotations @@ -39,7 +41,8 @@ etTestRotation::testWinRotation(etWin *tw, int rot) return EINA_FALSE; } - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_WINDOW_ROTATION_CHANGE); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_WINDOW_ROTATION_CHANGE); + if (!res) { ERR("Failed waiting rotation change event"); diff --git a/src/testcase/0008_focus.cpp b/src/testcase/0008_focus.cpp index 9832cad..4e3a799 100644 --- a/src/testcase/0008_focus.cpp +++ b/src/testcase/0008_focus.cpp @@ -19,16 +19,31 @@ class etTestFocus : public ::etTCBase void etTestFocus::initTC(Eina_Bool show_win, Eina_Bool usr_geom) { - tw_red = initNormalWin("TCWin_Normal_red", show_win, usr_geom); + tw_red = initNormalWin("TCWin_Normal_red", usr_geom); + if (show_win) + { + showTCWin(tw_red); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_red != NULL) << "failed to initiation window"; - tw_green = initNormalWin("TCWin_Normal_green", show_win, usr_geom); + tw_green = initNormalWin("TCWin_Normal_green", usr_geom); + if (show_win) + { + showTCWin(tw_green); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_green != NULL) << "failed to initiation window"; - tw_blue = initNormalWin("TCWin_Normal_blue", show_win, usr_geom); + tw_blue = initNormalWin("TCWin_Normal_blue", usr_geom); + if (show_win) + { + showTCWin(tw_blue); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_FOCUS_CHANGED); + } ASSERT_TRUE(tw_blue != NULL) << "failed to initiation window"; - tw_blocker = initNotiWin("TCWin_Noti_Blocker", EINA_FALSE, EINA_FALSE, EINA_FALSE); + tw_blocker = initNotiWin("TCWin_Noti_Blocker", EINA_FALSE, EINA_FALSE); ASSERT_TRUE(tw_blocker != NULL) << "failed to initiation window"; } @@ -66,8 +81,8 @@ TEST_F(etTestFocus, focus_lower) // make tw_blue lower res = etRunner::get().setWinStack(tw_blue, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Green[focused] -> Red -> ... -> Blue [Bottom] @@ -94,10 +109,8 @@ TEST_F(etTestFocus, focus_lower2) initTC(EINA_TRUE, EINA_TRUE); // make tw_green lower - res = registerTCWin(tw_green); - EXPECT_TRUE(res); res = etRunner::get().setWinStack(tw_green, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_LOWER); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); // Expected focus res: @@ -125,10 +138,8 @@ TEST_F(etTestFocus, focus_raise) initTC(EINA_TRUE, EINA_TRUE); // make tw_red raise - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinStack(tw_red, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); // Expected focus res: @@ -156,6 +167,7 @@ TEST_F(etTestFocus, focus_destroy) // delete tw_blue removeTCWin(tw_blue); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); tw_blue = NULL; // Expected focus res: @@ -183,11 +195,9 @@ TEST_F(etTestFocus, focus_activate1) initTC(EINA_TRUE, EINA_TRUE); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -215,13 +225,12 @@ TEST_F(etTestFocus, focus_activate2) // show Blocker showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red[focused] -> Blocker -> Blue -> Green [Bottom] @@ -248,17 +257,17 @@ TEST_F(etTestFocus, focus_activate3) initTC(EINA_TRUE, EINA_TRUE); // make partial notification window - etWin *tw_smallnoti = initNotiWin("TW_Temp_Noti", EINA_TRUE, EINA_TRUE, EINA_TRUE); + etWin *tw_smallnoti = initNotiWin("TW_Temp_Noti", EINA_TRUE, EINA_TRUE); + showTCWin(tw_smallnoti); + etRunner::get().waitEvent(tw_smallnoti, E_TC_EVENT_TYPE_VIS_ON); res = etRunner::get().setWinNotiLevel(tw_smallnoti, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); // Expected focus res: // [Top] smallnoti -> ... -> Red[focused] -> Blue -> Green [Bottom] @@ -284,14 +293,16 @@ TEST_F(etTestFocus, focus_show_activate) // init TC window, show=true, geom=true initTC(EINA_FALSE, EINA_TRUE); - etWin *tw_small_blocker = initNotiWin("TCWin_Noti_Small_Blocker", EINA_TRUE, EINA_TRUE, EINA_TRUE); + etWin *tw_small_blocker = initNotiWin("TCWin_Noti_Small_Blocker", EINA_TRUE, EINA_TRUE); + showTCWin(tw_small_blocker); etRunner::get().setWinNotiLevel(tw_small_blocker, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); + etRunner::get().waitEvent(tw_small_blocker, E_TC_EVENT_TYPE_VIS_ON); // Activate tw_red res = showActivateTCWin(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -322,13 +333,12 @@ TEST_F(etTestFocus, focus_obscured_activate) EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Blocker[focused] -> ... -> Red -> Blue -> Green [Bottom] @@ -359,19 +369,18 @@ TEST_F(etTestFocus, focus_obscured_activate_destroy) EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); // remove tw_blocker removeTCWin(tw_blocker); - res = registerTCWin(tw_red); - EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_OFF); + tw_blocker = NULL; + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -398,11 +407,9 @@ TEST_F(etTestFocus, focus_transient_for1) initTC(EINA_TRUE, EINA_TRUE); // set transient_for Blue(parent) & Red(child) - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinTransientFor(tw_red, tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_RAISE); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -429,11 +436,9 @@ TEST_F(etTestFocus, focus_transient_for2) initTC(EINA_TRUE, EINA_TRUE); // set transient_for Blue(parent) & Green(child) - res = registerTCWin(tw_green); - EXPECT_TRUE(res); res = etRunner::get().setWinTransientFor(tw_green, tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_RAISE); // Expected focus res: // [Top] Green[focused] -> Blue -> Red [Bottom] @@ -460,11 +465,9 @@ TEST_F(etTestFocus, focus_transient_for3) initTC(EINA_TRUE, EINA_TRUE); // set transient_for Green(parent) & Blue(child) - res = registerTCWin(tw_green); - EXPECT_TRUE(res); res = etRunner::get().setWinTransientFor(tw_blue, tw_green, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_RAISE); // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] @@ -491,11 +494,9 @@ TEST_F(etTestFocus, focus_iconify1) initTC(EINA_TRUE, EINA_TRUE); // set iconify Blue - res = registerTCWin(tw_blue); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); // Expected focus res: // [Top] Blue(iconified) -> Green[focused] -> Red [Bottom] @@ -522,11 +523,9 @@ TEST_F(etTestFocus, focus_iconify2) initTC(EINA_TRUE, EINA_TRUE); // set iconify Red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_red, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_OFF); // Expected focus res: // [Top] Blue[focused] -> Green -> Red(iconified) [Bottom] @@ -553,16 +552,15 @@ TEST_F(etTestFocus, focus_uniconify) initTC(EINA_TRUE, EINA_TRUE); // set iconify Red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_red, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_OFF); // set uniconify Red res = etRunner::get().setWinIconic(tw_red, EINA_FALSE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().work(2.0); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -589,16 +587,15 @@ TEST_F(etTestFocus, focus_uniconify2) initTC(EINA_TRUE, EINA_TRUE); // set iconify Blue - res = registerTCWin(tw_blue); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); // set uniconify Blue res = etRunner::get().setWinIconic(tw_blue, EINA_FALSE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().work(2.0); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] @@ -629,11 +626,12 @@ TEST_F(etTestFocus, focus_visibility) EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); // hide blocker removeTCWin(tw_blocker); - res = registerTCWin(tw_blue); - EXPECT_TRUE(res); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_OFF); + tw_blocker = NULL; // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] @@ -660,7 +658,7 @@ TEST_F(etTestFocus, focus_move) // move tw_blue to out of screen tw_blue->move(2000, 2000); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_CHANGED); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_CHANGED); // Expected focus res: // [Top] Blue -> Green[focused] -> Red [Bottom] @@ -687,11 +685,11 @@ TEST_F(etTestFocus, DISABLED_focus_move2) // move tw_blue to out of screen tw_blue->move(2000, 2000); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); // move tw_blue into screen tw_blue->move(200, 200); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Blue -> Green[focused] -> Red [Bottom] @@ -711,18 +709,15 @@ TEST_F(etTestFocus, DISABLED_focus_move2) TEST_F(etTestFocus, focus_touch_basic) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true initTC(EINA_TRUE, EINA_TRUE); // touch red win - res = registerTCWin(tw_red); - EXPECT_TRUE(res); etRunner::get().generateMouseDown(50, 50); etRunner::get().generateMouseUp(50, 50); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Blue -> Green -> Red[focused] [Bottom] @@ -742,25 +737,20 @@ TEST_F(etTestFocus, focus_touch_basic) TEST_F(etTestFocus, focus_touch_history) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true initTC(EINA_TRUE, EINA_TRUE); // touch red win - res = registerTCWin(tw_red); - EXPECT_TRUE(res); etRunner::get().generateMouseDown(50, 50); etRunner::get().generateMouseUp(50, 50); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // touch blue win - res = registerTCWin(tw_blue); - EXPECT_TRUE(res); etRunner::get().generateMouseDown(250, 250); etRunner::get().generateMouseUp(250, 250); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] @@ -778,6 +768,10 @@ TEST_F(etTestFocus, focus_touch_history) // remove blue win removeTCWin(tw_blue); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); + tw_blue = NULL; + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); + // Expected focus res: // [Top] Green -> Red[focused] [Bottom] @@ -795,6 +789,9 @@ TEST_F(etTestFocus, focus_touch_history) // remove red win removeTCWin(tw_red); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_OFF); + tw_red = NULL; + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Green[focused] [Bottom] @@ -814,18 +811,15 @@ TEST_F(etTestFocus, focus_touch_history) TEST_F(etTestFocus, DISABLED_focus_touch_history2) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true initTC(EINA_TRUE, EINA_TRUE); // touch green win - res = registerTCWin(tw_green); - EXPECT_TRUE(res); etRunner::get().generateMouseDown(150, 150); etRunner::get().generateMouseUp(150, 150); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red -> Green[focused] -> Blue [Bottom] @@ -842,10 +836,8 @@ TEST_F(etTestFocus, DISABLED_focus_touch_history2) etRunner::get().freeWinInfoList(list); // activate red win - res = registerTCWin(tw_red); - EXPECT_TRUE(res); etRunner::get().setWinActivate(tw_red); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_ABOVE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -863,7 +855,7 @@ TEST_F(etTestFocus, DISABLED_focus_touch_history2) // lower red win etRunner::get().setWinStack(tw_red, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Blue -> Green[focused] -> ... -> Red [Bottom] @@ -890,7 +882,7 @@ TEST_F(etTestFocus, focus_skip_set) // set focus_skip on tw_blue etRunner::get().setFocusSkip(tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Blue -> Green[focused] -> Red [Bottom] @@ -919,7 +911,7 @@ TEST_F(etTestFocus, focus_skip_unset) // set focus_skip on tw_blue etRunner::get().setFocusSkip(tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Blue -> Green[focused] -> Red [Bottom] @@ -935,7 +927,7 @@ TEST_F(etTestFocus, focus_skip_unset) // unset focus_skip on tw_blue etRunner::get().setFocusSkip(tw_blue, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip // Expected focus res: // [Top] Blue -> Green[focused] -> Red [Bottom] @@ -955,22 +947,19 @@ TEST_F(etTestFocus, focus_skip_unset) TEST_F(etTestFocus, focus_touch_with_focus_skip) { etWin *tw = NULL; - Eina_Bool res = EINA_FALSE; Eina_List *list = NULL, *l = NULL; // init TC window, show=true, geom=true initTC(EINA_TRUE, EINA_TRUE); // set focus_skip on tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); etRunner::get().setFocusSkip(tw_red, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip // touch red win etRunner::get().generateMouseDown(50, 50); etRunner::get().generateMouseUp(50, 50); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] @@ -1021,7 +1010,7 @@ TEST_F(etTestFocus, focus_fullsize_lower) // make tw_blue lower res = etRunner::get().setWinStack(tw_blue, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); // Expected focus res: @@ -1049,10 +1038,8 @@ TEST_F(etTestFocus, focus_fullsize_lower2) initTC(EINA_TRUE, EINA_FALSE); // make tw_green lower - res = registerTCWin(tw_green); - EXPECT_TRUE(res); res = etRunner::get().setWinStack(tw_green, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_LOWER); + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_STACK_LOWER); ASSERT_TRUE(res); // Expected focus res: @@ -1081,7 +1068,7 @@ TEST_F(etTestFocus, focus_fullsize_raise) // make tw_red raise res = etRunner::get().setWinStack(tw_red, NULL, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); // Expected focus res: @@ -1109,7 +1096,9 @@ TEST_F(etTestFocus, focus_fullsize_destroy) // delete tw_blue removeTCWin(tw_blue); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); tw_blue = NULL; + etRunner::get().waitEvent(tw_green, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Green[focused] -> Red [Bottom] @@ -1136,11 +1125,9 @@ TEST_F(etTestFocus, focus_fullsize_activate) initTC(EINA_TRUE, EINA_FALSE); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -1171,13 +1158,12 @@ TEST_F(etTestFocus, focus_fullsize_obscured_activate) EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // Expected focus res: // [Top] Blocker[focused] -> ... -> Red -> Blue -> Green [Bottom] @@ -1208,19 +1194,18 @@ TEST_F(etTestFocus, focus_fullsize_obscured_activate_destroy) EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); EXPECT_TRUE(res); showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); // Activate tw_red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinActivate(tw_red); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); // remove tw_blocker removeTCWin(tw_blocker); - res = registerTCWin(tw_red); - EXPECT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_OFF); + tw_blocker = NULL; + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -1247,11 +1232,9 @@ TEST_F(etTestFocus, focus_fullsize_transient_for) initTC(EINA_TRUE, EINA_FALSE); // set transient_for Blue(parent) & Red(child) - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinTransientFor(tw_red, tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_RAISE); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -1278,11 +1261,9 @@ TEST_F(etTestFocus, focus_fullsize_iconify) initTC(EINA_TRUE, EINA_FALSE); // set iconify Blue - res = registerTCWin(tw_blue); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_blue, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_VIS_OFF); // Expected focus res: // [Top] Blue(iconified) -> Green[focused] -> Red [Bottom] @@ -1309,16 +1290,14 @@ TEST_F(etTestFocus, focus_fullsize_uniconify) initTC(EINA_TRUE, EINA_FALSE); // set iconify Red - res = registerTCWin(tw_red); - EXPECT_TRUE(res); res = etRunner::get().setWinIconic(tw_red, EINA_TRUE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_VIS_OFF); // set uniconify Red res = etRunner::get().setWinIconic(tw_red, EINA_FALSE); ASSERT_TRUE(res); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Red[focused] -> Blue -> Green [Bottom] @@ -1345,7 +1324,7 @@ TEST_F(etTestFocus, focus_fullsize_skip_set) // set focus_skip on tw_blue etRunner::get().setFocusSkip(tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip set // Expected focus res: // [Top] Blue -> Green -> Red [Bottom] @@ -1371,11 +1350,12 @@ TEST_F(etTestFocus, focus_fullsize_skip_unset) // Expected focus res: // [Top] Blue -> Green -> Red [Bottom] etRunner::get().setFocusSkip(tw_blue, EINA_TRUE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip set // unset focus_skip on tw_blue etRunner::get().setFocusSkip(tw_blue, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().work(0.1); // waiting for adjust focus skip set + etRunner::get().waitEvent(tw_blue, E_TC_EVENT_TYPE_FOCUS_CHANGED); // Expected focus res: // [Top] Blue[focused] -> Green -> Red [Bottom] diff --git a/src/testcase/0009_input.cpp b/src/testcase/0009_input.cpp index 15929d6..ce802ca 100644 --- a/src/testcase/0009_input.cpp +++ b/src/testcase/0009_input.cpp @@ -5,8 +5,17 @@ class etTestInput : public ::etTCBase { public: - etTestInput() { }; - ~etTestInput() { }; + etTestInput() + { + key_name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + }; + ~etTestInput() + { + eina_stringshare_del(key_name); + eina_stringshare_del(etRunner::get().ev.key.name); + key_name = NULL; + }; protected: etWin *tw_shared = NULL; @@ -14,6 +23,8 @@ protected: etWin *tw_orexcl = NULL; etWin *tw_excl = NULL; etWin *tw_gesture = NULL; + + Eina_Stringshare *key_name = NULL; }; TEST_F(etTestInput, keygrab_nowin_shared) @@ -22,13 +33,10 @@ TEST_F(etTestInput, keygrab_nowin_shared) ret = ecore_wl2_window_keygrab_set(NULL, "XF86Menu", 0, 0, 0, ECORE_WL2_WINDOW_KEYGRAB_SHARED); ASSERT_TRUE(ret); - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_ECORE_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_INPUT_ECORE_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - ret = ecore_wl2_window_keygrab_unset(NULL, "XF86Menu", 0, 0); ASSERT_TRUE(ret); } @@ -39,13 +47,10 @@ TEST_F(etTestInput, keygrab_nowin_orexcl) ret = ecore_wl2_window_keygrab_set(NULL, "XF86Menu", 0, 0, 0, ECORE_WL2_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE); ASSERT_TRUE(ret); - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_ECORE_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_INPUT_ECORE_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - ret = ecore_wl2_window_keygrab_unset(NULL, "XF86Menu", 0, 0); ASSERT_TRUE(ret); } @@ -56,13 +61,10 @@ TEST_F(etTestInput, keygrab_nowin_excl) ret = ecore_wl2_window_keygrab_set(NULL, "XF86Menu", 0, 0, 0, ECORE_WL2_WINDOW_KEYGRAB_EXCLUSIVE); ASSERT_TRUE(ret); - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_ECORE_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_INPUT_ECORE_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - ret = ecore_wl2_window_keygrab_unset(NULL, "XF86Menu", 0, 0); ASSERT_TRUE(ret); } @@ -71,26 +73,29 @@ TEST_F(etTestInput, keygrab_win_shared) { Eina_Bool ret = EINA_FALSE; - tw_shared = initNormalWin("TCWin_SharedGrab", EINA_TRUE, EINA_FALSE); + tw_shared = initNormalWin("TCWin_SharedGrab", EINA_FALSE); ASSERT_TRUE(tw_shared != NULL) << "failed to initiation window"; + showTCWin(tw_shared); + etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_VIS_ON); + ret = elm_win_keygrab_set(tw_shared->elm_win, "XF86Menu", 0, 0, 0, ELM_WIN_KEYGRAB_SHARED); ASSERT_TRUE(ret); ret = evas_object_key_grab(tw_shared->elm_win, "XF86Menu", 0, 0, EINA_FALSE); ASSERT_TRUE(ret); - etRunner::get().ev.win = tw_shared->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_shared->elm_win; + etRunner::get().ev.native_win = tw_shared->native_win; ret = etRunner::get().setWinStack(tw_shared, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - etRunner::get().ev.win = NULL; + etRunner::get().ev.elm_win = NULL; + etRunner::get().ev.native_win = 0; evas_object_key_ungrab(tw_shared->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_shared->elm_win, "XF86Menu", 0, 0); @@ -101,26 +106,29 @@ TEST_F(etTestInput, keygrab_win_orexcl) { Eina_Bool ret = EINA_FALSE; - tw_orexcl = initNormalWin("TCWin_OrexclGrab", EINA_TRUE, EINA_FALSE); + tw_orexcl = initNormalWin("TCWin_OrexclGrab", EINA_FALSE); ASSERT_TRUE(tw_orexcl != NULL) << "failed to initiation window"; + showTCWin(tw_orexcl); + etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_VIS_ON); + ret = elm_win_keygrab_set(tw_orexcl->elm_win, "XF86Menu", 0, 0, 0, ELM_WIN_KEYGRAB_OVERRIDE_EXCLUSIVE); ASSERT_TRUE(ret); ret = evas_object_key_grab(tw_orexcl->elm_win, "XF86Menu", 0, 0, EINA_TRUE); ASSERT_TRUE(ret); - etRunner::get().ev.win = tw_orexcl->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_orexcl->elm_win; + etRunner::get().ev.native_win = tw_orexcl->native_win; ret = etRunner::get().setWinStack(tw_orexcl, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - etRunner::get().ev.win = NULL; + etRunner::get().ev.elm_win = NULL; + etRunner::get().ev.native_win = 0; evas_object_key_ungrab(tw_orexcl->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_orexcl->elm_win, "XF86Menu", 0, 0); @@ -131,26 +139,29 @@ TEST_F(etTestInput, keygrab_win_excl) { Eina_Bool ret = EINA_FALSE; - tw_excl = initNormalWin("TCWin_ExclGrab", EINA_TRUE, EINA_FALSE); + tw_excl = initNormalWin("TCWin_ExclGrab", EINA_FALSE); ASSERT_TRUE(tw_excl != NULL) << "failed to initiation window"; + showTCWin(tw_excl); + etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_VIS_ON); + ret = elm_win_keygrab_set(tw_excl->elm_win, "XF86Menu", 0, 0, 0, ELM_WIN_KEYGRAB_EXCLUSIVE); ASSERT_TRUE(ret); ret = evas_object_key_grab(tw_excl->elm_win, "XF86Menu", 0, 0, EINA_TRUE); ASSERT_TRUE(ret); - etRunner::get().ev.win = tw_excl->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_excl->elm_win; + etRunner::get().ev.native_win = tw_excl->native_win; ret = etRunner::get().setWinStack(tw_excl, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - etRunner::get().ev.win = NULL; + etRunner::get().ev.elm_win = NULL; + etRunner::get().ev.native_win = 0; evas_object_key_ungrab(tw_excl->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_excl->elm_win, "XF86Menu", 0, 0); @@ -161,9 +172,12 @@ TEST_F(etTestInput, keygrab_win_topposition) { Eina_Bool ret = EINA_FALSE; - tw_topposition = initNormalWin("TCWin_ToppositionGrab", EINA_TRUE, EINA_TRUE); + tw_topposition = initNormalWin("TCWin_ToppositionGrab", EINA_TRUE); ASSERT_TRUE(tw_topposition != NULL) << "failed to initiation window"; + showTCWin(tw_topposition); + etRunner::get().waitEvent(tw_topposition, E_TC_EVENT_TYPE_VIS_ON); + ecore_evas_focus_skip_set(ecore_evas_ecore_evas_get(evas_object_evas_get(tw_topposition->elm_win)), EINA_TRUE); ret = elm_win_keygrab_set(tw_topposition->elm_win, "XF86Menu", 0, 0, 0, ELM_WIN_KEYGRAB_TOPMOST); @@ -171,15 +185,15 @@ TEST_F(etTestInput, keygrab_win_topposition) ret = evas_object_key_grab(tw_topposition->elm_win, "XF86Menu", 0, 0, EINA_FALSE); ASSERT_TRUE(ret); - etRunner::get().ev.win = tw_topposition->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_topposition->elm_win; + etRunner::get().ev.native_win = tw_topposition->native_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_topposition, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - etRunner::get().ev.key.name = NULL; - etRunner::get().ev.win = NULL; + etRunner::get().ev.elm_win = NULL; + etRunner::get().ev.native_win = 0; evas_object_key_ungrab(tw_topposition->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_topposition->elm_win, "XF86Menu", 0, 0); @@ -190,18 +204,30 @@ TEST_F(etTestInput, keygrab_win) { Eina_Bool ret = EINA_FALSE; - tw_shared = initNormalWin("TCWin_SharedGrab", EINA_TRUE, EINA_FALSE); + tw_shared = initNormalWin("TCWin_SharedGrab", EINA_FALSE); ASSERT_TRUE(tw_shared != NULL) << "failed to initiation window"; - tw_orexcl = initNormalWin("TCWin_OrexclGrab", EINA_TRUE, EINA_FALSE); + showTCWin(tw_shared); + etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_VIS_ON); + + tw_orexcl = initNormalWin("TCWin_OrexclGrab", EINA_FALSE); ASSERT_TRUE(tw_orexcl != NULL) << "failed to initiation window"; - tw_excl = initNormalWin("TCWin_ExclGrab", EINA_TRUE, EINA_FALSE); + showTCWin(tw_orexcl); + etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_VIS_ON); + + tw_excl = initNormalWin("TCWin_ExclGrab", EINA_FALSE); ASSERT_TRUE(tw_excl != NULL) << "failed to initiation window"; - tw_topposition = initNormalWin("TCWin_ToppositionGrab", EINA_TRUE, EINA_TRUE); + showTCWin(tw_excl); + etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_VIS_ON); + + tw_topposition = initNormalWin("TCWin_ToppositionGrab", EINA_TRUE); ASSERT_TRUE(tw_topposition != NULL) << "failed to initiation window"; + showTCWin(tw_topposition); + etRunner::get().waitEvent(tw_topposition, E_TC_EVENT_TYPE_VIS_ON); + ecore_evas_focus_skip_set(ecore_evas_ecore_evas_get(evas_object_evas_get(tw_topposition->elm_win)), EINA_TRUE); ret = elm_win_keygrab_set(tw_excl->elm_win, "XF86Menu", 0, 0, 0, ELM_WIN_KEYGRAB_EXCLUSIVE); @@ -225,82 +251,75 @@ TEST_F(etTestInput, keygrab_win) ASSERT_TRUE(ret); ret = etRunner::get().setWinStack(tw_excl, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); ret = etRunner::get().setWinStack(tw_orexcl, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); ret = etRunner::get().setWinStack(tw_shared, NULL, EINA_FALSE); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED); + etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_FOCUS_CHANGED); ASSERT_TRUE(ret); // test exclusive grab - etRunner::get().ev.win = tw_excl->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_excl->elm_win; + etRunner::get().ev.native_win = tw_excl->native_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_excl, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - evas_object_key_ungrab(tw_excl->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_excl->elm_win, "XF86Menu", 0, 0); ASSERT_TRUE(ret); // test override exclusive grab - etRunner::get().ev.win = tw_orexcl->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_orexcl->elm_win; + etRunner::get().ev.native_win = tw_orexcl->native_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_orexcl, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - evas_object_key_ungrab(tw_orexcl->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_orexcl->elm_win, "XF86Menu", 0, 0); ASSERT_TRUE(ret); // test top position grab - etRunner::get().ev.win = tw_topposition->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_topposition->elm_win; + etRunner::get().ev.native_win = tw_topposition->native_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_topposition, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - evas_object_key_ungrab(tw_topposition->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_topposition->elm_win, "XF86Menu", 0, 0); ASSERT_TRUE(ret); // test shared grab - etRunner::get().ev.win = tw_shared->elm_win; - etRunner::get().ev.key.name = eina_stringshare_add("XF86Menu"); + etRunner::get().ev.elm_win = tw_shared->elm_win; + etRunner::get().ev.native_win = tw_shared->native_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_INPUT_EVAS_KEY); + etRunner::get().generateKeyEvent(key_name, 0.3); + ret = etRunner::get().waitEvent(tw_shared, E_TC_EVENT_TYPE_INPUT_EVAS_KEY); ASSERT_TRUE(ret); - eina_stringshare_del(etRunner::get().ev.key.name); - evas_object_key_ungrab(tw_shared->elm_win, "XF86Menu", 0, 0); ret = elm_win_keygrab_unset(tw_shared->elm_win, "XF86Menu", 0, 0); ASSERT_TRUE(ret); etRunner::get().ev.key.name = NULL; - etRunner::get().ev.win = NULL; + etRunner::get().ev.elm_win = NULL; } TEST_F(etTestInput, gesture_tap22) { int ret = EFL_UTIL_ERROR_NONE; - efl_util_gesture_h gesture_h; + efl_util_gesture_h gesture_h = etRunner::get().getGestureHandler(); efl_util_gesture_data tap_d; - gesture_h = efl_util_gesture_initialize(); - ASSERT_TRUE(gesture_h != NULL) << "failed to initiation gesture system"; - tap_d = efl_util_gesture_tap_new(gesture_h, 2, 2); ASSERT_TRUE(tap_d != NULL) << "failed to generate tap grab data"; @@ -311,7 +330,8 @@ TEST_F(etTestInput, gesture_tap22) etRunner::get().ev.gesture.tap.fingers = 2; etRunner::get().ev.gesture.tap.repeats = 2; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_TAP); + etRunner::get().generateTapGesture(); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_GESTURE_TAP); ASSERT_TRUE(ret); etRunner::get().ev.gesture.tap.fingers = 0; @@ -320,21 +340,14 @@ TEST_F(etTestInput, gesture_tap22) ret = efl_util_gesture_ungrab(gesture_h, tap_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to ungrab tap gesture: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; - - efl_util_gesture_tap_free(gesture_h, tap_d); - ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " - << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; } TEST_F(etTestInput, gesture_tap23) { int ret = EFL_UTIL_ERROR_NONE; - efl_util_gesture_h gesture_h; + efl_util_gesture_h gesture_h = etRunner::get().getGestureHandler(); efl_util_gesture_data tap_d; - gesture_h = efl_util_gesture_initialize(); - ASSERT_TRUE(gesture_h != NULL) << "failed to initiation gesture system"; - tap_d = efl_util_gesture_tap_new(gesture_h, 2, 3); ASSERT_TRUE(tap_d != NULL) << "failed to generate tap grab data"; @@ -345,12 +358,12 @@ TEST_F(etTestInput, gesture_tap23) etRunner::get().ev.gesture.tap.fingers = 2; etRunner::get().ev.gesture.tap.repeats = 3; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_TAP); + etRunner::get().generateTapGesture(); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_GESTURE_TAP); ASSERT_TRUE(ret); etRunner::get().ev.gesture.tap.fingers = 0; etRunner::get().ev.gesture.tap.repeats = 0; - ret = efl_util_gesture_ungrab(gesture_h, tap_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to ungrab tap gesture: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; @@ -364,12 +377,9 @@ static void _test_gesture_edge_swipe(int fingers, efl_util_gesture_edge_e edge) { int ret = EFL_UTIL_ERROR_NONE; - efl_util_gesture_h gesture_h; + efl_util_gesture_h gesture_h = etRunner::get().getGestureHandler(); efl_util_gesture_data edge_swipe_d; - gesture_h = efl_util_gesture_initialize(); - ASSERT_TRUE(gesture_h != NULL) << "failed to initialize gesture system"; - edge_swipe_d = efl_util_gesture_edge_swipe_new(gesture_h, fingers, edge); ASSERT_TRUE(edge_swipe_d != NULL) << "failed to generate edge swipe grab data"; @@ -380,7 +390,8 @@ _test_gesture_edge_swipe(int fingers, efl_util_gesture_edge_e edge) etRunner::get().ev.gesture.edge.fingers = fingers; etRunner::get().ev.gesture.edge.edge = edge; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE); + etRunner::get().generateEdgeSwipeGesture(); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_GESTURE_EDGE_SWIPE); ASSERT_TRUE(ret); etRunner::get().ev.gesture.edge.fingers = 0; @@ -393,10 +404,6 @@ _test_gesture_edge_swipe(int fingers, efl_util_gesture_edge_e edge) ret = efl_util_gesture_edge_swipe_free(gesture_h, edge_swipe_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; - - ret = efl_util_gesture_deinitialize(gesture_h); - ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to deinitialize gesture system: (ret: " - << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; } TEST_F(etTestInput, gesture_edge_swipe11) @@ -443,12 +450,9 @@ static void _test_gesture_edge_drag(int fingers, efl_util_gesture_edge_e edge) { int ret = EFL_UTIL_ERROR_NONE; - efl_util_gesture_h gesture_h; + efl_util_gesture_h gesture_h = etRunner::get().getGestureHandler(); efl_util_gesture_data edge_drag_d; - gesture_h = efl_util_gesture_initialize(); - ASSERT_TRUE(gesture_h != NULL) << "failed to initialize gesture system"; - edge_drag_d = efl_util_gesture_edge_drag_new(gesture_h, fingers, edge); ASSERT_TRUE(edge_drag_d != NULL) << "failed to generate edge drag grab data"; @@ -459,7 +463,8 @@ _test_gesture_edge_drag(int fingers, efl_util_gesture_edge_e edge) etRunner::get().ev.gesture.edge.fingers = fingers; etRunner::get().ev.gesture.edge.edge = edge; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG); + etRunner::get().generateEdgeDragGesture(); + ret = etRunner::get().waitEvent(NULL, E_TC_EVENT_TYPE_GESTURE_EDGE_DRAG); ASSERT_TRUE(ret); etRunner::get().ev.gesture.edge.fingers = 0; @@ -472,10 +477,6 @@ _test_gesture_edge_drag(int fingers, efl_util_gesture_edge_e edge) ret = efl_util_gesture_edge_drag_free(gesture_h, edge_drag_d); ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to free tap grab data: (ret: " << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; - - ret = efl_util_gesture_deinitialize(gesture_h); - ASSERT_TRUE(ret == EFL_UTIL_ERROR_NONE) << "failed to deinitialize gesture system: (ret: " - << EFL_UTIL_RETURN_TO_STRING(ret) << ")"; } TEST_F(etTestInput, gesture_edge_drag11) @@ -516,4 +517,4 @@ TEST_F(etTestInput, gesture_edge_drag23) TEST_F(etTestInput, gesture_edge_drag24) { _test_gesture_edge_drag(2, EFL_UTIL_GESTURE_EDGE_LEFT); -} \ No newline at end of file +} diff --git a/src/testcase/0010_splash.cpp b/src/testcase/0010_splash.cpp index 860af5c..9e31602 100644 --- a/src/testcase/0010_splash.cpp +++ b/src/testcase/0010_splash.cpp @@ -24,7 +24,7 @@ etTestSplash::initTC(char * path, int type) { Eina_Bool ret = EINA_FALSE; - tw = initNormalWin("TCWin_Splash", EINA_FALSE, EINA_FALSE); + tw = initNormalWin("TCWin_Splash", EINA_FALSE); ASSERT_TRUE(tw != NULL) << "failed to initiation window"; ret = etRunner::get().setSplashLaunch(path, type); @@ -38,6 +38,7 @@ TEST_F(etTestSplash, splash_edc) Eina_List *list = NULL, *l = NULL; initTC((char*)path_edc, SPLASH_TYPE_EDC); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); // find Launchscreen from toplv windows list = etRunner::get().getWinInfoList(); @@ -61,6 +62,7 @@ TEST_F(etTestSplash, splash_img) Eina_List *list = NULL, *l = NULL; initTC((char*)path_img, SPLASH_TYPE_IMG); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); // find Launchscreen from toplv windows list = etRunner::get().getWinInfoList(); @@ -85,9 +87,8 @@ TEST_F(etTestSplash, splash_disappear_after_real) initTC((char*)path_img, SPLASH_TYPE_IMG); etRunner::get().setSplashOwner(); - tw->updateGeometry(); - tw->show(); - etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); // Expected focus res: list = etRunner::get().getWinInfoList(); @@ -112,11 +113,8 @@ TEST_F(etTestSplash, splash_evas_callback_after_real) initTC((char*)path_img, SPLASH_TYPE_IMG); etRunner::get().setSplashOwner(); - tw->updateGeometry(); - tw->show(); - - etRunner::get().ev.win = tw->elm_win; - ret = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT_EVAS_CB); + showTCWin(tw); + ret = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT_EVAS_CB); ASSERT_TRUE(ret); // Expected focus res: diff --git a/src/testcase/0011_effect.cpp b/src/testcase/0011_effect.cpp index 4d9602c..fd7b62e 100644 --- a/src/testcase/0011_effect.cpp +++ b/src/testcase/0011_effect.cpp @@ -11,24 +11,31 @@ class etTestEffect : public ::etTCBase etWin *tw = NULL; etWin *tw_green = NULL; + void initTC(); }; +void +etTestEffect::initTC() +{ + tw = initNormalWin("TCWin_Effect_Show1", EINA_FALSE); + ASSERT_TRUE(tw != NULL) << "failed to initiation window"; + + tw_green = initNormalWin("TCWin_Effect_GREEN", EINA_FALSE); + ASSERT_TRUE(tw_green != NULL) << "failed to initiation window"; +} + TEST_F(etTestEffect, effect_show) { Eina_Bool res = EINA_FALSE; - tw = initNormalWin("TCWin_Effect_Show1", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw != NULL) << "failed to initiation window"; - res = registerTCWin(tw); - ASSERT_TRUE(res); + initTC(); res = etRunner::get().setWinEffect(tw); ASSERT_TRUE(res); - tw->updateGeometry(); - tw->show(); + showTCWin(tw); - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT); ASSERT_TRUE(res); return; @@ -37,19 +44,15 @@ TEST_F(etTestEffect, effect_show) TEST_F(etTestEffect, effect_show_evas_callback) { Eina_Bool res = EINA_FALSE; - tw = initNormalWin("TCWin_Effect_Show2", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw != NULL) << "failed to initiation window"; - res = registerTCWin(tw); - ASSERT_TRUE(res); + initTC(); res = etRunner::get().setWinEffect(tw); ASSERT_TRUE(res); - tw->updateGeometry(); - tw->show(); + showTCWin(tw); - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT_EVAS_CB); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT_EVAS_CB); ASSERT_TRUE(res); return; @@ -58,23 +61,16 @@ TEST_F(etTestEffect, effect_show_evas_callback) TEST_F(etTestEffect, effect_hide_bylower) { Eina_Bool res = EINA_FALSE; - tw = initNormalWin("TCWin_Effect_Hide_Lower", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw != NULL) << "failed to initiation window"; - res = registerTCWin(tw); - ASSERT_TRUE(res); + initTC(); - tw->updateGeometry(); - tw->show(); - etRunner::get().work(1.1); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); res = etRunner::get().setWinEffect(tw); ASSERT_TRUE(res); - etRunner::get().work(1.1); - elm_win_lower(tw->elm_win); - - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT); ASSERT_TRUE(res); return; @@ -83,23 +79,16 @@ TEST_F(etTestEffect, effect_hide_bylower) TEST_F(etTestEffect, effect_hide_byunmap) { Eina_Bool res = EINA_FALSE; - tw = initNormalWin("TCWin_Effect_Hide_Unmap", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw != NULL) << "failed to initiation window"; - res = registerTCWin(tw); - ASSERT_TRUE(res); + initTC(); - tw->updateGeometry(); - tw->show(); - etRunner::get().work(1.1); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); res = etRunner::get().setWinEffect(tw); ASSERT_TRUE(res); - etRunner::get().work(1.1); - tw->hide(); - - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT); ASSERT_TRUE(res); return; @@ -108,26 +97,17 @@ TEST_F(etTestEffect, effect_hide_byunmap) TEST_F(etTestEffect, effect_bg) { Eina_Bool res = EINA_FALSE; - tw = initNormalWin("TCWin_Effect_Effect_BG", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw != NULL) << "failed to initiation window"; - - tw_green = initNormalWin("TCWin_Effect_GREEN", EINA_FALSE, EINA_FALSE); - ASSERT_TRUE(tw_green != NULL) << "failed to initiation window"; - res = registerTCWin(tw); - ASSERT_TRUE(res); + initTC(); - tw->updateGeometry(); - tw->show(); - etRunner::get().work(1.1); + showTCWin(tw); + etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); res = etRunner::get().setWinEffect(tw); ASSERT_TRUE(res); - - tw_green->updateGeometry(); - tw_green->show(); - - res = etRunner::get().waitEvent(E_TC_EVENT_TYPE_EFFECT); + //show upper window + showTCWin(tw_green); + res = etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_EFFECT); ASSERT_TRUE(res); return; -- 2.7.4 From 2a1dc39532d01069a9eb90bd04d257157c2a2567 Mon Sep 17 00:00:00 2001 From: jeon Date: Thu, 27 Jun 2019 16:27:25 +0900 Subject: [PATCH 07/16] e_test_event: change input generator initialize function to synchronized function Change-Id: I2c7f59e8222783dc88636c63350d114313f4e3fb --- src/e_test_event.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 69ba1f2..5212047 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -160,7 +160,7 @@ etRunner::init() EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); // init input generator - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(inputGenerator, EINA_FALSE); // init gesture handler @@ -724,7 +724,7 @@ etRunner::generateMouseDown(int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } @@ -750,7 +750,7 @@ etRunner::generateMouseMove(int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } @@ -776,7 +776,7 @@ etRunner::generateMouseUp(int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } @@ -802,7 +802,7 @@ etRunner::generateKeyPress(const char *keyname) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, NULL); work(); } @@ -827,7 +827,7 @@ etRunner::generateKeyRelease(const char *keyname) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, NULL); work(); } @@ -866,7 +866,7 @@ etRunner::generateTouchDown(int idx, int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } @@ -892,7 +892,7 @@ etRunner::generateTouchMove(int idx, int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } @@ -918,7 +918,7 @@ etRunner::generateTouchUp(int idx, int x, int y) if (inputGenerator == NULL) { - inputGenerator = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN); + inputGenerator = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL); work(); } -- 2.7.4 From fc7df96a3d31b06601b9c391bd21a9a803f3f060 Mon Sep 17 00:00:00 2001 From: Juyeon Lee Date: Mon, 1 Jul 2019 14:07:44 +0900 Subject: [PATCH 08/16] 0010_splash: fix tc due to E20 changes launch splash screen were shown at launch request, but the effect had showed twice after owner set request. due to duplicate effect e20 core has changed to launch splash screen after all requests(launch, owner) made. so, TC is also need to be changed Change-Id: I2384e41f262acd45feb012bf4bc4075703acea4c --- src/testcase/0010_splash.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/testcase/0010_splash.cpp b/src/testcase/0010_splash.cpp index 9e31602..fadd24d 100644 --- a/src/testcase/0010_splash.cpp +++ b/src/testcase/0010_splash.cpp @@ -28,6 +28,7 @@ etTestSplash::initTC(char * path, int type) ASSERT_TRUE(tw != NULL) << "failed to initiation window"; ret = etRunner::get().setSplashLaunch(path, type); + etRunner::get().setSplashOwner(); ASSERT_TRUE(ret); } @@ -47,7 +48,7 @@ TEST_F(etTestSplash, splash_edc) EINA_LIST_CAST_FOREACH(list, l, tw2, etWin*) { // todo: check cw->obj is EDJ type, and group name is effect - if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name))) + if (!strncmp(tw2->name, "launchscreen", strlen(tw2->name))) res = EINA_TRUE; } etRunner::get().freeWinInfoList(list); @@ -71,7 +72,7 @@ TEST_F(etTestSplash, splash_img) EINA_LIST_CAST_FOREACH(list, l, tw2, etWin*) { // todo: check cw->obj is IMG type, and img file - if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name))) + if (!strncmp(tw2->name, "launchscreen", strlen(tw2->name))) res = EINA_TRUE; } etRunner::get().freeWinInfoList(list); @@ -85,7 +86,6 @@ TEST_F(etTestSplash, splash_disappear_after_real) Eina_List *list = NULL, *l = NULL; initTC((char*)path_img, SPLASH_TYPE_IMG); - etRunner::get().setSplashOwner(); showTCWin(tw); etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON); @@ -98,7 +98,7 @@ TEST_F(etTestSplash, splash_disappear_after_real) { if (tw->native_win == tw2->native_win) ASSERT_TRUE(tw2->Focus.obj); - if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name))) + if (!strncmp(tw2->name, "launchscreen", strlen(tw2->name))) ASSERT_NE(tw->native_win, tw2->native_win); } etRunner::get().freeWinInfoList(list); @@ -125,7 +125,7 @@ TEST_F(etTestSplash, splash_evas_callback_after_real) { if (tw->native_win == tw2->native_win) ASSERT_TRUE(tw2->Focus.obj); - if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name))) + if (!strncmp(tw2->name, "launchscreen", strlen(tw2->name))) ASSERT_NE(tw->native_win, tw2->native_win); } etRunner::get().freeWinInfoList(list); -- 2.7.4 From 0ceaacb205ba22d82ab4f7002a1516330b1d7ad3 Mon Sep 17 00:00:00 2001 From: Juyeon Lee Date: Tue, 2 Jul 2019 13:55:05 +0900 Subject: [PATCH 09/16] e_test_event: remove unnecessary code Change-Id: I5a251325aeb9094eafc970495abd20522f852d53 --- src/e_test_event.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 5212047..75aaf4e 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -940,7 +940,7 @@ Eina_Bool etRunner::setSplashLaunch(const char *path, int type) { const char *effect_type = "launch"; - struct wl_array options1, options2; + struct wl_array option; // init tzlaunch_splash if (tzlaunch_splash) @@ -951,15 +951,11 @@ etRunner::setSplashLaunch(const char *path, int type) if (tzlaunch_effect) tzlaunch_splash = tizen_launch_effect_create_splash_img(tzlaunch_effect); EINA_SAFETY_ON_NULL_RETURN_VAL(tzlaunch_splash, EINA_FALSE); - wl_array_init(&options1); - tizen_launch_effect_type_set(tzlaunch_effect, "launch", 555, &options1); - wl_array_release(&options1); - - wl_array_init(&options2); + wl_array_init(&option); tizen_launch_splash_launch(tzlaunch_splash, path, type, 24, 0, 0, - effect_type, NULL, &options2); - wl_array_release(&options2); + effect_type, NULL, &option); + wl_array_release(&option); return EINA_TRUE; } -- 2.7.4 From 6d2178eee84f2c3a0552e0ffcfa888c08bfcf1f6 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 19 Jul 2019 10:10:38 +0900 Subject: [PATCH 10/16] e_test_event: rename dbus proxy & obj to ds_proxy & ds_obj Change-Id: Ib56b2dcfe1a33f054b2a8cf981ec3a51cc8421dc --- src/e_test_event.cpp | 58 ++++++++++++++++++++++++++-------------------------- src/e_test_event.h | 12 +++++------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 75aaf4e..3e6a92d 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -146,14 +146,14 @@ etRunner::init() dbus.conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM); EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.conn, EINA_FALSE); - dbus.obj = eldbus_object_get(dbus.conn, + dbus.ds_obj = eldbus_object_get(dbus.conn, "org.enlightenment.wm", "/org/enlightenment/wm"); - EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.obj, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.ds_obj, EINA_FALSE); - dbus.proxy = eldbus_proxy_get(dbus.obj, + dbus.ds_proxy = eldbus_proxy_get(dbus.ds_obj, "org.enlightenment.wm.Test"); - EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.proxy, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.ds_proxy, EINA_FALSE); // reset registered window of e_test_helper res = resetRegisterWin(); @@ -208,8 +208,8 @@ etRunner::shutdown() } // deinit eldbus - eldbus_proxy_unref(dbus.proxy); - eldbus_object_unref(dbus.obj); + eldbus_proxy_unref(dbus.ds_proxy); + eldbus_object_unref(dbus.ds_obj); eldbus_connection_unref(dbus.conn); eldbus_shutdown(); @@ -226,7 +226,7 @@ etRunner::registerWin(etWin *tw) Eldbus_Pending *p = NULL; Eina_Bool accepted = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "RegisterWindow", _cb_method_window_register, &accepted, @@ -246,7 +246,7 @@ etRunner::deregisterWin(etWin *tw) Eldbus_Pending *p = NULL; Eina_Bool accepted = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "DeregisterWindow", _cb_method_window_register, &accepted, @@ -266,7 +266,7 @@ etRunner::resetRegisterWin() Eldbus_Pending *p = NULL; Eina_Bool accepted = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "ResetRegisterWindow", _cb_method_window_register, &accepted, @@ -314,7 +314,7 @@ etRunner::setWinStack(etWin *tw, Eina_Bool above) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "SetWindowStack", NULL, NULL, @@ -395,7 +395,7 @@ etRunner::setZoneRotation(int angle) Eldbus_Pending *p = NULL; Eina_Bool allowed = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "ChangeZoneRotation", _cb_method_zone_rotation_change, &allowed, @@ -415,7 +415,7 @@ etRunner::setTCStart() Eldbus_Pending *p = NULL; Eina_Bool res = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "StartTestCase", _cb_method_set_tc_start_end, &res, @@ -440,7 +440,7 @@ etRunner::setTCEnd() Eldbus_Pending *p = NULL; Eina_Bool res = EINA_FALSE; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EndTestCase", _cb_method_set_tc_start_end, &res, @@ -469,7 +469,7 @@ etRunner::getWinInfo(etWin *tw) while (retry) { - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "GetWinInfo", _cb_method_win_info_get, tw, @@ -509,7 +509,7 @@ etRunner::getWinInfoList() while (info_list) { - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "GetWinsInfo", _cb_method_win_info_list_get, info_list, @@ -625,7 +625,7 @@ Eina_Bool etRunner::setDpms(Eina_Bool on) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "DPMS", NULL, NULL, @@ -640,7 +640,7 @@ Eina_Bool etRunner::feedMouseDown(int x, int y) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventMouse", NULL, NULL, @@ -656,7 +656,7 @@ Eina_Bool etRunner::feedMouseMove(int x, int y) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventMouse", NULL, NULL, @@ -672,7 +672,7 @@ Eina_Bool etRunner::feedMouseUp(int x, int y) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventMouse", NULL, NULL, @@ -688,7 +688,7 @@ Eina_Bool etRunner::feedKeyDown(const char *key) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventKey", NULL, NULL, @@ -704,7 +704,7 @@ Eina_Bool etRunner::feedKeyUp(const char *key) { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventKey", NULL, NULL, @@ -979,7 +979,7 @@ etRunner::setWinEffect(etWin *tw) this->ev.elm_win = tw->elm_win; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "RenderTrace", _cb_method_window_effect, &accepted, @@ -997,7 +997,7 @@ Eina_Bool etRunner::freezeEvent() { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventFreeze", NULL, NULL, @@ -1012,7 +1012,7 @@ Eina_Bool etRunner::thawEvent() { Eldbus_Pending *p = NULL; - p = eldbus_proxy_call(dbus.proxy, + p = eldbus_proxy_call(dbus.ds_proxy, "EventFreeze", NULL, NULL, @@ -1122,35 +1122,35 @@ etRunner::addSignalHandlers() flushEventQueue(); - sh = eldbus_proxy_signal_handler_add(dbus.proxy, + sh = eldbus_proxy_signal_handler_add(dbus.ds_proxy, "VisibilityChanged", _cb_signal_vis_changed, this); EINA_SAFETY_ON_NULL_GOTO(sh, err); ev.sh_list = eina_list_append(ev.sh_list, sh); - sh = eldbus_proxy_signal_handler_add(dbus.proxy, + sh = eldbus_proxy_signal_handler_add(dbus.ds_proxy, "StackChanged", _cb_signal_stack_changed, this); EINA_SAFETY_ON_NULL_GOTO(sh, err); ev.sh_list = eina_list_append(ev.sh_list, sh); - sh = eldbus_proxy_signal_handler_add(dbus.proxy, + sh = eldbus_proxy_signal_handler_add(dbus.ds_proxy, "WinRotationChanged", _cb_signal_win_rot_changed, this); EINA_SAFETY_ON_NULL_GOTO(sh, err); ev.sh_list = eina_list_append(ev.sh_list, sh); - sh = eldbus_proxy_signal_handler_add(dbus.proxy, + sh = eldbus_proxy_signal_handler_add(dbus.ds_proxy, "FocusChanged", _cb_signal_focus_changed, this); EINA_SAFETY_ON_NULL_GOTO(sh, err); ev.sh_list = eina_list_append(ev.sh_list, sh); - sh = eldbus_proxy_signal_handler_add(dbus.proxy, + sh = eldbus_proxy_signal_handler_add(dbus.ds_proxy, "RenderRun", _cb_signal_render_while_effect_run, this); diff --git a/src/e_test_event.h b/src/e_test_event.h index eb815cd..cb78489 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -22,8 +22,8 @@ private: ev = {0,}; logDomain = 0; dbus.conn = NULL; - dbus.proxy = NULL; - dbus.obj = NULL; + dbus.ds_proxy = NULL; + dbus.ds_obj = NULL; listWinInfo = NULL; output = {0,}; }; @@ -46,8 +46,8 @@ private: struct { Eldbus_Connection *conn; - Eldbus_Proxy *proxy; - Eldbus_Object *obj; + Eldbus_Proxy *ds_proxy; // display server proxy + Eldbus_Object *ds_obj; // display server obj } dbus; struct tizen_policy *tzPolicy; @@ -168,8 +168,8 @@ public: Eina_Bool addSignalHandlers(); void delSignalHandlers(); - Eldbus_Proxy *getDbusProxy() { return dbus.proxy; } - Eldbus_Object *getDbusObject() { return dbus.obj; } + Eldbus_Proxy *getDbusProxy() { return dbus.ds_proxy; } + Eldbus_Object *getDbusObject() { return dbus.ds_obj; } int getLogDomain() { return logDomain; } efl_util_gesture_h getGestureHandler() { return gestureHandler; } -- 2.7.4 From ca5caed736bbfaf01461db4af9c58c1d802d63d2 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 19 Jul 2019 15:13:02 +0900 Subject: [PATCH 11/16] e_test_event: add request kill window by name Change-Id: I930b51e4f8bed2b9e7b04519aa2add9ccb1c4b1b --- src/e_test_event.cpp | 19 +++++++++++++++++++ src/e_test_event.h | 1 + src/e_test_main.cpp | 3 +++ 3 files changed, 23 insertions(+) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 3e6a92d..d196be1 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -293,6 +293,25 @@ etRunner::setWinActivate(etWin *tw) } Eina_Bool +etRunner::requestKillWinByName(const char *name) +{ + Eldbus_Pending *p = NULL; + + EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); + + p = eldbus_proxy_call(dbus.ds_proxy, + "RequestKillWin", + NULL, + NULL, + -1, + "s", + name); + EINA_SAFETY_ON_NULL_RETURN_VAL(p, EINA_FALSE); + + return EINA_TRUE; +} + +Eina_Bool etRunner::setWinIconic(etWin *tw, Eina_Bool set) { diff --git a/src/e_test_event.h b/src/e_test_event.h index cb78489..4e86325 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -162,6 +162,7 @@ public: Eina_Bool freezeEvent(); Eina_Bool thawEvent(); Eina_Bool waitEvent(etWin *win, E_TC_Event_Type ev_type); + Eina_Bool requestKillWinByName(const char *name); void flushEventQueue(); Eina_Bool addEventIntoQueue(Ecore_Window id, E_TC_Event_Type ev_type); diff --git a/src/e_test_main.cpp b/src/e_test_main.cpp index b84b998..ee0dca8 100644 --- a/src/e_test_main.cpp +++ b/src/e_test_main.cpp @@ -12,6 +12,9 @@ elm_main(int argc, char **argv) res = etRunner::get().init(); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, 1); + // kill Lockscreen + etRunner::get().requestKillWinByName("LOCKSCREEN"); + ::testing::InitGoogleTest(&argc, argv); ret = RUN_ALL_TESTS(); -- 2.7.4 From 87e3fbf68c272a8f567b65dbc4ac3f1877a1422b Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Fri, 19 Jul 2019 14:12:13 +0900 Subject: [PATCH 12/16] e_test_event: add display device control dbus and method Added device control dbus and display always on/off method. and using it when the whole test init. (Call wait() method to prevent abnormal action) Change-Id: I4f05ddbca47f3e99f339b921d964392f2259bf39 --- src/e_test_event.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/e_test_event.h | 5 +++++ src/e_test_main.cpp | 9 +++++++++ 3 files changed, 51 insertions(+) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index d196be1..100629e 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -155,6 +155,15 @@ etRunner::init() "org.enlightenment.wm.Test"); EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.ds_proxy, EINA_FALSE); + dbus.deviced_obj = eldbus_object_get(dbus.conn, + "org.tizen.system.deviced", + "/Org/Tizen/System/DeviceD/Display"); + EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.deviced_obj, EINA_FALSE); + + dbus.deviced_proxy = eldbus_proxy_get(dbus.deviced_obj, + "org.tizen.system.deviced.display"); + EINA_SAFETY_ON_NULL_RETURN_VAL(dbus.deviced_proxy, EINA_FALSE); + // reset registered window of e_test_helper res = resetRegisterWin(); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EINA_FALSE); @@ -208,6 +217,8 @@ etRunner::shutdown() } // deinit eldbus + eldbus_proxy_unref(dbus.deviced_proxy); + eldbus_object_unref(dbus.deviced_obj); eldbus_proxy_unref(dbus.ds_proxy); eldbus_object_unref(dbus.ds_obj); eldbus_connection_unref(dbus.conn); @@ -656,6 +667,32 @@ etRunner::setDpms(Eina_Bool on) } Eina_Bool +etRunner::setDevctlDisplayStop(Eina_Bool on) +{ + Eldbus_Pending *p = NULL; + if (on) + { + p = eldbus_proxy_call(dbus.deviced_proxy, + "stop", + NULL, + NULL, + -1, + ""); + } + else + { + p = eldbus_proxy_call(dbus.deviced_proxy, + "start", + NULL, + NULL, + -1, + ""); + } + EINA_SAFETY_ON_NULL_RETURN_VAL(p != NULL, EINA_FALSE); + return EINA_TRUE; +} + +Eina_Bool etRunner::feedMouseDown(int x, int y) { Eldbus_Pending *p = NULL; diff --git a/src/e_test_event.h b/src/e_test_event.h index 4e86325..1557553 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -24,6 +24,8 @@ private: dbus.conn = NULL; dbus.ds_proxy = NULL; dbus.ds_obj = NULL; + dbus.deviced_proxy = NULL; + dbus.deviced_obj = NULL; listWinInfo = NULL; output = {0,}; }; @@ -48,6 +50,8 @@ private: Eldbus_Connection *conn; Eldbus_Proxy *ds_proxy; // display server proxy Eldbus_Object *ds_obj; // display server obj + Eldbus_Proxy *deviced_proxy; // deviced proxy + Eldbus_Object *deviced_obj; // deviced obj } dbus; struct tizen_policy *tzPolicy; @@ -139,6 +143,7 @@ public: Ecore_Window getWinId(Evas_Object *elm_win); struct wl_surface *getWlSurface(Evas_Object *elm_win); Eina_Bool setDpms(Eina_Bool on); + Eina_Bool setDevctlDisplayStop(Eina_Bool on); Eina_Bool feedMouseDown(int x, int y); Eina_Bool feedMouseMove(int x, int y); Eina_Bool feedMouseUp(int x, int y); diff --git a/src/e_test_main.cpp b/src/e_test_main.cpp index ee0dca8..eac3857 100644 --- a/src/e_test_main.cpp +++ b/src/e_test_main.cpp @@ -12,6 +12,15 @@ elm_main(int argc, char **argv) res = etRunner::get().init(); EINA_SAFETY_ON_FALSE_RETURN_VAL(res, 1); + // display on + etRunner::get().setDevctlDisplayStop(EINA_TRUE); + etRunner::get().work(0.5); + etRunner::get().setDevctlDisplayStop(EINA_FALSE); + etRunner::get().work(0.5); + + // keep display on + etRunner::get().setDevctlDisplayStop(EINA_TRUE); + // kill Lockscreen etRunner::get().requestKillWinByName("LOCKSCREEN"); -- 2.7.4 From c2231df792e7767596ccdf1d21a2b83f3870cae1 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Fri, 2 Aug 2019 13:50:54 +0900 Subject: [PATCH 13/16] fixed warnings Change-Id: I1bdbe6b07bdf3c9c730c15482a32973fb7c37ba8 --- src/e_test_event.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index 100629e..a68bf75 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -688,7 +688,7 @@ etRunner::setDevctlDisplayStop(Eina_Bool on) -1, ""); } - EINA_SAFETY_ON_NULL_RETURN_VAL(p != NULL, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL(p != NULL, EINA_FALSE); return EINA_TRUE; } @@ -1100,6 +1100,8 @@ etRunner::waitEvent(etWin *win, E_TC_Event_Type ev_type) case E_TC_EVENT_TYPE_STACK_CHANGED: ev_type = E_TC_EVENT_TYPE_STACK_CHANGED; break; + default: + break; } // Add event callbacks if needs -- 2.7.4 From 391dd23a30866601d27298545b158a85a2a4a652 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Fri, 2 Aug 2019 13:51:20 +0900 Subject: [PATCH 14/16] Packaging: update version to 0.5.0 Change-Id: I39acd64d74473b76e43a00a60994748be2ac8190 --- packaging/e-tizen-unittests.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-tizen-unittests.spec b/packaging/e-tizen-unittests.spec index 86259bd..231d5c1 100644 --- a/packaging/e-tizen-unittests.spec +++ b/packaging/e-tizen-unittests.spec @@ -1,5 +1,5 @@ Name: e-tizen-unittests -Version: 0.4.0 +Version: 0.5.0 Release: 1 Summary: The test case runner for enlightenment URL: http://www.enlightenment.org -- 2.7.4 From d7a4a627941b4e0233e30ed18afd45f2b4dd92f6 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Mon, 26 Aug 2019 17:51:29 +0900 Subject: [PATCH 15/16] e_test_main: turn off "always on display" after test done. Change-Id: I4696bc2e265bf84c5eb4ac8ac6b6664363b8aa21 --- src/e_test_event.cpp | 39 ++++++++++++++++++++++++++++++++------- src/e_test_event.h | 3 ++- src/e_test_main.cpp | 12 +++++++----- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/e_test_event.cpp b/src/e_test_event.cpp index a68bf75..4c9f34c 100644 --- a/src/e_test_event.cpp +++ b/src/e_test_event.cpp @@ -667,28 +667,53 @@ etRunner::setDpms(Eina_Bool on) } Eina_Bool -etRunner::setDevctlDisplayStop(Eina_Bool on) +etRunner::setDevctlDisplayLock(Eina_Bool lock) { Eldbus_Pending *p = NULL; - if (on) + + if (lock) { p = eldbus_proxy_call(dbus.deviced_proxy, - "stop", + "lockstate", NULL, NULL, -1, - ""); + "sssi", + "lcdon", + "gotostatenow", + "holdkeyblock", + "0"); } else { p = eldbus_proxy_call(dbus.deviced_proxy, - "start", + "unlockstate", NULL, NULL, -1, - ""); + "ss", + "lcdon", + "resettimer"); } - EINA_SAFETY_ON_FALSE_RETURN_VAL(p != NULL, EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(p != NULL, EINA_FALSE); + + return EINA_TRUE; +} + +Eina_Bool +etRunner::setDevctlDisplayOn(Eina_Bool on) +{ + Eldbus_Pending *p = NULL; + + p = eldbus_proxy_call(dbus.deviced_proxy, + "changestate", + NULL, + NULL, + -1, + "s", + on? "lcdon" : "lcdoff"); + EINA_SAFETY_ON_TRUE_RETURN_VAL(p != NULL, EINA_FALSE); + return EINA_TRUE; } diff --git a/src/e_test_event.h b/src/e_test_event.h index 1557553..bf85268 100644 --- a/src/e_test_event.h +++ b/src/e_test_event.h @@ -143,7 +143,8 @@ public: Ecore_Window getWinId(Evas_Object *elm_win); struct wl_surface *getWlSurface(Evas_Object *elm_win); Eina_Bool setDpms(Eina_Bool on); - Eina_Bool setDevctlDisplayStop(Eina_Bool on); + Eina_Bool setDevctlDisplayLock(Eina_Bool lock); + Eina_Bool setDevctlDisplayOn(Eina_Bool on); Eina_Bool feedMouseDown(int x, int y); Eina_Bool feedMouseMove(int x, int y); Eina_Bool feedMouseUp(int x, int y); diff --git a/src/e_test_main.cpp b/src/e_test_main.cpp index eac3857..5427136 100644 --- a/src/e_test_main.cpp +++ b/src/e_test_main.cpp @@ -13,13 +13,12 @@ elm_main(int argc, char **argv) EINA_SAFETY_ON_FALSE_RETURN_VAL(res, 1); // display on - etRunner::get().setDevctlDisplayStop(EINA_TRUE); - etRunner::get().work(0.5); - etRunner::get().setDevctlDisplayStop(EINA_FALSE); + etRunner::get().setDevctlDisplayOn(EINA_TRUE); etRunner::get().work(0.5); - // keep display on - etRunner::get().setDevctlDisplayStop(EINA_TRUE); + // display lock + etRunner::get().setDevctlDisplayLock(EINA_TRUE); + etRunner::get().work(0.5); // kill Lockscreen etRunner::get().requestKillWinByName("LOCKSCREEN"); @@ -27,6 +26,9 @@ elm_main(int argc, char **argv) ::testing::InitGoogleTest(&argc, argv); ret = RUN_ALL_TESTS(); + // display unlock + etRunner::get().setDevctlDisplayLock(EINA_FALSE); + etRunner::get().shutdown(); return ret; -- 2.7.4 From 8d6794eb68994ca91f0fc25d554b4d07e95e2dde Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 2 Sep 2019 15:40:18 +0900 Subject: [PATCH 16/16] Packaging: update version to 0.5.1 Change-Id: I41e93f4a087991cd8ae4902a39b98f225c875cc5 --- packaging/e-tizen-unittests.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-tizen-unittests.spec b/packaging/e-tizen-unittests.spec index 231d5c1..d4147d5 100644 --- a/packaging/e-tizen-unittests.spec +++ b/packaging/e-tizen-unittests.spec @@ -1,5 +1,5 @@ Name: e-tizen-unittests -Version: 0.5.0 +Version: 0.5.1 Release: 1 Summary: The test case runner for enlightenment URL: http://www.enlightenment.org -- 2.7.4