diff options
author | Lukasz Stanislawski <lukasz.stanislawski@gmail.com> | 2017-10-19 10:13:54 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-10-19 10:13:54 +0900 |
commit | 57aefc53c18c14ada19dcd09d3e5b5612b277b16 (patch) | |
tree | 897745eb7c2d9ccbbde1bc0cf4dd2971c2e625f4 /src/tests/elementary/elm_test_atspi.c | |
parent | 98622623a0865c525ede12ef5759ab6f5b3af407 (diff) | |
download | efl-57aefc53c18c14ada19dcd09d3e5b5612b277b16.tar.gz |
elm: rename Elm_Interface_Atspi_Accessible interface
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5341
Diffstat (limited to 'src/tests/elementary/elm_test_atspi.c')
-rw-r--r-- | src/tests/elementary/elm_test_atspi.c | 234 |
1 files changed, 116 insertions, 118 deletions
diff --git a/src/tests/elementary/elm_test_atspi.c b/src/tests/elementary/elm_test_atspi.c index 8f9e043870..1875fb24fc 100644 --- a/src/tests/elementary/elm_test_atspi.c +++ b/src/tests/elementary/elm_test_atspi.c @@ -3,7 +3,7 @@ #endif #define ELM_INTERNAL_API_ARGESFSDFEFC -#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED +#define EFL_ACCESS_PROTECTED #include <Elementary.h> #include "elm_priv.h" @@ -25,7 +25,7 @@ void generate_app(void) evas_object_show(g_win); } -START_TEST (elm_atspi_app_obj_name_get) +START_TEST (test_efl_access_app_obj_name_get) { elm_init(0, NULL); @@ -37,7 +37,7 @@ START_TEST (elm_atspi_app_obj_name_get) elm_app_name_set("Test name"); - ret = elm_interface_atspi_accessible_name_get(root); + ret = efl_access_name_get(root); ck_assert_str_eq(ret, "Test name"); @@ -46,14 +46,14 @@ START_TEST (elm_atspi_app_obj_name_get) } END_TEST -START_TEST (elm_atspi_name_get) +START_TEST (test_efl_access_name_get) { elm_init(0, NULL); generate_app(); const char *name; - name = elm_interface_atspi_accessible_name_get(g_btn); + name = efl_access_name_get(g_btn); if (name && name[0]) { ck_assert(0); @@ -62,7 +62,7 @@ START_TEST (elm_atspi_name_get) // Set name with additional text tags elm_object_text_set(g_btn, "Some<br>text"); - name = elm_interface_atspi_accessible_name_get(g_btn); + name = efl_access_name_get(g_btn); // Accessible name should have cleared tags ck_assert(name != NULL); @@ -72,7 +72,7 @@ START_TEST (elm_atspi_name_get) } END_TEST -START_TEST (elm_atspi_name_set) +START_TEST (test_efl_access_name_set) { elm_init(0, NULL); generate_app(); @@ -80,15 +80,15 @@ START_TEST (elm_atspi_name_set) const char *name; elm_object_text_set(g_btn, "Other text"); - elm_interface_atspi_accessible_name_set(g_btn, "Test name"); + efl_access_name_set(g_btn, "Test name"); - name = elm_interface_atspi_accessible_name_get(g_btn); + name = efl_access_name_get(g_btn); ck_assert(name != NULL); ck_assert_str_eq(name, "Test name"); - elm_interface_atspi_accessible_name_set(g_btn, NULL); - name = elm_interface_atspi_accessible_name_get(g_btn); + efl_access_name_set(g_btn, NULL); + name = efl_access_name_get(g_btn); ck_assert(name != NULL); ck_assert_str_eq(name, "Other text"); @@ -97,48 +97,46 @@ START_TEST (elm_atspi_name_set) } END_TEST -START_TEST (elm_atspi_role_get) +START_TEST (test_efl_access_role_get) { elm_init(0, NULL); Eo* root = efl_add(ELM_ATSPI_APP_OBJECT_CLASS, NULL); - Elm_Atspi_Role role; + Efl_Access_Role role; - role = elm_interface_atspi_accessible_role_get(root); + role = efl_access_role_get(root); - ck_assert(role == ELM_ATSPI_ROLE_APPLICATION); + ck_assert(role == EFL_ACCESS_ROLE_APPLICATION); efl_unref(root); elm_shutdown(); } END_TEST -START_TEST (elm_atspi_role_set) +START_TEST (test_efl_access_role_set) { elm_init(0, NULL); generate_app(); - Elm_Atspi_Role role; + Efl_Access_Role role; - elm_interface_atspi_accessible_role_set(g_btn, ELM_ATSPI_ROLE_ACCELERATOR_LABEL); - role = elm_interface_atspi_accessible_role_get(g_btn); + efl_access_role_set(g_btn, EFL_ACCESS_ROLE_ACCELERATOR_LABEL); + role = efl_access_role_get(g_btn); - if (role != ELM_ATSPI_ROLE_ACCELERATOR_LABEL) + if (role != EFL_ACCESS_ROLE_ACCELERATOR_LABEL) ck_assert(0); - elm_interface_atspi_accessible_role_set(g_btn, ELM_ATSPI_ROLE_ENTRY); - role = elm_interface_atspi_accessible_role_get(g_btn); + efl_access_role_set(g_btn, EFL_ACCESS_ROLE_ENTRY); + role = efl_access_role_get(g_btn); - if (role != ELM_ATSPI_ROLE_ENTRY) + if (role != EFL_ACCESS_ROLE_ENTRY) ck_assert(0); elm_shutdown(); } END_TEST - - -START_TEST (elm_atspi_role_name_get) +START_TEST (test_efl_access_role_name_get) { elm_init(0, NULL); @@ -146,7 +144,7 @@ START_TEST (elm_atspi_role_name_get) const char *ret = NULL; - ret = elm_interface_atspi_accessible_role_name_get(root); + ret = efl_access_role_name_get(root); ck_assert(ret != NULL); @@ -155,7 +153,7 @@ START_TEST (elm_atspi_role_name_get) } END_TEST -START_TEST (elm_atspi_localized_role_name_get) +START_TEST (test_efl_access_localized_role_name_get) { elm_init(0, NULL); @@ -163,7 +161,7 @@ START_TEST (elm_atspi_localized_role_name_get) const char *ret = NULL; - ret = elm_interface_atspi_accessible_localized_role_name_get(root); + ret = efl_access_localized_role_name_get(root); ck_assert(ret != NULL); @@ -172,7 +170,7 @@ START_TEST (elm_atspi_localized_role_name_get) } END_TEST -START_TEST (elm_atspi_description_set) +START_TEST (test_efl_access_description_set) { elm_init(0, NULL); @@ -182,18 +180,18 @@ START_TEST (elm_atspi_description_set) const char *desc = "Test description"; - ret = elm_interface_atspi_accessible_description_get(root); + ret = efl_access_description_get(root); ck_assert(ret == NULL); - elm_interface_atspi_accessible_description_set(root, desc); - ret = elm_interface_atspi_accessible_description_get(root); + efl_access_description_set(root, desc); + ret = efl_access_description_get(root); ck_assert(ret != NULL); ck_assert_str_eq(ret, "Test description"); - elm_interface_atspi_accessible_description_set(root, NULL); - ret = elm_interface_atspi_accessible_description_get(root); + efl_access_description_set(root, NULL); + ret = efl_access_description_get(root); ck_assert(ret == NULL); @@ -203,13 +201,13 @@ START_TEST (elm_atspi_description_set) END_TEST /* Test if initial description value is NULL */ -START_TEST (elm_atspi_description_get) +START_TEST (test_efl_access_description_get) { elm_init(0, NULL); generate_app(); const char *descr; - descr = elm_interface_atspi_accessible_description_get(g_bg); + descr = efl_access_description_get(g_bg); ck_assert(descr == NULL); @@ -217,7 +215,7 @@ START_TEST (elm_atspi_description_get) } END_TEST -START_TEST (elm_atspi_children_and_parent) +START_TEST (test_efl_access_children_and_parent) { elm_init(0, NULL); @@ -226,9 +224,9 @@ START_TEST (elm_atspi_children_and_parent) Eina_List *child_list = NULL; - child_list = elm_interface_atspi_accessible_children_get(root); + child_list = efl_access_children_get(root); - //bg_child_list = elm_interface_atspi_accessible_children_get(eina_list_nth(child_list, 0)); + //bg_child_list = efl_access_children_get(eina_list_nth(child_list, 0)); ck_assert(eina_list_count(child_list) == 1); @@ -244,7 +242,7 @@ START_TEST (elm_atspi_children_and_parent) } END_TEST -START_TEST (elm_atspi_children_and_parent2) +START_TEST (test_efl_access_children_and_parent2) { elm_init(0, NULL); @@ -254,11 +252,11 @@ START_TEST (elm_atspi_children_and_parent2) Eo *win = NULL; Eina_List *root_children; - root_children = elm_interface_atspi_accessible_children_get(root); + root_children = efl_access_children_get(root); win = eina_list_nth(root_children, 0); Eina_List *win_children; - win_children = elm_interface_atspi_accessible_children_get(win); + win_children = efl_access_children_get(win); ck_assert(eina_list_count(win_children) == 1); @@ -274,14 +272,14 @@ START_TEST (elm_atspi_children_and_parent2) END_TEST /* Initial value of translation domain should be NULL */ -START_TEST (elm_atspi_translation_domain_get) +START_TEST (test_efl_access_translation_domain_get) { elm_init(0, NULL); generate_app(); const char *domain; - domain = elm_interface_atspi_accessible_translation_domain_get(g_btn); + domain = efl_access_translation_domain_get(g_btn); ck_assert(domain == NULL); @@ -289,21 +287,21 @@ START_TEST (elm_atspi_translation_domain_get) } END_TEST -START_TEST (elm_atspi_translation_domain_set) +START_TEST (test_efl_access_translation_domain_set) { elm_init(0, NULL); generate_app(); const char *domain; - elm_interface_atspi_accessible_translation_domain_set(g_btn, "Test translation_domain"); - domain = elm_interface_atspi_accessible_translation_domain_get(g_btn); + efl_access_translation_domain_set(g_btn, "Test translation_domain"); + domain = efl_access_translation_domain_get(g_btn); ck_assert(domain != NULL); ck_assert_str_eq(domain, "Test translation_domain"); - elm_interface_atspi_accessible_translation_domain_set(g_btn, NULL); - domain = elm_interface_atspi_accessible_translation_domain_get(g_btn); + efl_access_translation_domain_set(g_btn, NULL); + domain = efl_access_translation_domain_get(g_btn); ck_assert(domain == NULL); @@ -311,18 +309,18 @@ START_TEST (elm_atspi_translation_domain_set) } END_TEST -START_TEST (elm_atspi_relationship_append) +START_TEST (test_efl_access_relationship_append) { elm_init(0, NULL); generate_app(); - Elm_Atspi_Relation_Set set; - Elm_Atspi_Relation *rel, *rel_to, *rel_from; + Efl_Access_Relation_Set set; + Efl_Access_Relation *rel, *rel_to, *rel_from; Eina_List *l; - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_win); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); + set = efl_access_relation_set_get(g_btn); ck_assert(set != NULL); ck_assert(eina_list_count(set) >= 2); @@ -330,9 +328,9 @@ START_TEST (elm_atspi_relationship_append) rel_to = rel_from = NULL; EINA_LIST_FOREACH(set, l, rel) { - if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) rel_to = rel; - if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) rel_from = rel; } @@ -342,19 +340,19 @@ START_TEST (elm_atspi_relationship_append) ck_assert(rel_from != NULL); ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL); - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); /* Check if append do not procude duplicated relations */ - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_win); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); + set = efl_access_relation_set_get(g_btn); rel_to = rel_from = NULL; EINA_LIST_FOREACH(set, l, rel) { - if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) rel_to = rel; - if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) rel_from = rel; } @@ -368,26 +366,26 @@ START_TEST (elm_atspi_relationship_append) rel_from->objects = eina_list_remove(rel_from->objects, g_win); ck_assert(eina_list_data_find(rel_from->objects, g_win) == NULL); - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); elm_shutdown(); } END_TEST -START_TEST (elm_atspi_relationship_remove) +START_TEST (test_efl_access_relationship_remove) { elm_init(0, NULL); generate_app(); - Elm_Atspi_Relation_Set set; - Elm_Atspi_Relation *rel, *rel_to, *rel_from; + Efl_Access_Relation_Set set; + Efl_Access_Relation *rel, *rel_to, *rel_from; Eina_List *l; /* Test if removal of single relationship works */ - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_win); - elm_interface_atspi_accessible_relationship_remove(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); + efl_access_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + set = efl_access_relation_set_get(g_btn); ck_assert(set != NULL); ck_assert(eina_list_count(set) >= 1); @@ -395,9 +393,9 @@ START_TEST (elm_atspi_relationship_remove) rel_to = rel_from = NULL; EINA_LIST_FOREACH(set, l, rel) { - if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) rel_to = rel; - if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) rel_from = rel; } @@ -405,20 +403,20 @@ START_TEST (elm_atspi_relationship_remove) ck_assert(rel_from != NULL); ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL); - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); /* Test if removal of type relationship works */ - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_win); - elm_interface_atspi_accessible_relationship_remove(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, NULL); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); + efl_access_relationship_remove(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, NULL); + set = efl_access_relation_set_get(g_btn); rel_to = rel_from = NULL; EINA_LIST_FOREACH(set, l, rel) { - if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) rel_to = rel; - if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) rel_from = rel; } @@ -426,77 +424,77 @@ START_TEST (elm_atspi_relationship_remove) ck_assert(rel_from != NULL); ck_assert(eina_list_data_find(rel_from->objects, g_win) != NULL); - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); /* Test if relationship is implicity removed when object is deleted */ - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); efl_del(g_bg); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + set = efl_access_relation_set_get(g_btn); rel_to = rel_from = NULL; EINA_LIST_FOREACH(set, l, rel) { - if (rel->type == ELM_ATSPI_RELATION_FLOWS_TO) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_TO) rel_to = rel; - if (rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) + if (rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) rel_from = rel; } if (rel_to) ck_assert(eina_list_data_find(rel_to->objects, g_bg) == NULL); if (rel_from) ck_assert(eina_list_data_find(rel_from->objects, g_bg) == NULL); - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); elm_shutdown(); } END_TEST -START_TEST (elm_atspi_relationships_clear) +START_TEST (test_efl_access_relationships_clear) { - Elm_Atspi_Relation_Set set; - Elm_Atspi_Relation *rel; + Efl_Access_Relation_Set set; + Efl_Access_Relation *rel; Eina_List *l; elm_init(0, NULL); generate_app(); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_bg); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_TO, g_win); - elm_interface_atspi_accessible_relationship_append(g_btn, ELM_ATSPI_RELATION_FLOWS_FROM, g_win); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_bg); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_TO, g_win); + efl_access_relationship_append(g_btn, EFL_ACCESS_RELATION_FLOWS_FROM, g_win); - elm_interface_atspi_accessible_relationships_clear(g_btn); + efl_access_relationships_clear(g_btn); - set = elm_interface_atspi_accessible_relation_set_get(g_btn); + set = efl_access_relation_set_get(g_btn); EINA_LIST_FOREACH(set, l, rel) { - ck_assert(!((rel->type == ELM_ATSPI_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); - ck_assert(!((rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); - ck_assert(!((rel->type == ELM_ATSPI_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); - ck_assert(!((rel->type == ELM_ATSPI_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_bg))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_TO) && eina_list_data_find(rel->objects, g_win))); + ck_assert(!((rel->type == EFL_ACCESS_RELATION_FLOWS_FROM) && eina_list_data_find(rel->objects, g_win))); } - elm_atspi_relation_set_free(set); + efl_access_relation_set_free(set); elm_shutdown(); } END_TEST void elm_test_atspi(TCase *tc) { - tcase_add_test(tc, elm_atspi_app_obj_name_get); - tcase_add_test(tc, elm_atspi_name_get); - tcase_add_test(tc, elm_atspi_name_set); - tcase_add_test(tc, elm_atspi_role_get); - tcase_add_test(tc, elm_atspi_role_set); - tcase_add_test(tc, elm_atspi_role_name_get); - tcase_add_test(tc, elm_atspi_localized_role_name_get); - tcase_add_test(tc, elm_atspi_description_set); - tcase_add_test(tc, elm_atspi_description_get); - tcase_add_test(tc, elm_atspi_children_and_parent); - tcase_add_test(tc, elm_atspi_children_and_parent2); - tcase_add_test(tc, elm_atspi_translation_domain_get); - tcase_add_test(tc, elm_atspi_translation_domain_set); - tcase_add_test(tc, elm_atspi_relationship_append); - tcase_add_test(tc, elm_atspi_relationship_remove); - tcase_add_test(tc, elm_atspi_relationships_clear); + tcase_add_test(tc, test_efl_access_app_obj_name_get); + tcase_add_test(tc, test_efl_access_name_get); + tcase_add_test(tc, test_efl_access_name_set); + tcase_add_test(tc, test_efl_access_role_get); + tcase_add_test(tc, test_efl_access_role_set); + tcase_add_test(tc, test_efl_access_role_name_get); + tcase_add_test(tc, test_efl_access_localized_role_name_get); + tcase_add_test(tc, test_efl_access_description_set); + tcase_add_test(tc, test_efl_access_description_get); + tcase_add_test(tc, test_efl_access_children_and_parent); + tcase_add_test(tc, test_efl_access_children_and_parent2); + tcase_add_test(tc, test_efl_access_translation_domain_get); + tcase_add_test(tc, test_efl_access_translation_domain_set); + tcase_add_test(tc, test_efl_access_relationship_append); + tcase_add_test(tc, test_efl_access_relationship_remove); + tcase_add_test(tc, test_efl_access_relationships_clear); } |