tests: Make accessibility-dump output selected children by name

And put one child in every row to make diffing easier.
This commit is contained in:
Benjamin Otte 2011-06-29 18:11:07 +02:00 committed by Matthias Clasen
parent 4ca42d9785
commit e0324064bc
4 changed files with 14 additions and 7 deletions

View File

@ -87,7 +87,7 @@ window1
alpha: 1
<AtkSelection>
selection count: 1
selected children: 0
selected children: unnamed-GailNotebookPage-4
unnamed-GailNotebookPage-4
"page tab"
parent: unnamed-GailNotebook-3

View File

@ -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);
}

View File

@ -17,7 +17,7 @@ window1
alpha: 1
<AtkSelection>
selection count: 1
selected children: 0
selected children: Tab 1
Tab 1
"page tab"
parent: notebook1

View File

@ -17,7 +17,8 @@ window1
alpha: 1
<AtkSelection>
selection count: 2
selected children: 2 3
selected children: One
Two
<AtkTable>
rows: 4
columns: 2