0008_focus: Added window touch test case. 93/180593/1
authorJunSeok, Kim <juns.kim@samsung.com>
Thu, 31 May 2018 05:36:42 +0000 (14:36 +0900)
committerJunSeok, Kim <juns.kim@samsung.com>
Thu, 31 May 2018 05:36:42 +0000 (14:36 +0900)
Change-Id: I43ec58e50b54d3567568a3883a77c81af70d08a4

src/testcase/0008_focus.cpp

index 32f8cf6..4434690 100644 (file)
@@ -515,6 +515,37 @@ TEST_F(etTestFocus, focus_uniconify)
      }
    etRunner::get().freeWinInfoList(list);
 }
+
+TEST_F(etTestFocus, focus_touch_basic)
+{
+   etWin *tw = NULL;
+   Eina_Bool res = EINA_FALSE;
+   Eina_List *list = NULL, *l = NULL;
+
+   res = initTC(EINA_TRUE, EINA_TRUE);
+   ASSERT_TRUE(res);
+
+   // touch red win
+   res = registerTCWin(tw_red);
+   EXPECT_TRUE(res);
+   etRunner::get().generateMouseDown(50, 50);
+   etRunner::get().generateMouseUp(50, 50);
+   etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED);
+
+   // Expected focus res:
+   // [Top] Blue -> Green -> Red[focused] [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;