summaryrefslogtreecommitdiff
path: root/src/tests/elementary/spec/efl_test_basics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/elementary/spec/efl_test_basics.c')
-rw-r--r--src/tests/elementary/spec/efl_test_basics.c74
1 files changed, 72 insertions, 2 deletions
diff --git a/src/tests/elementary/spec/efl_test_basics.c b/src/tests/elementary/spec/efl_test_basics.c
index 047e07d..0985adb 100644
--- a/src/tests/elementary/spec/efl_test_basics.c
+++ b/src/tests/elementary/spec/efl_test_basics.c
@@ -17,6 +17,7 @@
17 "Efl.Ui.List_View", 17 "Efl.Ui.List_View",
18 "Efl.Ui.Tab_Bar", 18 "Efl.Ui.Tab_Bar",
19 "Efl.Ui.Tags", 19 "Efl.Ui.Tags",
20 "Efl.Ui.Textbox",
20 "Efl.Ui.Panel", 21 "Efl.Ui.Panel",
21 "Efl.Ui.Scroller", 22 "Efl.Ui.Scroller",
22 "Efl.Ui.Slider", 23 "Efl.Ui.Slider",
@@ -43,10 +44,12 @@
43 "Efl.Ui.Tab_Page", 44 "Efl.Ui.Tab_Page",
44 "Efl.Ui.Timepicker", 45 "Efl.Ui.Timepicker",
45 "Efl.Ui.Navigation_Bar", 46 "Efl.Ui.Navigation_Bar",
46 "Efl.Ui.Relative_Layout", 47 "Efl.Ui.Relative_Container",
47 "Efl.Ui.Animation_View", 48 "Efl.Ui.Animation_View",
48 "Efl.Ui.Table", 49 "Efl.Ui.Table",
49 "Efl.Ui.Flip" 50 "Efl.Ui.Flip",
51 "Efl.Ui.Stack",
52 "Efl.Ui.Pager"
50 ], 53 ],
51 "custom-mapping" : { 54 "custom-mapping" : {
52 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS", 55 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS",
@@ -118,9 +121,76 @@ EFL_START_TEST(no_err_on_shutdown)
118} 121}
119EFL_END_TEST 122EFL_END_TEST
120 123
124static Eina_Bool
125is_this_visible(Eo *obj)
126{
127 Eina_Size2D sz;
128
129 if (!efl_gfx_entity_visible_get(obj))
130 return EINA_FALSE;
131
132 sz = efl_gfx_entity_size_get(obj);
133 if ((!sz.w) || (!sz.h)) return EINA_FALSE;
134
135 for (Eo *clipper = efl_canvas_object_clipper_get(obj); clipper ; clipper = efl_canvas_object_clipper_get(clipper))
136 {
137 int r,g,b,a;
138
139 efl_gfx_color_get(clipper, &r, &g, &b, &a);
140
141 if (!efl_gfx_entity_visible_get(clipper)) return EINA_FALSE;
142
143 if (r == 0 && g == 0 && b == 0) return EINA_FALSE;
144 if (a == 0) return EINA_FALSE;
145 sz = efl_gfx_entity_size_get(clipper);
146 if ((!sz.w) || (!sz.h)) return EINA_FALSE;
147 }
148 return EINA_TRUE;
149}
150
151EFL_START_TEST(correct_visibility_setting)
152{
153 Eo *checker = NULL;
154
155 if (efl_isa(widget, EFL_UI_FLIP_CLASS)) return; //FIXME Flip needs more work for this. However, flip should be redone as a spotlight manager, When this is done, we can add these classes to the check here.
156
157 efl_gfx_entity_size_set(widget, EINA_SIZE2D(200, 200));
158 efl_gfx_hint_size_min_set(widget, EINA_SIZE2D(200, 200));
159 efl_gfx_entity_visible_set(widget, EINA_TRUE);
160 checker = create_test_widget();
161 efl_gfx_hint_size_min_set(checker, EINA_SIZE2D(100, 100));
162
163 if (efl_isa(widget, EFL_PACK_INTERFACE))
164 {
165 efl_pack(widget, checker);
166 }
167 else if (efl_isa(widget, EFL_CONTENT_INTERFACE))
168 {
169 efl_content_set(widget, checker);
170 }
171 else
172 return;
173
174 get_me_to_those_events(widget);
175
176 if (checker)
177 ck_assert_int_eq(is_this_visible(checker), EINA_TRUE);
178
179 efl_gfx_entity_visible_set(widget, EINA_FALSE);
180 get_me_to_those_events(widget);
181 if (checker)
182 ck_assert_int_eq(is_this_visible(checker), EINA_FALSE);
183
184 efl_gfx_entity_visible_set(widget, EINA_TRUE);
185 get_me_to_those_events(widget);
186 if (checker)
187 ck_assert_int_eq(is_this_visible(checker), EINA_TRUE);
188}
189EFL_END_TEST
121void 190void
122efl_ui_widget_behavior_test(TCase *tc) 191efl_ui_widget_behavior_test(TCase *tc)
123{ 192{
124 tcase_add_test(tc, no_leaking_canvas_object); 193 tcase_add_test(tc, no_leaking_canvas_object);
125 tcase_add_test(tc, no_err_on_shutdown); 194 tcase_add_test(tc, no_err_on_shutdown);
195 tcase_add_test(tc, correct_visibility_setting);
126} 196}