0008_focus: add testcase for window move 33/188033/5
authorJunSeok, Kim <juns.kim@samsung.com>
Thu, 30 Aug 2018 11:22:43 +0000 (20:22 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 5 Sep 2018 06:33:56 +0000 (06:33 +0000)
Change-Id: I12c13ced01d571fb25d62a42e2609cdb743a040b

src/testcase/0008_focus.cpp

index 6767265463d03b3bd55895238da0fa8137597c62..e1b14dd0fc9e485a8a3685efc0caf97b2fe503cd 100644 (file)
@@ -617,6 +617,66 @@ TEST_F(etTestFocus, focus_visibility)
    etRunner::get().freeWinInfoList(list);
 }
 
+TEST_F(etTestFocus, focus_move)
+{
+   etWin *tw = NULL;
+   Eina_Bool res = EINA_FALSE;
+   Eina_List *list = NULL, *l = NULL;
+
+   // init TC window, show=true, geom=true
+   initTC(EINA_TRUE, EINA_TRUE);
+
+   // move tw_blue to out of screen
+   tw_blue->move(2000, 2000);
+   etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_CHANGED);
+
+   // Expected focus res:
+   // [Top] Blue -> Green[focused] -> 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, DISABLED_focus_move2)
+{
+   etWin *tw = NULL;
+   Eina_Bool res = EINA_FALSE;
+   Eina_List *list = NULL, *l = NULL;
+
+   // init TC window, show=true, geom=true
+   initTC(EINA_TRUE, EINA_TRUE);
+
+   // move tw_blue to out of screen
+   tw_blue->move(2000, 2000);
+   etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_OFF);
+
+   // move tw_blue into screen
+   tw_blue->move(200, 200);
+   etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON);
+
+   // Expected focus res:
+   // [Top] Blue -> Green[focused] -> 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_touch_basic)
 {
    etWin *tw = NULL;