summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_test_win.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-01-31 11:54:54 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-01-31 11:54:54 -0500
commit9b129b5c7a9b74b2261066b55037c7891f10c12d (patch)
tree9a3607f78d549557e0a1add9c937543c2dab1f01 /src/tests/elementary/elm_test_win.c
parenta6c3be13515e43287060080eabd792081466f62a (diff)
efl_ui_win: add 'exit_on_all_windows_closed' class property and unit test
Summary: this property causes the main loop to exit with the passed exit code when the standby event is triggered @feature ref T5494 Reviewers: cedric, bu5hm4n, segfaultxavi Reviewed By: cedric, bu5hm4n, segfaultxavi Subscribers: segfaultxavi, bu5hm4n, #reviewers, #committers Tags: #efl Maniphest Tasks: T5494 Differential Revision: https://phab.enlightenment.org/D7594
Diffstat (limited to '')
-rw-r--r--src/tests/elementary/elm_test_win.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c
index 207e777d57..2b0ec55b2c 100644
--- a/src/tests/elementary/elm_test_win.c
+++ b/src/tests/elementary/elm_test_win.c
@@ -40,6 +40,14 @@ _timer_delete_request_cb(void *data)
40} 40}
41 41
42static Eina_Bool 42static Eina_Bool
43_timer_del_window_cb(void *data)
44{
45 Eo *win = (Eo*) data;
46 evas_object_del(win);
47 return EINA_FALSE;
48}
49
50static Eina_Bool
43_timer_hide_window_cb(void *data) 51_timer_hide_window_cb(void *data)
44{ 52{
45 Eo *win = (Eo*) data; 53 Eo *win = (Eo*) data;
@@ -154,6 +162,29 @@ EFL_START_TEST(elm_win_autohide)
154} 162}
155EFL_END_TEST 163EFL_END_TEST
156 164
165EFL_START_TEST (elm_win_test_app_exit_on_windows_close)
166{
167 Eo *win = win_add(NULL, "win", ELM_WIN_BASIC);
168 Eo *app = efl_app_main_get(EFL_APP_CLASS);
169 Eina_Value val, *exit_val;
170 int code;
171
172 val = eina_value_int_init(66);
173 efl_ui_win_exit_on_all_windows_closed_set(win, &val);
174 efl_gfx_entity_visible_set(win, EINA_TRUE);
175
176 Eina_Bool fail_flag = EINA_FALSE;
177 ecore_timer_add(_timeout1, _timer_del_window_cb, win);
178 ecore_timer_add(_timeout_fail, _timer_fail_flag_cb, &fail_flag);
179
180 exit_val = efl_loop_begin(efl_loop_get(win));
181 ck_assert(eina_value_int_get(exit_val, &code));
182 ck_assert_int_eq(code, 66);
183 efl_ui_win_exit_on_all_windows_closed_set(app, &EINA_VALUE_EMPTY);
184}
185EFL_END_TEST
186
187
157EFL_START_TEST(elm_win_policy_quit_last_window_hidden) 188EFL_START_TEST(elm_win_policy_quit_last_window_hidden)
158{ 189{
159 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); 190 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
@@ -405,6 +436,7 @@ void elm_test_win(TCase *tc)
405 tcase_add_test(tc, elm_atspi_role_get); 436 tcase_add_test(tc, elm_atspi_role_get);
406 tcase_add_test(tc, elm_atspi_component_screen_position); 437 tcase_add_test(tc, elm_atspi_component_screen_position);
407 tcase_add_test(tc, elm_win_policy_quit_last_window_hidden); 438 tcase_add_test(tc, elm_win_policy_quit_last_window_hidden);
439 tcase_add_test(tc, elm_win_test_app_exit_on_windows_close);
408 tcase_add_test(tc, efl_ui_win_multi_touch_inputs); 440 tcase_add_test(tc, efl_ui_win_multi_touch_inputs);
409#ifdef HAVE_ELEMENTARY_X 441#ifdef HAVE_ELEMENTARY_X
410 tcase_add_test(tc, elm_win_autohide); 442 tcase_add_test(tc, elm_win_autohide);