[gtk/matthiasc/for-master: 1/4] a11y: Add a test for label properties




commit b10d5ec8ff65dbea8c60b95db9254982907ec4cb
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Oct 20 00:24:26 2020 -0400

    a11y: Add a test for label properties
    
    Now that we set the label property, we should test it too.

 testsuite/a11y/label.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/testsuite/a11y/label.c b/testsuite/a11y/label.c
index 1faacaecb5..3eba936bdf 100644
--- a/testsuite/a11y/label.c
+++ b/testsuite/a11y/label.c
@@ -44,6 +44,22 @@ label_relations (void)
   g_object_unref (label2);
 }
 
+static void
+label_properties (void)
+{
+  GtkWidget *label = gtk_label_new ("a");
+
+  g_object_ref_sink (label);
+
+  gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "a");
+
+  gtk_label_set_label (GTK_LABEL (label), "b");
+
+  gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "b");
+
+  g_object_unref (label);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -51,6 +67,7 @@ main (int argc, char *argv[])
 
   g_test_add_func ("/a11y/label/role", label_role);
   g_test_add_func ("/a11y/label/relations", label_relations);
+  g_test_add_func ("/a11y/label/properties", label_properties);
 
   return g_test_run ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]