bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=16b662d5d10f1f75e5ab88574371ec87430541b1

commit 16b662d5d10f1f75e5ab88574371ec87430541b1
Author: Cedric BAIL <[email protected]>
Date:   Thu Jul 11 15:03:05 2019 -0700

    elementary: add a test for Efl.Model_provider.
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D9295
---
 src/tests/elementary/efl_ui_test_layout.c | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/tests/elementary/efl_ui_test_layout.c 
b/src/tests/elementary/efl_ui_test_layout.c
index 20581d4ae6..6547f4b850 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -53,6 +53,45 @@ EFL_START_TEST(efl_ui_layout_test_property_bind)
 }
 EFL_END_TEST
 
+EFL_START_TEST(efl_ui_layout_test_property_bind_provider)
+{
+   char buf[PATH_MAX];
+   Evas_Object *win, *ly;
+   Efl_Generic_Model *model;
+   Efl_Model_Provider *provider;
+   Eina_Value v;
+   Eina_Future *f;
+   const char *part_text;
+   const char text_value[] = "A random string for elm_layout_property_bind 
test";
+
+   win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
+
+   provider = efl_add(EFL_MODEL_PROVIDER_CLASS, win);
+   efl_provider_register(win, EFL_MODEL_PROVIDER_CLASS, provider);
+
+   ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
+   snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
+   efl_file_simple_load(ly, buf, "layout");
+   efl_gfx_entity_visible_set(ly, EINA_TRUE);
+
+   model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
+   ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
+   ck_assert(!!eina_value_set(&v, text_value));
+   f = efl_model_property_set(model, "text_property", &v);
+   eina_future_then(f, _propagated_cb, NULL, NULL);
+
+   efl_ui_property_bind(ly, "text", "text_property");
+   efl_ui_view_model_set(provider, model);
+
+   ecore_main_loop_begin();
+
+   part_text = efl_text_get(efl_part(ly, "text"));
+
+   ck_assert_str_eq(part_text, text_value);
+
+}
+EFL_END_TEST
+
 EFL_START_TEST(efl_ui_layout_test_layout_api_size_min)
 {
    Evas_Object *win;
@@ -130,4 +169,5 @@ void efl_ui_test_layout(TCase *tc)
    tcase_add_test(tc, efl_ui_layout_test_layout_force);
    tcase_add_test(tc, efl_ui_layout_test_layout_theme);
    tcase_add_test(tc, efl_ui_layout_test_api_ordering);
+   tcase_add_test(tc, efl_ui_layout_test_property_bind_provider);
 }

-- 


Reply via email to