e_test_util: add ASSERT_IF_VIS_ON/OFF definition 24/267324/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 1 Dec 2021 11:49:39 +0000 (20:49 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 1 Dec 2021 11:49:43 +0000 (20:49 +0900)
ASSERT_IF_VIS_ON  : if the window's visibility is changed to ON, then makes failure
ASSERT_IF_VIS_OFF : if the window's visibility is changed to OFF, then makes failure

Change-Id: I05218e9dd8436179d7252ca7ea38b9d38ef59bb1

src/e_test_util.h

index a2fe04db4a91df8d6ef74a5162494331769da1cb..96545475cf6e98050a9f4cbe26968541f68e41a5 100644 (file)
@@ -226,6 +226,24 @@ typedef struct _Window_Info_List
      ASSERT_FALSE(ev_result_vis->isVisible()) << "Window is visible"; \
    } while (0)
 
+#define ASSERT_IF_VIS_ON(TEST_WINDOW) \
+   do { \
+     ASSERT_NE(TEST_WINDOW, nullptr) << "Window is NULL"; \
+     ev_result_vis = std::static_pointer_cast<visibleEventItem>(etRunner::get().waitEvent(TEST_WINDOW, E_TC_EVENT_TYPE_VIS_ON)); \
+     ASSERT_NE(ev_result_vis, nullptr) << "result is NULL"; \
+     if (ev_result_vis->result) \
+       { ASSERT_FALSE(ev_result_vis->isVisible()) << "Window is visible"; } \
+   } while (0)
+
+#define ASSERT_IF_VIS_OFF(TEST_WINDOW) \
+   do { \
+     ASSERT_NE(TEST_WINDOW, nullptr) << "Window is NULL"; \
+     ev_result_vis = std::static_pointer_cast<visibleEventItem>(etRunner::get().waitEvent(TEST_WINDOW, E_TC_EVENT_TYPE_VIS_OFF)); \
+     ASSERT_NE(ev_result_vis, nullptr) << "result is NULL"; \
+     if (ev_result_vis->result) \
+       { ASSERT_TRUE(ev_result_vis->isVisible()) << "Window is invisible"; } \
+   } while (0)
+
 #define ASSERT_ROTATION(TEST_WINDOW, ANGLE) \
    do { \
      ASSERT_NE(TEST_WINDOW, nullptr) << "Window is NULL"; \