tc0300_notification : add testcase for none, high notification level 14/156614/3
authorJunSeok, Kim <juns.kim@samsung.com>
Thu, 19 Oct 2017 06:20:37 +0000 (15:20 +0900)
committerJunSeok, Kim <juns.kim@samsung.com>
Thu, 19 Oct 2017 08:24:16 +0000 (17:24 +0900)
Change-Id: I847a0297dda21e06a16b9e9e03cc38d7d4a73c29

src/.e_test_runner.h.swp [new file with mode: 0644]
src/0300_notification.c
src/e_test_runner.c
src/e_test_runner.h

diff --git a/src/.e_test_runner.h.swp b/src/.e_test_runner.h.swp
new file mode 100644 (file)
index 0000000..5bdd713
Binary files /dev/null and b/src/.e_test_runner.h.swp differ
index aefa7f8..ffac16a 100644 (file)
@@ -153,6 +153,35 @@ failed:
    return EINA_FALSE;
 }
 
+static Eina_Bool
+_tc_check_layer(E_TC *tc, E_TC_Win *win, E_Layer expected)
+{
+   Eina_List *list = NULL, *l = NULL;
+   int layer = 0;
+   E_TC_Win *tw = NULL;
+   Eina_Bool result = EINA_FALSE;
+
+   list = e_test_runner_req_win_info_list_get(tc->runner);
+   EINA_SAFETY_ON_NULL_GOTO(list, failed);
+
+   EINA_LIST_FOREACH(list, l, tw)
+     {
+        if (tw->native_win == win->native_win)
+          {
+             layer = tw->layer;
+             break;
+          }
+     }
+
+   EINA_SAFETY_ON_FALSE_GOTO(layer == expected, failed);
+
+   result = EINA_TRUE;
+
+failed:
+   E_FREE_LIST(list, e_tc_win_del);
+   return result;
+}
+
 Eina_Bool
 tc_0300_notification_level_default(E_TC *tc)
 {
@@ -210,7 +239,35 @@ cleanup:
 }
 
 Eina_Bool
-tc_0302_notification_level_top(E_TC *tc)
+tc_0302_notification_level_high(E_TC *tc)
+{
+   Eina_Bool res = EINA_FALSE;
+   E_TC_Data *data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(tc, EINA_FALSE);
+
+   res = _tc_pre_run(tc, EINA_TRUE);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+   data = tc->data;
+
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_check(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+cleanup:
+   _tc_post_run(tc);
+   _tc_shutdown(tc);
+
+   return res;
+}
+
+Eina_Bool
+tc_0303_notification_level_top(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -238,7 +295,7 @@ cleanup:
 }
 
 Eina_Bool
-tc_0303_notification_level_change(E_TC *tc)
+tc_0304_notification_level_none(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -249,18 +306,61 @@ tc_0303_notification_level_change(E_TC *tc)
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
    data = tc->data;
 
-   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
-   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM);
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_NONE);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
    res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
+   res = _tc_check_layer(tc, data->tw_noti2, E_LAYER_CLIENT_NORMAL);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+cleanup:
+   _tc_post_run(tc);
+   _tc_shutdown(tc);
+
+   return res;
+}
+
+Eina_Bool
+tc_0305_notification_level_change(E_TC *tc)
+{
+   Eina_Bool res = EINA_FALSE;
+   E_TC_Data *data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(tc, EINA_FALSE);
+
+   res = _tc_pre_run(tc, EINA_TRUE);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+   data = tc->data;
+
    res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
    res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
@@ -272,7 +372,7 @@ cleanup:
 }
 
 Eina_Bool
-tc_0304_notification_fullsize_level_default(E_TC *tc)
+tc_0306_notification_fullsize_level_default(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -300,7 +400,7 @@ cleanup:
 }
 
 Eina_Bool
-tc_0305_notification_fullsize_level_medium(E_TC *tc)
+tc_0307_notification_fullsize_level_medium(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -328,7 +428,35 @@ cleanup:
 }
 
 Eina_Bool
-tc_0306_notification_fullsize_level_top(E_TC *tc)
+tc_0308_notification_fullsize_level_high(E_TC *tc)
+{
+   Eina_Bool res = EINA_FALSE;
+   E_TC_Data *data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(tc, EINA_FALSE);
+
+   res = _tc_pre_run(tc, EINA_FALSE);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+   data = tc->data;
+
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_check(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+cleanup:
+   _tc_post_run(tc);
+   _tc_shutdown(tc);
+
+   return res;
+}
+
+Eina_Bool
+tc_0309_notification_fullsize_level_top(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -356,7 +484,7 @@ cleanup:
 }
 
 Eina_Bool
-tc_0307_notification_fullsize_level_change(E_TC *tc)
+tc_0310_notification_fullsize_level_none(E_TC *tc)
 {
    Eina_Bool res = EINA_FALSE;
    E_TC_Data *data;
@@ -367,18 +495,61 @@ tc_0307_notification_fullsize_level_change(E_TC *tc)
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
    data = tc->data;
 
-   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
-   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM);
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_NONE);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
    res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
+   res = _tc_check_layer(tc, data->tw_noti2, E_LAYER_CLIENT_NORMAL);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+cleanup:
+   _tc_post_run(tc);
+   _tc_shutdown(tc);
+
+   return res;
+}
+
+Eina_Bool
+tc_0311_notification_fullsize_level_change(E_TC *tc)
+{
+   Eina_Bool res = EINA_FALSE;
+   E_TC_Data *data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(tc, EINA_FALSE);
+
+   res = _tc_pre_run(tc, EINA_FALSE);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+   data = tc->data;
+
    res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti1, EFL_UTIL_NOTIFICATION_LEVEL_HIGH);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_check_stack(tc, data->tw_normal, data->tw_noti2, data->tw_noti1);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+   res = _tc_noti_level_set(data->tw_noti2, EFL_UTIL_NOTIFICATION_LEVEL_TOP);
+   EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
    res = _tc_check_stack(tc, data->tw_normal, data->tw_noti1, data->tw_noti2);
    EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
 
index 899ea50..2b34025 100644 (file)
@@ -1039,13 +1039,17 @@ _e_test_runner_init(E_Test_Runner *runner,
    /* [0300 - 0399] notification */
    TC_ADD( 300, "Noti Level default",           T_FUNC( 300, notification_level_default), 1);
    TC_ADD( 301, "Noti Level medium",            T_FUNC( 301, notification_level_medium ), 1);
-   TC_ADD( 302, "Noti Level top",               T_FUNC( 302, notification_level_top    ), 1);
-   TC_ADD( 303, "Noti Level Change",            T_FUNC( 303, notification_level_change ), 1);
-
-   TC_ADD( 304, "Fullsize Noti Level default",  T_FUNC( 304, notification_fullsize_level_default), 1);
-   TC_ADD( 305, "Fullsize Noti Level medium",   T_FUNC( 305, notification_fullsize_level_medium ), 1);
-   TC_ADD( 306, "Fullsize Noti Level top",      T_FUNC( 306, notification_fullsize_level_top    ), 1);
-   TC_ADD( 307, "Fullsize Noti Level Change",   T_FUNC( 307, notification_fullsize_level_change ), 1);
+   TC_ADD( 302, "Noti Level high",              T_FUNC( 302, notification_level_high   ), 1);
+   TC_ADD( 303, "Noti Level top",               T_FUNC( 303, notification_level_top    ), 1);
+   TC_ADD( 304, "Noti Level none",              T_FUNC( 304, notification_level_none   ), 1);
+   TC_ADD( 305, "Noti Level Change",            T_FUNC( 305, notification_level_change ), 1);
+
+   TC_ADD( 306, "Fullsize Noti Level default",  T_FUNC( 306, notification_fullsize_level_default), 1);
+   TC_ADD( 307, "Fullsize Noti Level medium",   T_FUNC( 307, notification_fullsize_level_medium ), 1);
+   TC_ADD( 308, "Fullsize Noti Level high",     T_FUNC( 308, notification_fullsize_level_high   ), 1);
+   TC_ADD( 309, "Fullsize Noti Level top",      T_FUNC( 309, notification_fullsize_level_top    ), 1);
+   TC_ADD( 310, "Fullsize Noti Level none",     T_FUNC( 310, notification_fullsize_level_none   ), 1);
+   TC_ADD( 311, "Fullsize Noti Level Change",   T_FUNC( 311, notification_fullsize_level_change ), 1);
 
    /* [0400 - 0499] tizen-ws-shell */
    TC_ADD( 400, "Screensaver: Basic",           T_FUNC( 400, scrsaver_basic            ), 1);
index f021071..9d0d735 100644 (file)
@@ -280,12 +280,16 @@ Eina_Bool  tc_0204_transient_for_stack_below(E_TC *tc);
 
 Eina_Bool  tc_0300_notification_level_default(E_TC *tc);
 Eina_Bool  tc_0301_notification_level_medium(E_TC *tc);
-Eina_Bool  tc_0302_notification_level_top(E_TC *tc);
-Eina_Bool  tc_0303_notification_level_change(E_TC *tc);
-Eina_Bool  tc_0304_notification_fullsize_level_default(E_TC *tc);
-Eina_Bool  tc_0305_notification_fullsize_level_medium(E_TC *tc);
-Eina_Bool  tc_0306_notification_fullsize_level_top(E_TC *tc);
-Eina_Bool  tc_0307_notification_fullsize_level_change(E_TC *tc);
+Eina_Bool  tc_0302_notification_level_high(E_TC *tc);
+Eina_Bool  tc_0303_notification_level_top(E_TC *tc);
+Eina_Bool  tc_0304_notification_level_none(E_TC *tc);
+Eina_Bool  tc_0305_notification_level_change(E_TC *tc);
+Eina_Bool  tc_0306_notification_fullsize_level_default(E_TC *tc);
+Eina_Bool  tc_0307_notification_fullsize_level_medium(E_TC *tc);
+Eina_Bool  tc_0308_notification_fullsize_level_high(E_TC *tc);
+Eina_Bool  tc_0309_notification_fullsize_level_top(E_TC *tc);
+Eina_Bool  tc_0310_notification_fullsize_level_none(E_TC *tc);
+Eina_Bool  tc_0311_notification_fullsize_level_change(E_TC *tc);
 
 Eina_Bool  tc_0400_scrsaver_basic(E_TC *tc);
 Eina_Bool  tc_0401_scrsaver_mng_basic(E_TC *tc);