summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_suite.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-06 16:26:52 +0900
committerHermet Park <hermetpark@gmail.com>2018-08-06 16:26:52 +0900
commite8d40a04b98cc9d86beb4d4501248a0e4014ca33 (patch)
tree4374b8f1a6b14b77650f1bdfc0f7aa3cf22248c7 /src/tests/elementary/elm_suite.c
parent355effed5f53e8df37712d72d80968e4cd2e38c1 (diff)
tests/elm: when using buffer engine, clamp render and edje timing to 0.05s
Summary: this sets manual render on buffer engine windows and dumps the render at every interval in order to avoid doing any real rendering or animating or having to wait on some irrelevant timing. tests using buffer engine just want to complete as fast as possible, as they are never being displayed anywhere, so just perform canvas operations (recalcs mostly) and BAIL Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #committers Tags: #efl_tests Differential Revision: https://phab.enlightenment.org/D6749
Diffstat (limited to 'src/tests/elementary/elm_suite.c')
-rw-r--r--src/tests/elementary/elm_suite.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c
index b05eb64..e97795a 100644
--- a/src/tests/elementary/elm_suite.c
+++ b/src/tests/elementary/elm_suite.c
@@ -9,6 +9,7 @@
9static int main_pid = -1; 9static int main_pid = -1;
10static Eina_Bool did_shutdown; 10static Eina_Bool did_shutdown;
11static Evas_Object *global_win; 11static Evas_Object *global_win;
12static Eina_Bool buffer = EINA_FALSE;
12 13
13static const Efl_Test_Case etc[] = { 14static const Efl_Test_Case etc[] = {
14 { "elm_config", elm_test_config }, 15 { "elm_config", elm_test_config },
@@ -131,6 +132,39 @@ static const Efl_Test_Case etc_init[] = {
131 { NULL, NULL } 132 { NULL, NULL }
132}; 133};
133 134
135#define BUFFER_RENDER_INTERVAL 0.05
136
137static Eina_Bool
138_win_manual_render(void *data)
139{
140 evas_norender(evas_object_evas_get(data));
141 return EINA_TRUE;
142}
143
144static void
145_win_show(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
146{
147 evas_object_data_set(obj, "timer", ecore_timer_add(0.05, _win_manual_render, obj));
148}
149
150static void
151_win_hide(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
152{
153 ecore_timer_del(evas_object_data_del(obj, "timer"));
154}
155
156static Evas_Object *
157_elm_suite_win_create()
158{
159 Evas_Object *win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);
160 if (!buffer) return win;
161 ecore_evas_manual_render_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), EINA_TRUE);
162 edje_frametime_set(0.05);
163 evas_object_event_callback_add(win, EVAS_CALLBACK_SHOW, _win_show, NULL);
164 evas_object_event_callback_add(win, EVAS_CALLBACK_HIDE, _win_hide, NULL);
165 return win;
166}
167
134Evas_Object * 168Evas_Object *
135win_add() 169win_add()
136{ 170{
@@ -138,14 +172,13 @@ win_add()
138 { 172 {
139 if (global_win) return global_win; 173 if (global_win) return global_win;
140 } 174 }
141 return elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC);; 175 return _elm_suite_win_create();
142} 176}
143 177
144int 178int
145main(int argc, char **argv) 179main(int argc, char **argv)
146{ 180{
147 int failed_count; 181 int failed_count;
148 Eina_Bool buffer = EINA_FALSE;
149 182
150 if (!_efl_test_option_disp(argc, argv, etc)) 183 if (!_efl_test_option_disp(argc, argv, etc))
151 return 0; 184 return 0;
@@ -168,7 +201,10 @@ main(int argc, char **argv)
168 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1, 201 failed_count = _efl_suite_build_and_run(argc - 1, (const char **)argv + 1,
169 "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm)); 202 "Elementary_Init", etc_init, SUITE_INIT_FN(elm), SUITE_SHUTDOWN_FN(elm));
170 failed_count += !elm_init(1, (char*[]){"exe"}); 203 failed_count += !elm_init(1, (char*[]){"exe"});
171 if (buffer) global_win = elm_win_add(NULL, "elm_suite", ELM_WIN_BASIC); 204 if (buffer)
205 {
206 global_win = _elm_suite_win_create();
207 }
172 EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255); 208 EINA_SAFETY_ON_TRUE_RETURN_VAL(failed_count, 255);
173 /* preload default theme */ 209 /* preload default theme */
174 failed_count += !elm_theme_group_path_find(NULL, "elm/button/base/default"); 210 failed_count += !elm_theme_group_path_find(NULL, "elm/button/base/default");