2 * Tested interface: AtkObject
4 * Tested AtkObject: EailPrefs
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailPrefs
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
15 #include "eail_test_utils.h"
17 #define CHILDREN_COUNT 9
19 Elm_Prefs_Data *prefs_data;
21 INIT_TEST("EailPrefs")
24 _do_test(AtkObject *obj)
29 g_assert(ATK_IS_OBJECT(obj));
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 g_assert(atk_object_get_role(obj) == ATK_ROLE_REDUNDANT_OBJECT);
38 g_assert(atk_object_get_n_accessible_children(obj) == CHILDREN_COUNT);
40 for (i = 0; i < atk_object_get_n_accessible_children(obj); ++i)
42 child = atk_object_ref_accessible_child(obj, i);
44 g_object_unref(child);
47 eailu_test_code_called = 1;
51 _init_prefs(Evas_Object *win)
53 Evas_Object *bg, *prefs;
55 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
56 elm_win_autodel_set(win, EINA_TRUE);
59 elm_win_resize_object_add(win, bg);
60 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 prefs = elm_prefs_add(win);
64 evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
65 elm_win_resize_object_add(win, prefs);
66 evas_object_show(prefs);
67 elm_prefs_autosave_set(prefs, EINA_TRUE);
68 prefs_data = elm_prefs_data_new("./data/prefs_example_02.cfg", NULL,
69 EET_FILE_MODE_READ_WRITE);
70 elm_prefs_file_set(prefs, "./data/prefs_example_02.epb", NULL);
71 elm_prefs_data_set(prefs, prefs_data);
73 evas_object_resize(win, 320, 320);
77 elm_main(int argc, char **argv)
81 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
83 evas_object_show(win);
85 elm_prefs_data_unref(prefs_data);