[gtk+/quartz-integration: 349/563] Try harder to generate names for accessibles
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/quartz-integration: 349/563] Try harder to generate names for accessibles
- Date: Sat, 9 Jul 2011 06:35:22 +0000 (UTC)
commit bce1628eeb954fab001c9df6d22fb890d264e529
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 21 18:06:02 2011 -0400
Try harder to generate names for accessibles
We are still hitting the 'no name' case in GtkFileChooser for
a GailBox, otherwise.
tests/a11y/accessibility-dump.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index ce534b8..6aba659 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -84,7 +84,7 @@ diff_with_file (const char *file1,
command[3] = tmpfile;
/* run diff command */
- g_spawn_sync (NULL,
+ g_spawn_sync (NULL,
(char **) command,
NULL,
G_SPAWN_SEARCH_PATH,
@@ -100,6 +100,8 @@ done:
return diff;
}
+static int unnamed_object_count = 0;
+
static const char *
get_name (AtkObject *accessible)
{
@@ -123,9 +125,9 @@ get_name (AtkObject *accessible)
if (name == NULL)
{
- g_warning ("get_name called on a %s\n", g_type_name_from_instance ((GTypeInstance *)accessible));
- /* XXX: Generate a unique, repeatable name */
- g_assert_not_reached ();
+ g_test_message ("get_name called on a unnamed %s\n", g_type_name_from_instance ((GTypeInstance *)accessible));
+ /* Generate a unique, repeatable name */
+ name = g_strdup_printf ("unnamed-%s-%d", g_type_name_from_instance ((GTypeInstance*)accessible), unnamed_object_count++);
}
g_object_set_data_full (G_OBJECT (accessible), "gtk-accessibility-dump-name", name, g_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]