[gtk+/a11y] Add a testcase for a very old bug
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/a11y] Add a testcase for a very old bug
- Date: Thu, 23 Jun 2011 21:59:26 +0000 (UTC)
commit 5efb19ffae532b4ce94bcf571ba14b04b96c76ef
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jun 23 17:52:39 2011 -0400
Add a testcase for a very old bug
This tests a problem that was first noticed in 2003, in
bug 126797: The text of a label accessible is not properly
updated when the label switches from !use-markup to use-markup.
tests/a11y/text.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/tests/a11y/text.c b/tests/a11y/text.c
index 0c7323d..791be05 100644
--- a/tests/a11y/text.c
+++ b/tests/a11y/text.c
@@ -1866,11 +1866,42 @@ add_text_tests (GtkWidget *widget)
g_object_unref (widget);
}
+static void
+test_bold_label (void)
+{
+ GtkWidget *label;
+ AtkObject *atk_obj;
+ gchar *text;
+
+ g_test_bug ("126797");
+
+ label = gtk_label_new ("<b>Bold?</b>");
+ g_object_ref_sink (label);
+
+ atk_obj = gtk_widget_get_accessible (label);
+
+ text = atk_text_get_text (ATK_TEXT (atk_obj), 0, -1);
+ g_assert_cmpstr (text, ==, "<b>Bold?</b>");
+ g_free (text);
+
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+
+ text = atk_text_get_text (ATK_TEXT (atk_obj), 0, -1);
+ g_assert_cmpstr (text, ==, "Bold?");
+ g_free (text);
+
+ g_object_unref (label);
+}
+
int
main (int argc, char *argv[])
{
gtk_test_init (&argc, &argv, NULL);
+ g_test_bug_base ("http://bugzilla.gnome.org/");
+
+ g_test_add_func ("/text/bold/GtkLabel", test_bold_label);
+
add_text_tests (gtk_text_view_new ());
add_text_tests (gtk_label_new (""));
add_text_tests (gtk_entry_new ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]