From e0324064bc292fa5f20d8e9317ae3e16e916567a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 29 Jun 2011 18:11:07 +0200 Subject: [PATCH] tests: Make accessibility-dump output selected children by name And put one child in every row to make diffing easier. --- tests/a11y/about.txt | 2 +- tests/a11y/accessibility-dump.c | 14 ++++++++++---- tests/a11y/notebook.txt | 2 +- tests/a11y/tree.txt | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/a11y/about.txt b/tests/a11y/about.txt index 6bf8e886d9..58cca1d5c8 100644 --- a/tests/a11y/about.txt +++ b/tests/a11y/about.txt @@ -87,7 +87,7 @@ window1 alpha: 1 selection count: 1 - selected children: 0 + selected children: unnamed-GailNotebookPage-4 unnamed-GailNotebookPage-4 "page tab" parent: unnamed-GailNotebook-3 diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c index 1a1c21379c..38093ca5f9 100644 --- a/tests/a11y/accessibility-dump.c +++ b/tests/a11y/accessibility-dump.c @@ -402,14 +402,20 @@ dump_atk_selection (AtkSelection *atk_selection, { if (atk_selection_is_child_selected (atk_selection, i)) { + AtkObject *object = atk_object_ref_accessible_child (ATK_OBJECT (atk_selection), i); + + g_assert (object); + if (n_counted_selections == 0) - g_string_append_printf (string, "%*sselected children:", depth, ""); - g_string_append_printf (string, " %d", i); + { + g_string_append_printf (string, "%*sselected children: %s\n", depth, "", get_name (object)); + depth += strlen ("selected children: "); + } + else + g_string_append_printf (string, "%*s%s\n", depth, "", get_name (object)); n_counted_selections++; } } - if (n_counted_selections) - g_string_append_c (string, '\n'); g_assert_cmpint (n_selections, ==, n_counted_selections); } diff --git a/tests/a11y/notebook.txt b/tests/a11y/notebook.txt index c363093e0d..a517665360 100644 --- a/tests/a11y/notebook.txt +++ b/tests/a11y/notebook.txt @@ -17,7 +17,7 @@ window1 alpha: 1 selection count: 1 - selected children: 0 + selected children: Tab 1 Tab 1 "page tab" parent: notebook1 diff --git a/tests/a11y/tree.txt b/tests/a11y/tree.txt index cef74987a3..0713b5ee75 100644 --- a/tests/a11y/tree.txt +++ b/tests/a11y/tree.txt @@ -17,7 +17,8 @@ window1 alpha: 1 selection count: 2 - selected children: 2 3 + selected children: One + Two rows: 4 columns: 2