--- /dev/null
+#include <tzsh_screensaver_manager_service.h>
+#include <tzsh_screensaver_service.h>
+#include "e_test_runner.h"
+
+/* Name:
+ * [0400] scrsaver basic
+ * Description:
+ * Check screensaver type window that is shown on the notification layer.
+ * Steps:
+ * 01. Create an elm basic window
+ * 02. Set elm window to be screensaver type using tzsh
+ * 03. Show window
+ * 04. Check window stack
+ * Expected results:
+ * A window is shown on the notification layer.
+ */
+Eina_Bool
+tc_0400_scrsaver_basic(E_TC *tc)
+{
+ Eina_Bool res = EINA_FALSE;
+ Eina_List *l = NULL, *ll = NULL;
+ E_TC_Win *tw = NULL, *tw2 = NULL;
+ Eina_Bool found = EINA_FALSE;
+
+ tzsh_h tzsh = NULL;
+ tzsh_window tz_win = NULL;
+ tzsh_screensaver_service_h tz_scrsaver = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tc, EINA_FALSE);
+
+ tw = e_tc_win_add(NULL, ELM_WIN_BASIC, EINA_FALSE, NULL,
+ 0, 0, 0, 0, EINA_FALSE,
+ 0, E_TC_WIN_COLOR_RED);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tw, EINA_FALSE);
+
+ tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL);
+ EINA_SAFETY_ON_NULL_GOTO(tzsh, cleanup);
+
+ tz_win = elm_win_window_id_get(tw->elm_win);
+ EINA_SAFETY_ON_FALSE_GOTO(tz_win, cleanup);
+
+ tz_scrsaver = tzsh_screensaver_service_create(tzsh, tz_win);
+ EINA_SAFETY_ON_NULL_GOTO(tz_scrsaver, cleanup);
+
+ res = e_test_runner_req_win_register(tc->runner, tw);
+ EINA_SAFETY_ON_FALSE_GOTO(res, cleanup);
+
+ e_tc_win_geom_update(tw);
+ e_tc_win_show(tw);
+ e_test_runner_ev_wait(tc->runner, E_TC_EVENT_TYPE_VIS_ON);
+
+ l = e_test_runner_req_win_info_list_get(tc->runner);
+ EINA_SAFETY_ON_NULL_GOTO(l, cleanup);
+
+ EINA_LIST_FOREACH(l, ll, tw2)
+ {
+ if (tw2->layer < 650) break;
+
+ if (tw2->native_win == tw->native_win)
+ {
+ found = EINA_TRUE;
+
+ if (tw2->layer == 650)
+ tc->passed = EINA_TRUE;
+ else
+ EINA_SAFETY_ON_FALSE_GOTO(EINA_FALSE, cleanup);
+
+ break;
+ }
+ }
+
+ EINA_SAFETY_ON_FALSE_GOTO(found, cleanup);
+
+cleanup:
+ e_test_runner_req_win_info_list_free(l);
+ e_tc_win_hide(tw);
+ e_test_runner_req_win_deregister(tc->runner, tw);
+ e_tc_win_del(tw);
+
+ tzsh_screensaver_service_destroy(tz_scrsaver);
+ tzsh_destroy(tzsh);
+
+ return tc->passed;
+}
res = eldbus_message_error_get(msg, &name, &text);
EINA_SAFETY_ON_TRUE_GOTO(res, finish);
- res = eldbus_message_arguments_get(msg, "ua(usiiiiibbb)", &target_win, &array);
+ res = eldbus_message_arguments_get(msg, "ua(usiiiiibbbiibbbbb)", &target_win, &array);
EINA_SAFETY_ON_FALSE_GOTO(res, finish);
while (eldbus_message_iter_get_and_next(array, 'r', &ec))
{
- const char *win_name;
- int x, y, w, h, layer;
- Eina_Bool visible, alpha, effect = EINA_FALSE;
- Ecore_Window native_win;
- E_TC_Win *tw = NULL;
-
- res = eldbus_message_iter_arguments_get(ec,
- "usiiiiibbb",
- &native_win,
- &win_name,
- &x,
- &y,
- &w,
- &h,
- &layer,
- &effect,
- &visible,
- &alpha);
-
- if (effect)
- animating = EINA_TRUE;
+ E_TC_Win *tw = e_tc_win_info_add();
+ if (!tw) continue;
+
+ res = eldbus_message_iter_arguments_get
+ (ec,
+ "usiiiiibbbiibbbbb",
+ &tw->native_win,
+ &tw->name,
+ &tw->x, &tw->y, &tw->w, &tw->h,
+ &tw->layer,
+ &tw->effect,
+ &tw->vis.win,
+ &tw->vis.obj,
+ &tw->vis.opaque,
+ &tw->vis.type,
+ &tw->vis.skip,
+ &tw->iconic,
+ &tw->alpha,
+ &tw->focus.win,
+ &tw->focus.obj);
+
+ if (tw->effect)
+ animating = EINA_TRUE;
if (!res)
{
WRN("Failed to get win info\n");
+ e_tc_win_del(tw);
continue;
}
- tw = e_tc_win_info_add(native_win, alpha, effect, win_name, x, y, w, h, layer);
info_list->list = eina_list_append(info_list->list, tw);
}
return list;
}
+void
+e_test_runner_req_win_info_list_free(Eina_List *l)
+{
+ E_TC_Win *tw;
+
+ EINA_SAFETY_ON_NULL_RETURN(l);
+
+ EINA_LIST_FREE(l, tw)
+ e_tc_win_del(tw);
+}
+
Eina_Bool
e_test_runner_ev_wait(E_Test_Runner *runner,
E_TC_Event_Type ev)
elm_run();
}
+void
+e_test_runner_util_win_info_print(E_Test_Runner *runner)
+{
+ E_TC_Win *tw;
+ Eina_List *l, *ll;
+
+ printf("--------------------------------------------------------------------------------------------------------------------------\n");
+ l = e_test_runner_req_win_info_list_get(runner);
+ EINA_LIST_FOREACH(l, ll, tw)
+ {
+ printf("%04d WinID:%5u alpha:%d %5d,%5d (%5dx%5d) vis(Win:%d Obj:%d Opaque:%2d Type:%2d Skip:%d) Icon:%d Focus(Win:%d Obj:%d)\n",
+ tw->layer,
+ tw->native_win,
+ tw->alpha,
+ tw->x, tw->y, tw->w, tw->h,
+ tw->vis.win,
+ tw->vis.obj,
+ tw->vis.opaque,
+ tw->vis.type,
+ tw->vis.skip,
+ tw->iconic,
+ tw->focus.win,
+ tw->focus.obj);
+ }
+ e_test_runner_req_win_info_list_free(l);
+ printf("--------------------------------------------------------------------------------------------------------------------------\n");
+}
+
E_TC_Win *
e_tc_win_add(E_TC_Win *parent,
Elm_Win_Type type,
bg = elm_bg_add(elm_win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(elm_win, bg);
+
switch (color)
{
- case E_TC_WIN_COLOR_BLACK:
- elm_bg_color_set(bg, 0, 0, 0);
- break;
- case E_TC_WIN_COLOR_WHITE:
- elm_bg_color_set(bg, 255, 255, 255);
- break;
- case E_TC_WIN_COLOR_RED:
- elm_bg_color_set(bg, 255, 0, 0);
- break;
- case E_TC_WIN_COLOR_GREEN:
- elm_bg_color_set(bg, 0, 255, 0);
- break;
- case E_TC_WIN_COLOR_BLUE:
- elm_bg_color_set(bg, 0, 0, 255);
- break;
- case E_TC_WIN_COLOR_YELLOW:
- elm_bg_color_set(bg, 255, 255, 0);
- break;
- case E_TC_WIN_COLOR_CYAN:
- elm_bg_color_set(bg, 0, 255, 255);
- break;
- case E_TC_WIN_COLOR_PURPLE:
- elm_bg_color_set(bg, 255, 0, 255);
- break;
- default:
- elm_bg_color_set(bg, 255, 0, 0);
- break;
+ case E_TC_WIN_COLOR_BLACK: elm_bg_color_set(bg, 0, 0, 0); break;
+ case E_TC_WIN_COLOR_WHITE: elm_bg_color_set(bg, 255, 255, 255); break;
+ case E_TC_WIN_COLOR_RED: elm_bg_color_set(bg, 255, 0, 0); break;
+ case E_TC_WIN_COLOR_GREEN: elm_bg_color_set(bg, 0, 255, 0); break;
+ case E_TC_WIN_COLOR_BLUE: elm_bg_color_set(bg, 0, 0, 255); break;
+ case E_TC_WIN_COLOR_YELLOW: elm_bg_color_set(bg, 255, 255, 0); break;
+ case E_TC_WIN_COLOR_CYAN: elm_bg_color_set(bg, 0, 255, 255); break;
+ case E_TC_WIN_COLOR_PURPLE: elm_bg_color_set(bg, 255, 0, 255); break;
+ default: elm_bg_color_set(bg, 255, 0, 0); break;
}
evas_object_show(bg);
tw->name = eina_stringshare_add(name);
if (usr_geom)
{
- tw->x = x;
- tw->y = y;
- tw->w = w;
- tw->h = h;
+ tw->x = x; tw->y = y;
+ tw->w = w; tw->h = h;
}
else
{
- tw->x = 0;
- tw->y = 0;
- tw->w = sw;
- tw->h = sh;
+ tw->x = 0; tw->y = 0;
+ tw->w = sw; tw->h = sh;
}
tw->layer = layer;
tw->alpha = alpha;
}
E_TC_Win *
-e_tc_win_info_add(Ecore_Window native_win,
- Eina_Bool alpha,
- Eina_Bool animating,
- const char *name,
- int x, int y,
- int w, int h,
- int layer)
+e_tc_win_info_add(void)
{
E_TC_Win *tw = NULL;
tw = E_NEW(E_TC_Win, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(tw, NULL);
- tw->elm_win = NULL;
- tw->native_win = native_win;
- tw->name = eina_stringshare_add(name);
- tw->x = x;
- tw->y = y;
- tw->w = w;
- tw->h = h;
- tw->layer = layer;
- tw->alpha = alpha;
- tw->animating = animating;
-
return tw;
}
void
e_tc_win_show(E_TC_Win *tw)
{
+ EINA_SAFETY_ON_NULL_RETURN(tw);
+
evas_object_show(tw->elm_win);
}
void
e_tc_win_hide(E_TC_Win *tw)
{
+ EINA_SAFETY_ON_NULL_RETURN(tw);
+
evas_object_hide(tw->elm_win);
}
TC_ADD( 301, "Noti Level 2", T_FUNC( 301, notification_level_2 ), 1);
TC_ADD( 302, "Noti Level 3", T_FUNC( 302, notification_level_3 ), 1);
TC_ADD( 303, "Noti Level Change", T_FUNC( 303, notification_level_change ), 1);
- /* TODO */
+
+ /* [0400 - 0499] tizen-ws-shell */
+ TC_ADD( 400, "Screensaver: Basic", T_FUNC( 400, scrsaver_basic ), 1);
#undef T_FUNC
}
struct _E_TC_Win
{
- Evas_Object *elm_win; // elm_win evas object
- Ecore_Window native_win; // native window id
- const char *name; // name of client window
- int x, y, w, h; // geometry
- int layer; // value of E_Layer
- int vis; // visibility
- int alpha; // alpha window
- Eina_Bool animating;
+ Evas_Object *elm_win; // elm_win evas object
+ Eina_Bool animating;
+
+ Ecore_Window native_win; // native window id
+ const char *name; // name of client window
+ int x, y, w, h; // geometry
+ int layer; // value of E_Layer
+ Eina_Bool effect;
+ struct
+ {
+ Eina_Bool win;
+ Eina_Bool obj;
+ int opaque;
+ int type;
+ Eina_Bool skip;
+ } vis;
+ Eina_Bool iconic;
+ Eina_Bool alpha;
+ struct
+ {
+ Eina_Bool win;
+ Eina_Bool obj;
+ } focus;
};
struct _E_TC
Eina_Bool e_test_runner_req_win_register(E_Test_Runner *runner, E_TC_Win *tw);
Eina_Bool e_test_runner_req_win_deregister(E_Test_Runner *runner, E_TC_Win *tw);
Eina_List *e_test_runner_req_win_info_list_get(E_Test_Runner *runner);
+void e_test_runner_req_win_info_list_free(Eina_List *l);
Eina_Bool e_test_runner_req_win_stack_set(E_Test_Runner *runner, E_TC_Win *tw, E_TC_Win *sibling, Eina_Bool above);
Eina_Bool e_test_runner_ev_wait(E_Test_Runner *runner, E_TC_Event_Type ev);
E_TC_Win *e_tc_win_add(E_TC_Win *parent, Elm_Win_Type type, Eina_Bool alpha, const char *name, int x, int y, int w, int h, Eina_Bool usr_geom, int layer, E_TC_Win_Color color);
-E_TC_Win *e_tc_win_info_add(Ecore_Window native_win, Eina_Bool alpha, Eina_Bool animating, const char *name, int x, int y, int w, int h, int layer);
+E_TC_Win *e_tc_win_info_add(void);
void e_tc_win_del(E_TC_Win *tw);
void e_tc_win_geom_update(E_TC_Win *tw);
void e_tc_win_show(E_TC_Win *tw);
Eina_Bool e_tc_win_transient_for_set(E_TC_Win *tw_parent, E_TC_Win *tw_child, Eina_Bool set);
void e_test_runner_work(void);
+/* utils */
+void e_test_runner_util_win_info_print(E_Test_Runner *runner);
+
/* test cases */
Eina_Bool tc_0000_base_pass(E_TC *tc);
Eina_Bool tc_0001_base_fail(E_TC *tc);
Eina_Bool tc_0302_notification_level_3(E_TC *tc);
Eina_Bool tc_0303_notification_level_change(E_TC *tc);
+Eina_Bool tc_0400_scrsaver_basic(E_TC *tc);
+
#endif