Changeset 58098 in webkit


Ignore:
Timestamp:
Apr 22, 2010 8:46:20 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-22 Diego Escalante Urrelo <descalante@igalia.com>

Reviewed by Xan Lopez.

[Gtk] Evaluate and create tests for all the AtkRole's implemented by
WebKitGtk
https://bugs.webkit.org/show_bug.cgi?id=34449

Expand testatkroles to test ATK_ROLE_COMBO_BOX.

  • tests/testatkroles.c: (test_webkit_atk_get_role_combobox): (main):
Location:
trunk/WebKit/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r58083 r58098  
     12010-04-22  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_ROLE_COMBO_BOX.
     10
     11        * tests/testatkroles.c:
     12        (test_webkit_atk_get_role_combobox):
     13        (main):
     14
    1152010-04-22  Diego Escalante Urrelo  <descalante@igalia.com>
    216
  • trunk/WebKit/gtk/tests/testatkroles.c

    r58083 r58098  
    3636#define HTML_TABLE "<html><body><table border='1'><tr><td>This is</td><td>a test.</td></tr></table></body></html>"
    3737#define HTML_SEPARATOR "<html><body><hr/></body></html>"
     38#define HTML_COMBOBOX "<html><body><select size='1'><option>one</option><option>two</option><option>three</option></select></body></html>"
    3839/* Form roles */
    3940#define HTML_FORM "<html><body><form>This is a test.</form></body></html>"
     
    182183}
    183184
     185static void test_webkit_atk_get_role_combobox(AtkRolesFixture *fixture, gconstpointer data)
     186{
     187    AtkObject* comboboxMenu;
     188
     189    // This is an extraneous object of ATK_ROLE_PANEL which we should get rid of.
     190    fixture->obj = atk_object_ref_accessible_child(fixture->documentFrame, 0);
     191    g_assert(fixture->obj);
     192
     193    fixture->obj = atk_object_ref_accessible_child(fixture->obj, 0);
     194    g_assert(fixture->obj);
     195    fixture->role = atk_object_get_role(fixture->obj);
     196    g_assert(fixture->role == ATK_ROLE_COMBO_BOX);
     197
     198    comboboxMenu = atk_object_ref_accessible_child(fixture->obj, 0);
     199    g_assert(comboboxMenu);
     200    fixture->role = atk_object_get_role(comboboxMenu);
     201    g_assert(fixture->role == ATK_ROLE_MENU);
     202
     203    get_child_and_test_role(comboboxMenu, 0, ATK_ROLE_MENU_ITEM);
     204    get_child_and_test_role(comboboxMenu, 1, ATK_ROLE_MENU_ITEM);
     205    get_child_and_test_role(comboboxMenu, 2, ATK_ROLE_MENU_ITEM);
     206
     207    g_object_unref(fixture->obj);
     208    g_object_unref(comboboxMenu);
     209}
     210
    184211/* Form roles */
    185212static void test_webkit_atk_get_role_form(AtkRolesFixture *fixture, gconstpointer data)
     
    335362               atk_roles_fixture_teardown);
    336363
     364    g_test_add("/webkit/atk/test_webkit_atk_get_role_combobox",
     365               AtkRolesFixture, HTML_COMBOBOX,
     366               atk_roles_fixture_setup,
     367               test_webkit_atk_get_role_combobox,
     368               atk_roles_fixture_teardown);
     369
    337370    /* Form roles */
    338371    g_test_add("/webkit/atk/test_webkit_atk_get_role_form",
Note: See TracChangeset for help on using the changeset viewer.