2 * Tested interface: AtkObject
4 * Tested AtkObject: EailNotify
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailNotify
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define EAIL_TYPE_FOR_CHECK "EailNotify"
19 #define EAIL_TEST_LABEL_TITTLE "test label"
21 INIT_TEST("EailNotify")
24 _do_test(AtkObject *obj)
27 AtkObject *nested_obj;
29 _printf("Testing notify instance....\n");
30 atk_object_set_description(obj, "test");
31 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
33 atk_object_set_name(obj, "test name");
34 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
36 child_amount = atk_object_get_n_accessible_children(obj);
37 /* we have to check if there is nested label in Notify */
38 g_assert(1 == child_amount);
40 /* test if notify child is label-type*/
41 nested_obj = atk_object_ref_accessible_child(obj, 0);
42 g_assert(eailu_is_object_with_type(nested_obj, "EailLabel"));
43 g_assert(eailu_is_object_with_name(nested_obj, EAIL_TEST_LABEL_TITTLE));
45 /* For notify widget focusing doesn't work */
46 eailu_test_atk_focus(obj, FALSE);
48 _printf("Tests passed successfully\n");
50 eailu_test_code_called = 1;
54 _init_notify(Evas_Object *win)
56 Evas_Object *notify, *box, *label;
58 box = elm_box_add(win);
59 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60 elm_win_resize_object_add(win, box);
61 evas_object_show(box);
63 label = elm_label_add(win);
64 elm_object_text_set(label, EAIL_TEST_LABEL_TITTLE);
65 evas_object_show(label);
67 notify = elm_notify_add(win);
68 elm_notify_allow_events_set(notify, EINA_FALSE);
69 elm_object_content_set(notify, label);
70 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
71 evas_object_show(notify);
72 elm_box_pack_end(box, notify);
76 elm_main(int argc, char **argv)
80 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
83 evas_object_show(win);