etRunner::get().freeWinInfoList(list);
}
+TEST_F(etTestFocus, focus_touch_history)
+{
+ 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);
+
+ // 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);
+
+ // touch blue win
+ res = registerTCWin(tw_blue);
+ EXPECT_TRUE(res);
+ etRunner::get().generateMouseDown(250, 250);
+ etRunner::get().generateMouseUp(250, 250);
+ etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED);
+
+ // 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);
+
+ // remove blue win
+ removeTCWin(tw_blue);
+
+ // Expected focus res:
+ // [Top] 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);
+
+ // remove red win
+ removeTCWin(tw_red);
+
+ // Expected focus res:
+ // [Top] Green[focused] [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_touch_history2)
+{
+ 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);
+
+ // touch green win
+ res = registerTCWin(tw_green);
+ EXPECT_TRUE(res);
+ etRunner::get().generateMouseDown(150, 150);
+ etRunner::get().generateMouseUp(150, 150);
+ etRunner::get().waitEvent(E_TC_EVENT_TYPE_FOCUS_CHANGED);
+
+ // Expected focus res:
+ // [Top] Red -> Green[focused] -> Blue [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);
+
+ // activate red win
+ res = registerTCWin(tw_red);
+ EXPECT_TRUE(res);
+ etRunner::get().setWinActivate(tw_red);
+ etRunner::get().waitEvent(E_TC_EVENT_TYPE_STACK_ABOVE);
+
+ // 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);
+
+ // lower red win
+ etRunner::get().setWinStack(tw_red, NULL, EINA_FALSE);
+ 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_skip_set)
{
etWin *tw = NULL;