Changeset 57874 in webkit
- Timestamp:
- Apr 19, 2010 11:39:58 PM (14 years ago)
- Location:
- trunk/WebKit/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r57856 r57874 1 2010-04-19 Diego Escalante Urrelo <descalante@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [Gtk] Evaluate and create tests for all the AtkRole's implemented by 6 WebKitGtk 7 https://bugs.webkit.org/show_bug.cgi?id=34449 8 9 Expand testatkroles to test ATK form roles. 10 11 * tests/testatkroles.c: 12 (test_webkit_atk_get_role_check_box): 13 (test_webkit_atk_get_role_entry): 14 (test_webkit_atk_get_role_label): 15 (test_webkit_atk_get_role_listbox): 16 (test_webkit_atk_get_role_password_text): 17 (test_webkit_atk_get_role_push_button): 18 (test_webkit_atk_get_role_radio_button): 19 (main): 20 1 21 2010-04-19 Diego Escalante Urrelo <descalante@igalia.com> 2 22 -
trunk/WebKit/gtk/tests/testatkroles.c
r57815 r57874 26 26 #if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) 27 27 28 /* Non form roles */ 28 29 #define HTML_DOCUMENT_FRAME "<html><body>This is a test.</body></html>" 29 30 #define HTML_HEADING "<html><body><h1>1</h1><h2>2</h2><h3>3</h3><h4>4</h4><h5>5</h5><h6>6</h6></body></html>" … … 34 35 #define HTML_SECTION "<html><body><div>This is a test.</div></body></html>" 35 36 #define HTML_TABLE "<html><body><table border='1'><tr><td>This is</td><td>a test.</td></tr></table></body></html>" 37 /* Form roles */ 38 #define HTML_CHECK_BOX "<html><body><input type='checkbox' />This is a test.</body></html>" 39 #define HTML_LABELED_ENTRY "<html><body><label for='foo'>Name:</label><input type='text' id='foo' /></body></html>" 40 #define HTML_LISTBOX "<html><body><select size='3'><option>one</option><option>two</option><option>three</option></select></body></html>" 41 #define HTML_PASSWORD_TEXT "<html><body><input type='password' /></body></html>" 42 #define HTML_PUSH_BUTTON "<html><body><input type='submit' value='ok' />This is a test.</body></html>" 43 #define HTML_RADIO_BUTTON "<html><body><input type='radio' />This is a test.</body></html>" 36 44 37 45 typedef struct { … … 167 175 } 168 176 177 /* Form roles */ 178 static void test_webkit_atk_get_role_check_box(AtkRolesFixture* fixture, gconstpointer data) 179 { 180 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 181 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 182 g_assert(fixture->obj); 183 184 get_child_and_test_role(fixture->obj, 0, ATK_ROLE_CHECK_BOX); 185 186 g_object_unref(fixture->obj); 187 } 188 189 static void test_webkit_atk_get_role_entry(AtkRolesFixture* fixture, gconstpointer data) 190 { 191 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 192 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 193 g_assert(fixture->obj); 194 195 get_child_and_test_role(fixture->obj, 1, ATK_ROLE_ENTRY); 196 197 g_object_unref(fixture->obj); 198 } 199 200 static void test_webkit_atk_get_role_label(AtkRolesFixture* fixture, gconstpointer data) 201 { 202 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 203 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 204 g_assert(fixture->obj); 205 206 get_child_and_test_role(fixture->obj, 0, ATK_ROLE_LABEL); 207 208 g_object_unref(fixture->obj); 209 } 210 211 static void test_webkit_atk_get_role_listbox(AtkRolesFixture* fixture, gconstpointer data) 212 { 213 AtkObject* listboxObj; 214 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 215 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 216 g_assert(fixture->obj); 217 218 listboxObj = atk_object_ref_accessible_child(fixture->obj, 0); 219 g_assert(listboxObj); 220 fixture->role = atk_object_get_role(listboxObj); 221 g_assert(fixture->role == ATK_ROLE_LIST); 222 223 get_child_and_test_role(listboxObj, 0, ATK_ROLE_LIST_ITEM); 224 get_child_and_test_role(listboxObj, 1, ATK_ROLE_LIST_ITEM); 225 get_child_and_test_role(listboxObj, 2, ATK_ROLE_LIST_ITEM); 226 227 g_object_unref(fixture->obj); 228 g_object_unref(listboxObj); 229 } 230 231 static void test_webkit_atk_get_role_password_text(AtkRolesFixture* fixture, gconstpointer data) 232 { 233 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 234 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 235 g_assert(fixture->obj); 236 237 get_child_and_test_role(fixture->obj, 0, ATK_ROLE_PASSWORD_TEXT); 238 239 g_object_unref(fixture->obj); 240 } 241 242 static void test_webkit_atk_get_role_push_button(AtkRolesFixture* fixture, gconstpointer data) 243 { 244 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 245 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 246 g_assert(fixture->obj); 247 248 get_child_and_test_role(fixture->obj, 0, ATK_ROLE_PUSH_BUTTON); 249 250 g_object_unref(fixture->obj); 251 } 252 253 static void test_webkit_atk_get_role_radio_button(AtkRolesFixture* fixture, gconstpointer data) 254 { 255 // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of. 256 fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0); 257 g_assert(fixture->obj); 258 259 get_child_and_test_role(fixture->obj, 0, ATK_ROLE_RADIO_BUTTON); 260 261 g_object_unref(fixture->obj); 262 } 263 169 264 int main(int argc, char** argv) 170 265 { … … 222 317 atk_roles_fixture_teardown); 223 318 224 return g_test_run (); 319 /* Form roles */ 320 g_test_add("/webkit/atk/test_webkit_atk_get_role_check_box", 321 AtkRolesFixture, HTML_CHECK_BOX, 322 atk_roles_fixture_setup, 323 test_webkit_atk_get_role_check_box, 324 atk_roles_fixture_teardown); 325 326 g_test_add("/webkit/atk/test_webkit_atk_get_role_entry", 327 AtkRolesFixture, HTML_LABELED_ENTRY, 328 atk_roles_fixture_setup, 329 test_webkit_atk_get_role_entry, 330 atk_roles_fixture_teardown); 331 332 g_test_add("/webkit/atk/test_webkit_atk_get_role_label", 333 AtkRolesFixture, HTML_LABELED_ENTRY, 334 atk_roles_fixture_setup, 335 test_webkit_atk_get_role_label, 336 atk_roles_fixture_teardown); 337 338 g_test_add("/webkit/atk/test_webkit_atk_get_role_listbox", 339 AtkRolesFixture, HTML_LISTBOX, 340 atk_roles_fixture_setup, 341 test_webkit_atk_get_role_listbox, 342 atk_roles_fixture_teardown); 343 344 g_test_add("/webkit/atk/test_webkit_atk_get_role_password_text", 345 AtkRolesFixture, HTML_PASSWORD_TEXT, 346 atk_roles_fixture_setup, 347 test_webkit_atk_get_role_password_text, 348 atk_roles_fixture_teardown); 349 350 g_test_add("/webkit/atk/test_webkit_atk_get_role_push_button", 351 AtkRolesFixture, HTML_PUSH_BUTTON, 352 atk_roles_fixture_setup, 353 test_webkit_atk_get_role_push_button, 354 atk_roles_fixture_teardown); 355 356 g_test_add("/webkit/atk/test_webkit_atk_get_role_radio_button", 357 AtkRolesFixture, HTML_RADIO_BUTTON, 358 atk_roles_fixture_setup, 359 test_webkit_atk_get_role_radio_button, 360 atk_roles_fixture_teardown); 361 362 return g_test_run(); 225 363 } 226 364
Note: See TracChangeset
for help on using the changeset viewer.