summaryrefslogtreecommitdiff
path: root/src/tests/elementary/suite_helpers.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-06-26 12:23:32 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-27 09:45:10 +0200
commit14ac6a9e9ed761f6d1e975babea77090fc1e422e (patch)
tree54f2386aa2221ea65d4bf55da84ee584ffeccaf6 /src/tests/elementary/suite_helpers.c
parent25c86c88bebf97f270bb782eb77eadf0f804555f (diff)
tests/elm: add helper function for simplifying getting to event triggering
the usual method is calc -> post render -> job to ensure everything is set up. this simplifies getting to that job. Reviewed-by: Chris Michael <cp.michael@samsung.com> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9186
Diffstat (limited to 'src/tests/elementary/suite_helpers.c')
-rw-r--r--src/tests/elementary/suite_helpers.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index e5d43c38b9..6b7ffebc78 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -358,3 +358,28 @@ fail_on_errors_setup(void)
358 eina_log_abort_on_critical_level_set(2); 358 eina_log_abort_on_critical_level_set(2);
359 eina_log_abort_on_critical_set(1); 359 eina_log_abort_on_critical_set(1);
360} 360}
361
362static void
363next_event_job()
364{
365 ecore_main_loop_quit();
366}
367
368static void
369events_norendered(void *data EINA_UNUSED, Evas *e, void *event_info EINA_UNUSED)
370{
371 evas_event_callback_del(e, EVAS_CALLBACK_RENDER_POST, events_norendered);
372 ecore_job_add(next_event_job, NULL);
373}
374
375void
376get_me_to_those_events(Eo *obj)
377{
378 Evas *e = obj;
379
380 if (!efl_isa(obj, EFL_CANVAS_SCENE_INTERFACE))
381 e = evas_object_evas_get(obj);
382 evas_smart_objects_calculate(e);
383 evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, events_norendered, NULL);
384 ecore_main_loop_begin();
385}