From: JunSeok, Kim Date: Thu, 31 May 2018 05:27:19 +0000 (+0900) Subject: 0008_focus: Added window transient_for test case. X-Git-Tag: accepted/tizen/unified/20180629.154202~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54e1b32b589b89c00786384695c1a8b0458b822f;p=platform%2Fcore%2Fuifw%2Fe-tizen-testcase.git 0008_focus: Added window transient_for test case. Change-Id: I530da5894cdc6ddd236befc8ccee30fc63dc1fd4 --- diff --git a/src/testcase/0008_focus.cpp b/src/testcase/0008_focus.cpp index f502f1f..2d999e1 100644 --- a/src/testcase/0008_focus.cpp +++ b/src/testcase/0008_focus.cpp @@ -331,6 +331,95 @@ TEST_F(etTestFocus, focus_activate2) etRunner::get().freeWinInfoList(list); } +TEST_F(etTestFocus, focus_transient_for1) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = 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); + + // 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_transient_for2) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = 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); + + // Expected focus res: + // [Top] Green[focused] -> Blue -> Red [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_green->native_win) + ASSERT_TRUE(tw->Focus.obj); + else + ASSERT_FALSE(tw->Focus.obj); + } + etRunner::get().freeWinInfoList(list); +} + +TEST_F(etTestFocus, focus_transient_for3) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = 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); + + // Expected focus res: + // [Top] Blue[focused] -> Green -> Red [Bottom] + list = etRunner::get().getWinInfoList(); + ASSERT_TRUE(list != NULL); + + EINA_LIST_CAST_FOREACH(list, l, tw, etWin*) + { + if (tw->native_win == tw_blue->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; @@ -473,3 +562,33 @@ TEST_F(etTestFocus, focus_fullsize_activate) } etRunner::get().freeWinInfoList(list); } + +TEST_F(etTestFocus, focus_fullsize_transient_for) +{ + etWin *tw = NULL; + Eina_Bool res = EINA_FALSE; + Eina_List *list = NULL, *l = NULL; + + res = 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); + + // 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); +}