[gtk/matthiasc/for-master] a11y: Add some more tests
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] a11y: Add some more tests
- Date: Wed, 21 Oct 2020 03:10:08 +0000 (UTC)
commit ef9ec43469c114f90174772a796813367b081a3a
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 20 22:44:24 2020 -0400
a11y: Add some more tests
testsuite/a11y/button.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]