From bf2e7377dbd97a1ced30ef9b6ac96fddf0762dec Mon Sep 17 00:00:00 2001 From: "JunSeok, Kim" Date: Thu, 31 May 2018 14:24:53 +0900 Subject: [PATCH] 0008_focus: Added window activate test case. Change-Id: Ida8fbbb0082d42985f4b0352658eb67f58da9074 --- src/testcase/0008_focus.cpp | 96 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/src/testcase/0008_focus.cpp b/src/testcase/0008_focus.cpp index 37fa999..f502f1f 100644 --- a/src/testcase/0008_focus.cpp +++ b/src/testcase/0008_focus.cpp @@ -266,6 +266,71 @@ TEST_F(etTestFocus, focus_destroy) etRunner::get().freeWinInfoList(list); } +TEST_F(etTestFocus, focus_activate1) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = initTC(EINA_TRUE, EINA_TRUE); + ASSERT_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); + + // Expected focus res: + // [Top] Red[focused] -> Blue -> Green [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_red->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); +} + +TEST_F(etTestFocus, focus_activate2) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = initTC(EINA_TRUE, EINA_TRUE); + ASSERT_TRUE(res); + + // show Blocker + showTCWin(tw_blocker); + + // 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); + + // Expected focus res: + // [Top] Red[focused] -> Blocker -> Blue -> Green [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_red->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); +} + TEST_F(etTestFocus, focus_fullsize_basic) { etWin *tw = NULL; @@ -377,3 +442,34 @@ TEST_F(etTestFocus, focus_fullsize_destroy) } etRunner::get().freeWinInfoList(list); } + +TEST_F(etTestFocus, focus_fullsize_activate) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = initTC(EINA_TRUE, EINA_FALSE); + ASSERT_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); + + // Expected focus res: + // [Top] Red[focused] -> Blue -> Green [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_red->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); +} -- 2.7.4