e_test_util: Add some checkers using etTCResult 81/313181/1
authorJunseok Kim <juns.kim@samsung.com>
Mon, 17 Jun 2024 09:29:14 +0000 (18:29 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Thu, 20 Jun 2024 02:17:31 +0000 (11:17 +0900)
Change-Id: Iea00d7df877ced362c7b264c4dc1c3b346080ac1

src/e_test_util.h

index 7a6e8aae8d54d3bd0d73944f4ef7efe61fcb8f05..ad62e09853b9a3177ea612e629c20110c309e4c4 100644 (file)
@@ -339,6 +339,37 @@ typedef struct _Window_Info_List
      ASSERT_TRUE(ev_result_iconic->isUniconified()) << "Window is iconified"; \
    } while (0)
 
+#define RETURN_VIS_ON(TEST_WINDOW) \
+   do { \
+     if (TEST_WINDOW == nullptr) return etTCResult(false, "Window is NULL"); \
+     ev_result_vis = std::static_pointer_cast<visibleEventItem>(etRunner::get().waitEvent(TEST_WINDOW, E_TC_EVENT_TYPE_VIS_ON)); \
+     if (ev_result_vis == nullptr) return etTCResult(false, "result is NULL"); \
+     if (ev_result_vis->isTimeout) return etTCResult(false, "waitEvent timeout (1.0 sec)"); \
+     if (!ev_result_vis->result) return etTCResult(false, "waitEvent failed"); \
+     if (!ev_result_vis->isVisible()) return etTCResult(false, "Window is invisible"); \
+   } while (0)
+
+#define RETURN_FOCUS_IN(TEST_WINDOW) \
+   do { \
+     if (TEST_WINDOW == nullptr) return etTCResult(false, "Window is NULL"); \
+     ev_result_focus = std::static_pointer_cast<focusEventItem>(etRunner::get().waitEvent(TEST_WINDOW, E_TC_EVENT_TYPE_FOCUS_CHANGED)); \
+     if (ev_result_focus == nullptr) return etTCResult(false, "result is NULL"); \
+     if (ev_result_focus->isTimeout) return etTCResult(false, "waitEvent timeout (1.0 sec)"); \
+     if (!ev_result_focus->result) return etTCResult(false, "waitEvent failed"); \
+     if (!ev_result_focus->isFocused()) return etTCResult(false, "Window isn't focused"); \
+   } while (0)
+
+#define RETURN_ICONIFIED_BY_SERVER(TEST_WINDOW) \
+   do { \
+     if (TEST_WINDOW == nullptr) return etTCResult(false, "Window is NULL"); \
+     ev_result_iconic = std::static_pointer_cast<iconicStateEventItem>(etRunner::get().waitEvent(TEST_WINDOW, E_TC_EVENT_TYPE_ICONIC_STATE_CHANGED)); \
+     if (ev_result_iconic == nullptr) return etTCResult(false, "result is NULL"); \
+     if (ev_result_iconic->isTimeout) return etTCResult(false, "waitEvent timeout (1.0 sec)"); \
+     if (!ev_result_iconic->result) return etTCResult(false, "waitEvent failed"); \
+     if (!ev_result_iconic->isIconified()) return etTCResult(false, "Window is uniconified"); \
+     if (ev_result_iconic->isIconifiedByClient()) return etTCResult(false, "Window is iconified by client"); \
+   } while (0)
+
 #define CAPTURE_WIDTH_MOBILE 720
 #define CAPTURE_HEIGHT_MOBILE 1280
 #define CAPTURE_WIDTH_COMMON 1920