[gtk+] tests: Make accessibility-dump output selected children by name



commit e0324064bc292fa5f20d8e9317ae3e16e916567a
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 29 18:11:07 2011 +0200

    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 6bf8e88..58cca1d 100644
--- a/tests/a11y/about.txt
+++ b/tests/a11y/about.txt
@@ -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
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index 1a1c213..38093ca 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 c363093..a517665 100644
--- a/tests/a11y/notebook.txt
+++ b/tests/a11y/notebook.txt
@@ -17,7 +17,7 @@ window1
     alpha: 1
     <AtkSelection>
     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 cef7498..0713b5e 100644
--- a/tests/a11y/tree.txt
+++ b/tests/a11y/tree.txt
@@ -17,7 +17,8 @@ window1
     alpha: 1
     <AtkSelection>
     selection count: 2
-    selected children: 2 3
+    selected children: One
+                       Two
     <AtkTable>
     rows: 4
     columns: 2



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