--- /dev/null
+#include <check.h>
+#include <Eina.h>
+#include <Ecore.h>
+#include <Ecore_Wayland2.h> // use managed header instead of Ecore_Wl2.h
+#include "utc_ecore_wl2_common.h"
+
+static Eina_Bool startup_status = EINA_FALSE;
+static Ecore_Timer *timer_exit = NULL;
+
+/**
+ * @addtogroup ecore_wl2
+ * @{
+ * @defgroup ecore_wl2_subsurface_window_get ecore_wl2_subsurface_window_get()
+ *
+ * @precondition
+ * @step 1 Initialize Ecore_Wl2 with ecore_wl2_init()
+ */
+static void
+setup(void)
+{
+ printf(" ============ Startup ============ \n");
+ if (ecore_wl2_init())
+ {
+ startup_status = EINA_TRUE;
+ }
+}
+
+static void
+teardown(void)
+{
+ ecore_wl2_shutdown();
+ printf(" ============ Cleanup ============ \n");
+}
+
+static Eina_Bool _timer_cb(void *data)
+{
+ Ecore_Wl2_Subsurface *ss;
+ Ecore_Wl2_Display *ewd = NULL;
+ //Connect the display.
+ ewd = ecore_wl2_display_connect(NULL);
+ if (!ewd)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ goto quit_main_loop;
+ }
+
+ if (CHECK_TV_PROFILE()) ecore_wl2_display_sync(ewd);
+
+ Ecore_Wl2_Window *win = NULL;
+ win = ecore_wl2_window_new(ewd, NULL, 0, 0, 1, 1);
+ if (!win)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ goto quit_main_loop;
+ }
+
+ ss = ecore_wl2_subsurface_new(win);
+ if (!ss)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ goto quit_main_loop;
+ }
+
+ Ecore_Wl2_Window *win2 = NULL;
+ win2 = ecore_wl2_subsurface_window_get(ss);
+ if (!win2)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ goto quit_main_loop;
+ }
+
+ if (win != win2)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ goto quit_main_loop;
+ }
+
+quit_main_loop:
+ ecore_main_loop_quit();
+
+ return ECORE_CALLBACK_DONE;
+}
+
+/**
+ * @addtogroup ecore_wl2_subsurface_window_get
+ * @{
+ * @objective Positive test case checks that the tested function calling without any errors.
+ * @n Input Data: none.
+ *
+ * @procedure
+ * @step 1 Call tested function.
+ *
+ * @passcondition
+ * There is no segmentation fault.
+ * @}
+ */
+START_TEST(utc_ecore_wl2_subsurface_window_get_p)
+{
+ if (startup_status != EINA_TRUE)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (startup was been executed unsuccessfully)..", __FILE__, __LINE__);
+ return;
+ }
+
+ timer_exit = ecore_timer_add(0.2, _timer_cb, NULL);
+ if (!timer_exit)
+ {
+ ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
+ }
+
+ ecore_main_loop_begin();
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ * @addtogroup ecore_wl2_subsurface_window_get
+ * @{
+ * @objective Negative test case checks if function call with invalid value works without segmentation fault
+ * @n Input Data: none.
+ *
+ * @procedure
+ * @step 1 Call ecore_wl2_subsurface_window_get with invalid value instead of the Ecore_Wl2_Subsurface object
+ *
+ * @passcondition
+ * There is no segmentation fault.
+ * @}
+ */
+START_TEST(utc_ecore_wl2_subsurface_window_get_n)
+{
+ Ecore_Wl2_Window *win = NULL;
+ if (startup_status != EINA_TRUE)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (startup was been executed unsuccessfully)..", __FILE__, __LINE__);
+ return;
+ }
+
+ win = ecore_wl2_subsurface_window_get(NULL);
+
+ if (win)
+ {
+ ck_abort_msg("[TEST_FAIL:: %s[%d] : Test has failed (The returned value is wrong)", __FILE__, __LINE__);
+ return;
+ }
+
+ printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
+}
+END_TEST
+
+/**
+ *@}
+ */
+
+TCase * _utc_ecore_wl2_subsurface_window_get()
+{
+ TCase *tcase = tcase_create("utc_ecore_wl2_subsurface_window_get");
+ tcase_set_timeout(tcase, 30);
+ tcase_add_checked_fixture(tcase, setup, teardown);
+ tcase_add_test(tcase, utc_ecore_wl2_subsurface_window_get_p);
+ tcase_add_test(tcase, utc_ecore_wl2_subsurface_window_get_n);
+ return tcase;
+}