0008_focus: add TC's for check focus event while activate under blocked. 94/213194/2
authorJunseok, Kim <juns.kim@samsung.com>
Mon, 2 Sep 2019 11:31:33 +0000 (20:31 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 3 Sep 2019 08:39:56 +0000 (08:39 +0000)
Change-Id: If246cc4be964df682bd99f87447da4933cf091af

src/testcase/0008_focus.cpp

index 6126509..c481211 100644 (file)
@@ -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;