summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-16 13:38:33 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-16 13:38:33 -0400
commitb25c9f613728c478590f6d7e97e5bcdc5f6e5472 (patch)
treedd94978e954707de4068b896522a8aa0bc443e99
parentab0c71803b9c9d0d5d8066f67637a6674e89e939 (diff)
tests/elm: add test for elm_bubble "clicked" smart callback
Summary: also verify general layout loading Depends on D9330 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9331
-rw-r--r--src/tests/elementary/elm_test_bubble.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_bubble.c b/src/tests/elementary/elm_test_bubble.c
index c7527551c9..b91a402ae9 100644
--- a/src/tests/elementary/elm_test_bubble.c
+++ b/src/tests/elementary/elm_test_bubble.c
@@ -41,9 +41,51 @@ EFL_START_TEST(elm_atspi_role_get)
41} 41}
42EFL_END_TEST 42EFL_END_TEST
43 43
44EFL_START_TEST(elm_bubble_test_callbacks)
45{
46 Evas_Object *win, *bb, *ic, *ct;
47 int called = 0;
48
49 win = win_add(NULL, "bubble", ELM_WIN_BASIC);
50
51 ic = elm_icon_add(win);
52 ck_assert(elm_image_file_set(ic, ELM_IMAGE_DATA_DIR "/images/logo_small.png", NULL));
53 elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
54 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
55
56 bb = elm_bubble_add(win);
57 elm_object_text_set(bb, "Message 1");
58 elm_object_part_text_set(bb, "info", "Corner: bottom_right");
59 elm_object_part_content_set(bb, "icon", ic);
60 elm_bubble_pos_set(bb, ELM_BUBBLE_POS_BOTTOM_RIGHT);
61 evas_object_smart_callback_add(bb, "clicked", event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called, &called);
62 evas_object_show(ic);
63 evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
64 evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
65
66 ct = elm_label_add(win);
67 elm_object_text_set(ct,
68 "\"The future of the art: R or G or B?\", by Rusty");
69 elm_object_content_set(bb, ct);
70
71 evas_object_resize(bb, 240, 100);
72 evas_object_resize(win, 240, 100);
73 evas_object_show(bb);
74 evas_object_show(win);
75
76 get_me_to_those_events(bb);
77 click_object(ct);
78 ck_assert_int_eq(called, 1);
79 called = 0;
80 click_part(bb, "elm.info");
81 ck_assert_int_eq(called, 1);
82}
83EFL_END_TEST
84
44void elm_test_bubble(TCase *tc) 85void elm_test_bubble(TCase *tc)
45{ 86{
46 tcase_add_test(tc, elm_bubble_legacy_type_check); 87 tcase_add_test(tc, elm_bubble_legacy_type_check);
47 tcase_add_test(tc, elm_atspi_role_get); 88 tcase_add_test(tc, elm_atspi_role_get);
89 tcase_add_test(tc, elm_bubble_test_callbacks);
48} 90}
49 91