2 * Tested interface: AtkObject
4 * Tested AtkObject: EailBackground
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailBackground
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
17 #include "eail_test_utils.h"
19 #define TEST_STR "bg-test"
20 #define IMG_PATH "./data/08.jpg"
26 INIT_TEST("EailBackground")
29 _do_test(AtkObject *obj)
31 AtkAttributeSet *attr_set, *node;
34 g_assert(ATK_IS_OBJECT(obj));
35 atk_object_set_description(obj, "test");
36 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
37 g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
39 atk_object_set_name(obj, "test name");
40 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
42 attr_set = atk_object_get_attributes(obj);
43 g_assert(g_slist_length(attr_set) == 3);
45 node = g_slist_nth(attr_set, 0);
46 p = (AtkAttribute *)node->data;
47 g_assert_cmpstr(p->name, ==, "type");
48 g_assert_cmpstr(p->value, ==, "elm_bg");
50 node = g_slist_next(node);
51 p = (AtkAttribute *)node->data;
52 g_assert_cmpstr(p->name, ==, "file");
53 g_assert_cmpstr(p->value, ==, IMG_PATH);
55 node = g_slist_next(node);
56 p = (AtkAttribute *)node->data;
57 g_assert_cmpstr(p->name, ==, "display mode");
58 g_assert_cmpstr(p->value, ==, "stretch");
60 g_slist_free(attr_set);
62 eailu_test_code_called = 1;
66 _init_background(Evas_Object *win)
72 elm_bg_load_size_set(bg, 20, 20);
73 elm_bg_option_set(bg, ELM_BG_OPTION_STRETCH);
74 g_snprintf(buf, sizeof(buf), IMG_PATH);
75 elm_bg_file_set(bg, buf, NULL);
76 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
77 elm_win_resize_object_add(win, bg);
79 evas_object_resize(win, WIDTH, HEIGHT);
83 elm_main(int argc, char **argv)
87 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
88 _init_background(win);
89 evas_object_show(win);