summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2016-06-22 19:16:10 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2016-07-05 19:40:21 -0300
commit62e0d181a97fbba842e1c29f34333f7c42217b40 (patch)
tree7d08ffc32e3846f4df77df0eae5a36e1d3b8c864
parent83e498d1ab666408882c02940123d7cb5ae6e0d3 (diff)
downloadefl-devs/felipealmeida/model_eina_container.tar.gz
elementary: add test for Elm.Layout model connectdevs/felipealmeida/model_eina_container
-rw-r--r--src/tests/elementary/elm_test_layout.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c
index 6fcb5b43f6..2ce53e402c 100644
--- a/src/tests/elementary/elm_test_layout.c
+++ b/src/tests/elementary/elm_test_layout.c
@@ -87,9 +87,45 @@ START_TEST(elm_layout_edje_attach)
}
END_TEST
+START_TEST(elm_layout_model_connect)
+{
+ char buf[PATH_MAX];
+ Evas_Object *win, *ly;
+ Efl_Model_Item *model;
+ Eina_Value v;
+ const char *part_text;
+ const char text_value[] = "A random string for elm_layout_model_connect test";
+
+ elm_init(1, NULL);
+ win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
+
+ ly = eo_add(ELM_LAYOUT_CLASS, win);
+ snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
+ elm_layout_file_set(ly, buf, "layout");
+ evas_object_show(ly);
+
+ model = eo_add(EFL_MODEL_ITEM_CLASS, win);
+ ck_assert(!!eina_value_setup(&v, EINA_VALUE_TYPE_STRING));
+ ck_assert(!!eina_value_set(&v, text_value));
+ efl_model_property_set(model, "text_property", &v, NULL);
+
+ efl_ui_model_connect(ly, "text", "text_property");
+ efl_ui_view_model_set(ly, model);
+
+ ecore_main_loop_iterate_may_block(EINA_TRUE);
+
+ part_text = elm_layout_text_get(ly, "text");
+
+ ck_assert_str_eq(part_text, text_value);
+
+ elm_shutdown();
+}
+END_TEST
+
void elm_test_layout(TCase *tc)
{
tcase_add_test(tc, elm_atspi_role_get);
tcase_add_test(tc, elm_layout_swallows);
tcase_add_test(tc, elm_layout_edje_attach);
+ tcase_add_test(tc, elm_layout_model_connect);
}