forked from enlightenment/efl
atspi: changed del event broadcast. Fix genlist & gengrid tests
This commit is contained in:
parent
688ddf8b83
commit
9e970814d5
|
@ -4266,7 +4266,6 @@ EOLIAN static void
|
|||
_elm_widget_item_eo_base_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
|
||||
{
|
||||
Elm_Translate_String_Data *ts;
|
||||
Eo *parent;
|
||||
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
|
||||
|
||||
|
@ -4293,9 +4292,8 @@ _elm_widget_item_eo_base_destructor(Eo *eo_item, Elm_Widget_Item_Data *item)
|
|||
if (item->description)
|
||||
eina_stringshare_del(item->description);
|
||||
|
||||
eo_do(eo_item, parent = elm_interface_atspi_accessible_parent_get());
|
||||
if (parent && !eo_destructed_is(parent))
|
||||
elm_interface_atspi_accessible_children_changed_del_signal_emit(parent, eo_item);
|
||||
if (_elm_config->atspi_mode)
|
||||
elm_interface_atspi_accessible_children_changed_del_signal_emit(item->widget, eo_item);
|
||||
|
||||
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ START_TEST (elm_atspi_role_get)
|
|||
gengrid = elm_gengrid_add(win);
|
||||
eo_do(gengrid, role = elm_interface_atspi_accessible_role_get());
|
||||
|
||||
ck_assert(role == ELM_ATSPI_ROLE_TABLE);
|
||||
ck_assert(role == ELM_ATSPI_ROLE_TREE_TABLE);
|
||||
|
||||
elm_shutdown();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ static Elm_Atspi_Event_Children_Changed_Data ev_data;
|
|||
void test_init(void)
|
||||
{
|
||||
elm_init(1, NULL);
|
||||
elm_config_atspi_mode_set(EINA_TRUE);
|
||||
win = elm_win_add(NULL, "genlist", ELM_WIN_BASIC);
|
||||
genlist = elm_genlist_add(win);
|
||||
}
|
||||
|
@ -43,8 +44,8 @@ START_TEST(elm_atspi_children_get1)
|
|||
ck_assert(children == NULL);
|
||||
|
||||
it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[1] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
|
||||
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
|
||||
it[1] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
|
||||
eo_do(genlist, children = elm_interface_atspi_accessible_children_get());
|
||||
ck_assert(eina_list_count(children) == 3);
|
||||
|
@ -54,16 +55,6 @@ START_TEST(elm_atspi_children_get1)
|
|||
|
||||
eina_list_free(children);
|
||||
|
||||
elm_genlist_item_append(genlist, &itc, NULL, it[0], ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
elm_genlist_item_append(genlist, &itc, NULL, it[1], ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
elm_genlist_item_append(genlist, &itc, NULL, it[2], ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
|
||||
eo_do(genlist, children = elm_interface_atspi_accessible_children_get());
|
||||
ck_assert(eina_list_count(children) == 3);
|
||||
ck_assert(eina_list_nth(children, 0) == it[0]);
|
||||
ck_assert(eina_list_nth(children, 1) == it[1]);
|
||||
ck_assert(eina_list_nth(children, 2) == it[2]);
|
||||
|
||||
elm_shutdown();
|
||||
}
|
||||
END_TEST
|
||||
|
@ -117,13 +108,13 @@ START_TEST(elm_atspi_children_events_add)
|
|||
|
||||
it[1] = elm_genlist_item_prepend(genlist, &itc, it[0], NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
|
||||
ck_assert(genlist == current);
|
||||
ck_assert(counter == 1);
|
||||
ck_assert(counter == 2);
|
||||
ck_assert(ev_data.is_added == EINA_TRUE);
|
||||
ck_assert(ev_data.child == it[0]);
|
||||
ck_assert(ev_data.child == it[1]);
|
||||
|
||||
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
|
||||
ck_assert(genlist == current);
|
||||
ck_assert(counter == 2);
|
||||
ck_assert(counter == 3);
|
||||
ck_assert(ev_data.is_added == EINA_TRUE);
|
||||
ck_assert(ev_data.child == it[2]);
|
||||
|
||||
|
@ -140,21 +131,21 @@ START_TEST(elm_atspi_children_events_del1)
|
|||
|
||||
Elm_Object_Item *it[3];
|
||||
|
||||
eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL));
|
||||
|
||||
it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[1] = elm_genlist_item_prepend(genlist, &itc, it[0], NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
|
||||
|
||||
eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL));
|
||||
|
||||
elm_object_item_del(it[0]);
|
||||
ck_assert(genlist == current);
|
||||
ck_assert(counter == 3);
|
||||
ck_assert(counter == 1);
|
||||
ck_assert(ev_data.is_added == EINA_FALSE);
|
||||
ck_assert(ev_data.child == it[1]);
|
||||
ck_assert(ev_data.child == it[0]);
|
||||
|
||||
elm_object_item_del(it[2]);
|
||||
ck_assert(genlist == current);
|
||||
ck_assert(counter == 4);
|
||||
ck_assert(counter == 2);
|
||||
ck_assert(ev_data.is_added == EINA_FALSE);
|
||||
ck_assert(ev_data.child == it[2]);
|
||||
|
||||
|
@ -166,20 +157,19 @@ START_TEST(elm_atspi_children_events_del2)
|
|||
{
|
||||
test_init();
|
||||
|
||||
Elm_Object_Item *it[3];
|
||||
Elm_Object_Item *it;
|
||||
current = NULL;
|
||||
counter = 0;
|
||||
|
||||
it[0] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[1] = elm_genlist_item_prepend(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
it[2] = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_TREE, NULL, NULL);
|
||||
it = elm_genlist_item_append(genlist, &itc, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||
|
||||
eo_do(genlist, eo_event_callback_add(ELM_INTERFACE_ATSPI_ACCESSIBLE_EVENT_CHILDREN_CHANGED, _children_changed_cb, NULL));
|
||||
elm_genlist_clear(genlist);
|
||||
|
||||
ck_assert(genlist == current);
|
||||
ck_assert(counter == 6);
|
||||
ck_assert(counter == 1);
|
||||
ck_assert(ev_data.is_added == EINA_FALSE);
|
||||
ck_assert(ev_data.child == it[2]);
|
||||
ck_assert(ev_data.child == it);
|
||||
|
||||
elm_shutdown();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue