From 1df762252daa2f43b48c29bc23100b24a9fd3495 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Mon, 2 Sep 2019 20:31:33 +0900 Subject: [PATCH] 0008_focus: add TC's for check focus event while activate under blocked. Change-Id: If246cc4be964df682bd99f87447da4933cf091af --- src/testcase/0008_focus.cpp | 116 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/src/testcase/0008_focus.cpp b/src/testcase/0008_focus.cpp index 6126509..c481211 100644 --- a/src/testcase/0008_focus.cpp +++ b/src/testcase/0008_focus.cpp @@ -1180,6 +1180,48 @@ TEST_F(etTestFocus, focus_fullsize_obscured_activate) etRunner::get().freeWinInfoList(list); } +TEST_F(etTestFocus, focus_fullsize_obscured_activate_check_event) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + // init TC window, show=true, geom=false + initTC(EINA_TRUE, EINA_FALSE); + + // show blocker + res = etRunner::get().setWinNotiLevel(tw_blocker, + EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); + EXPECT_TRUE(res); + showTCWin(tw_blocker); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); + + // set event checkpoint + etRunner::get().setEventCheckpoint(); + + // Activate tw_red + res = etRunner::get().setWinActivate(tw_red); + ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_STACK_ABOVE); + + // Expected focus res: + // [Top] Blocker[focused] -> ... -> Red -> Blue -> Green [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_blocker->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); + + // check event of tw_red + ASSERT_FALSE(etRunner::get().isEventOccuredAfterCheckpoint(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED)); +} + TEST_F(etTestFocus, focus_fullsize_obscured_activate_destroy) { etWin *tw = NULL; @@ -1222,6 +1264,80 @@ TEST_F(etTestFocus, focus_fullsize_obscured_activate_destroy) etRunner::get().freeWinInfoList(list); } +TEST_F(etTestFocus, focus_fullsize_show_activate_under_blocker) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + // init TC window, show=false, geom=false + initTC(EINA_FALSE, EINA_FALSE); + + showTCWin(tw_blocker); + etRunner::get().setWinNotiLevel(tw_blocker, + EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); + + // Activate tw_red + res = showActivateTCWin(tw_red); + ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); + + // Expected focus res: + // [Top] Blocker[focused] -> ... -> Red [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_blocker->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); +} + +TEST_F(etTestFocus, focus_fullsize_show_activate_under_blocker_check_event) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + // init TC window, show=false, geom=false + initTC(EINA_FALSE, EINA_FALSE); + + showTCWin(tw_blocker); + etRunner::get().setWinNotiLevel(tw_blocker, + EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); + etRunner::get().waitEvent(tw_blocker, E_TC_EVENT_TYPE_VIS_ON); + + // set event checkpoint + etRunner::get().setEventCheckpoint(); + + // Activate tw_red + res = showActivateTCWin(tw_red); + ASSERT_TRUE(res); + etRunner::get().waitEvent(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED); + + // Expected focus res: + // [Top] Blocker[focused] -> ... -> Red [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_blocker->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); + + // check event of tw_red + ASSERT_FALSE(etRunner::get().isEventOccuredAfterCheckpoint(tw_red, E_TC_EVENT_TYPE_FOCUS_CHANGED)); +} + TEST_F(etTestFocus, focus_fullsize_transient_for) { etWin *tw = NULL; -- 2.7.4