summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tests/elementary/efl_ui_test_layout.c40
1 files changed, 40 insertions, 0 deletions
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)
53} 53}
54EFL_END_TEST 54EFL_END_TEST
55 55
56EFL_START_TEST(efl_ui_layout_test_property_bind_provider)
57{
58 char buf[PATH_MAX];
59 Evas_Object *win, *ly;
60 Efl_Generic_Model *model;
61 Efl_Model_Provider *provider;
62 Eina_Value v;
63 Eina_Future *f;
64 const char *part_text;
65 const char text_value[] = "A random string for elm_layout_property_bind test";
66
67 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
68
69 provider = efl_add(EFL_MODEL_PROVIDER_CLASS, win);
70 efl_provider_register(win, EFL_MODEL_PROVIDER_CLASS, provider);
71
72 ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
73 snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
74 efl_file_simple_load(ly, buf, "layout");
75 efl_gfx_entity_visible_set(ly, EINA_TRUE);
76
77 model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
78 ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
79 ck_assert(!!eina_value_set(&v, text_value));
80 f = efl_model_property_set(model, "text_property", &v);
81 eina_future_then(f, _propagated_cb, NULL, NULL);
82
83 efl_ui_property_bind(ly, "text", "text_property");
84 efl_ui_view_model_set(provider, model);
85
86 ecore_main_loop_begin();
87
88 part_text = efl_text_get(efl_part(ly, "text"));
89
90 ck_assert_str_eq(part_text, text_value);
91
92}
93EFL_END_TEST
94
56EFL_START_TEST(efl_ui_layout_test_layout_api_size_min) 95EFL_START_TEST(efl_ui_layout_test_layout_api_size_min)
57{ 96{
58 Evas_Object *win; 97 Evas_Object *win;
@@ -130,4 +169,5 @@ void efl_ui_test_layout(TCase *tc)
130 tcase_add_test(tc, efl_ui_layout_test_layout_force); 169 tcase_add_test(tc, efl_ui_layout_test_layout_force);
131 tcase_add_test(tc, efl_ui_layout_test_layout_theme); 170 tcase_add_test(tc, efl_ui_layout_test_layout_theme);
132 tcase_add_test(tc, efl_ui_layout_test_api_ordering); 171 tcase_add_test(tc, efl_ui_layout_test_api_ordering);
172 tcase_add_test(tc, efl_ui_layout_test_property_bind_provider);
133} 173}