bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6f933e01c708341e09ad6803925dc8e04765a418

commit 6f933e01c708341e09ad6803925dc8e04765a418
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Tue Mar 31 12:58:09 2020 -0400

    tests/layout: add explicit test for freeze and thaw no-op correctness
    
    this shouldn't trigger any canvas changes since nothing is happening
    during the freeze
    
    Reviewed-by: Stefan Schmidt <ste...@datenfreihafen.org>
    Differential Revision: https://phab.enlightenment.org/D11631
---
 src/tests/elementary/efl_ui_test_layout.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/tests/elementary/efl_ui_test_layout.c 
b/src/tests/elementary/efl_ui_test_layout.c
index 4d6e7c848b..4e1b117b6c 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -223,6 +223,26 @@ EFL_START_TEST(efl_ui_layout_test_versioning)
 }
 EFL_END_TEST
 
+EFL_START_TEST(efl_ui_layout_test_freeze)
+{
+   Evas_Object *win;
+   int count = 0;
+
+   win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
+   efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 100));
+   Eo *layout = efl_add(EFL_UI_BUTTON_CLASS, win);
+   efl_gfx_entity_size_set(layout, EINA_SIZE2D(100, 100));
+   efl_text_set(layout, "button");
+   get_me_to_those_events(layout);
+
+   efl_event_callback_add(win, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, 
(void*)event_callback_single_call_int_data, &count);
+   efl_layout_calc_freeze(layout);
+   efl_layout_calc_thaw(layout);
+   force_render(win);
+   ck_assert_int_eq(count, 0);
+}
+EFL_END_TEST
+
 void efl_ui_test_layout(TCase *tc)
 {
    tcase_add_test(tc, efl_ui_layout_test_property_bind);
@@ -234,4 +254,5 @@ void efl_ui_test_layout(TCase *tc)
    tcase_add_test(tc, efl_ui_layout_test_callback);
    tcase_add_test(tc, efl_ui_layout_test_property_bind_provider);
    tcase_add_test(tc, efl_ui_layout_test_versioning);
+   tcase_add_test(tc, efl_ui_layout_test_freeze);
 }

-- 


Reply via email to