summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_test_ctxpopup.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-25 11:49:55 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-29 16:06:17 +0200
commitb9648605e8f6623283ec960deac302685909f3c5 (patch)
tree9ab040f8ebe26bad90df34731d6d29fffc8c6eb7 /src/tests/elementary/elm_test_ctxpopup.c
parent782738122196c731e75a66d54703c9fb5f063eb4 (diff)
tests/elm: add test for ctxpopup sizing
verify that size hints of content are being respected Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9404
Diffstat (limited to '')
-rw-r--r--src/tests/elementary/elm_test_ctxpopup.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_ctxpopup.c b/src/tests/elementary/elm_test_ctxpopup.c
index fb46236..a6f74de 100644
--- a/src/tests/elementary/elm_test_ctxpopup.c
+++ b/src/tests/elementary/elm_test_ctxpopup.c
@@ -41,8 +41,44 @@ EFL_START_TEST(elm_atspi_role_get)
41} 41}
42EFL_END_TEST 42EFL_END_TEST
43 43
44static void
45_geometry_update(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
46{
47 Eina_Rectangle *geom = event_info;
48 int *set = data;
49 if ((geom->w >= 150) && (geom->h >= 150))
50 *set = 1;
51 else
52 *set = 0;
53}
54
55EFL_START_TEST(elm_ctxpopup_test_sizing)
56{
57 Eo *win, *bt, *ctx;
58 int pass = 0;
59
60 win = win_add();
61 bt = elm_button_add(win);
62 ctx = elm_ctxpopup_add(win);
63 evas_object_smart_callback_add(ctx, "geometry,update", _geometry_update, &pass);
64 elm_object_text_set(bt, "test");
65 evas_object_size_hint_min_set(bt, 150, 150);
66 elm_object_content_set(ctx, bt);
67 evas_object_show(win);
68
69 evas_object_resize(bt, 200, 200);
70 evas_object_resize(win, 200, 200);
71
72 evas_object_show(ctx);
73 get_me_to_those_events(win);
74
75 ck_assert_int_eq(pass, 1);
76}
77EFL_END_TEST
78
44void elm_test_ctxpopup(TCase *tc) 79void elm_test_ctxpopup(TCase *tc)
45{ 80{
46 tcase_add_test(tc, elm_ctxpopup_legacy_type_check); 81 tcase_add_test(tc, elm_ctxpopup_legacy_type_check);
47 tcase_add_test(tc, elm_atspi_role_get); 82 tcase_add_test(tc, elm_atspi_role_get);
83 tcase_add_test(tc, elm_ctxpopup_test_sizing);
48} 84}