0012_aux_hint: added aux hint testcases 45/256845/2
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 14 Apr 2021 02:09:22 +0000 (11:09 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Wed, 14 Apr 2021 03:35:47 +0000 (12:35 +0900)
Added aux hint testcases
It tests below APIs
 - ecore_wl2_window_aux_hint_add
 - ecore_wl2_window_aux_hint_change
 - ecore_wl2_window_aux_hint_del

Change-Id: Ied1494e5db37e4cc867414e084daf2ae8880bd6c

src/Makefile.am
src/testcase/0012_aux_hint.cpp [new file with mode: 0644]

index 22619e7..1548419 100644 (file)
@@ -20,7 +20,8 @@ testcase/0007_rotation.cpp \
 testcase/0008_focus.cpp \
 testcase/0009_input.cpp \
 testcase/0010_splash.cpp \
-testcase/0011_effect.cpp
+testcase/0011_effect.cpp \
+testcase/0012_aux_hint.cpp
 
 e_tizen_unittests_SOURCES = \
 e_test_main.cpp \
diff --git a/src/testcase/0012_aux_hint.cpp b/src/testcase/0012_aux_hint.cpp
new file mode 100644 (file)
index 0000000..0160710
--- /dev/null
@@ -0,0 +1,90 @@
+#include "e_test_event.h"
+#include "e_test_base.h"
+
+static int test_hint_id = 486;
+
+class etTestAuxHint : public ::etTCBase
+{
+ public:
+    etTestAuxHint()
+      {
+         etRunner::get().addSupportedAuxHint("win.test.auxhint");
+      };
+    ~etTestAuxHint()
+      {
+         etRunner::get().delSupportedAuxHint("win.test.auxhint");
+      };
+
+ protected:
+    etWin *tw = NULL;
+
+    void initTC();
+};
+
+void
+etTestAuxHint::initTC()
+{
+   tw = initNormalWin("TCWin_Normal", EINA_TRUE);
+   ASSERT_TRUE(tw != NULL) << "failed to initiation window";
+   ASSERT_TRUE(showTCWin(tw)) << "failed to show window";
+}
+
+TEST_F(etTestAuxHint, add_hint)
+{
+   std::shared_ptr<auxHintEventItem> data = NULL;
+   Eina_Bool ret = EINA_FALSE;
+
+   initTC();
+   etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON);
+
+   ret = etRunner::get().addAuxHint(tw, test_hint_id, "win.test.auxhint", "test");
+   ASSERT_TRUE(ret);
+   data = std::static_pointer_cast<auxHintEventItem>(etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED));
+   ASSERT_TRUE(data != NULL);
+   ASSERT_TRUE(data->isSameHint(std::string("win.test.auxhint"))) << "Err: " << data->getHint();
+   ASSERT_TRUE(data->isSameVal(std::string("test"))) << "Err: " << data->getVal();
+}
+
+TEST_F(etTestAuxHint, change_hint)
+{
+   std::shared_ptr<auxHintEventItem> data = NULL;
+   Eina_Bool ret = EINA_FALSE;
+
+   initTC();
+   etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON);
+
+   ret = etRunner::get().addAuxHint(tw, test_hint_id, "win.test.auxhint", "test");
+   ASSERT_TRUE(ret);
+   data = std::static_pointer_cast<auxHintEventItem>(etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED));
+   ASSERT_TRUE(data != NULL);
+   ASSERT_TRUE(data->isSameHint(std::string("win.test.auxhint"))) << "Err: " << data->getHint();
+   ASSERT_TRUE(data->isSameVal(std::string("test"))) << "Err: " << data->getVal();
+
+   ret = etRunner::get().changeAuxHint(tw, test_hint_id, "test2");
+   ASSERT_TRUE(ret);
+   data = std::static_pointer_cast<auxHintEventItem>(etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED));
+   ASSERT_TRUE(data != NULL);
+   ASSERT_TRUE(data->isSameHint(std::string("win.test.auxhint"))) << "Err: " << data->getHint();
+   ASSERT_TRUE(data->isSameVal(std::string("test2"))) << "Err: " << data->getVal();
+}
+
+TEST_F(etTestAuxHint, del_hint)
+{
+   std::shared_ptr<auxHintEventItem> data = NULL;
+   Eina_Bool ret = EINA_FALSE;
+
+   initTC();
+   etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_VIS_ON);
+
+   ret = etRunner::get().addAuxHint(tw, test_hint_id, "win.test.auxhint", "test");
+   ASSERT_TRUE(ret);
+   data = std::static_pointer_cast<auxHintEventItem>(etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED));
+   ASSERT_TRUE(data != NULL);
+   ASSERT_TRUE(data->isSameHint(std::string("win.test.auxhint"))) << "Err: " << data->getHint();
+   ASSERT_TRUE(data->isSameVal(std::string("test"))) << "Err: " << data->getVal();
+
+   ret = etRunner::get().delAuxHint(tw, test_hint_id);
+   ASSERT_TRUE(ret);
+   etRunner::get().waitEvent(tw, E_TC_EVENT_TYPE_AUX_HINT_CHANGED);
+}
+