diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-20 22:44:24 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-20 22:44:24 -0400 |
commit | ef9ec43469c114f90174772a796813367b081a3a (patch) | |
tree | e204d4ba9b042929a8ab4389a5bcaa97ca8f2e07 | |
parent | 67411701c62c253b686d3b20cdc38b521e8db62b (diff) | |
download | gtk+-ef9ec43469c114f90174772a796813367b081a3a.tar.gz |
a11y: Add some more tests
-rw-r--r-- | testsuite/a11y/button.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/a11y/button.c b/testsuite/a11y/button.c index f78207fb31..a5e44280a4 100644 --- a/testsuite/a11y/button.c +++ b/testsuite/a11y/button.c @@ -25,6 +25,24 @@ button_label (void) g_object_unref (button); } +/* Check that we set up a labelled_by relationship between a button + * and its label. + */ +static void +button_relation (void) +{ + GtkWidget *button = gtk_button_new_with_mnemonic ("_Hello"); + GList *list; + + g_object_ref_sink (button); + + list = g_list_append (NULL, gtk_widget_get_first_child (button)); + gtk_test_accessible_assert_relation (GTK_ACCESSIBLE (button), GTK_ACCESSIBLE_RELATION_LABELLED_BY, list); + g_list_free (list); + + g_object_unref (button); +} + static void linkbutton_role (void) { @@ -54,6 +72,7 @@ main (int argc, char *argv[]) g_test_add_func ("/a11y/button/role", button_role); g_test_add_func ("/a11y/button/label", button_label); + g_test_add_func ("/a11y/button/relation", button_relation); g_test_add_func ("/a11y/linkbutton/role", linkbutton_role); g_test_add_func ("/a11y/linkbutton/label", linkbutton_label); |