0008_focus: add testcase for activate immediately after show 00/191000/4
authorJunSeok, Kim <juns.kim@samsung.com>
Wed, 10 Oct 2018 08:10:38 +0000 (17:10 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Fri, 2 Nov 2018 05:36:10 +0000 (05:36 +0000)
Change-Id: Iad1958424404d6487be920a0532f2c1dc5ac0610

src/testcase/0008_focus.cpp

index f9e6ab452f8a3c95377b709d3baec93f2c7c82f2..7abca43c2ae594d07248c6c4935faab83a92d7c1 100644 (file)
@@ -275,6 +275,39 @@ TEST_F(etTestFocus, focus_activate3)
    etRunner::get().freeWinInfoList(list);
 }
 
+TEST_F(etTestFocus, focus_show_activate)
+{
+   etWin *tw = NULL;
+   Eina_Bool res = EINA_FALSE;
+   Eina_List *list = NULL, *l = NULL;
+
+   // 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);
+   etRunner::get().setWinNotiLevel(tw_small_blocker,
+                                   EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT);
+
+   // Activate tw_red
+   res = showActivateTCWin(tw_red);
+   ASSERT_TRUE(res);
+   etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED);
+
+   // 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_obscured_activate)
 {
    etWin *tw = NULL;