[gtk+] tests: Don't dump stuff twice for tables



commit 74e8ac12081e1e4f34c259f9caed81a36e2e19cf
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 15 22:18:40 2011 +0100

    tests: Don't dump stuff twice for tables
    
    Captions and headers are printed as part of the children, so we can
    avoid the duplication by just printing the name.

 tests/a11y/accessibility-dump.c |   24 ++++--------------------
 tests/a11y/appchooser.txt       |   17 +----------------
 tests/a11y/tree.txt             |   34 ++--------------------------------
 3 files changed, 7 insertions(+), 68 deletions(-)
---
diff --git a/tests/a11y/accessibility-dump.c b/tests/a11y/accessibility-dump.c
index b2c79f8..19c4edc 100644
--- a/tests/a11y/accessibility-dump.c
+++ b/tests/a11y/accessibility-dump.c
@@ -513,10 +513,6 @@ dump_atk_streamable_content (AtkStreamableContent *content,
   g_string_append_c (string, '\n');
 }
 
-static void dump_accessible (AtkObject *accessible,
-                             guint      depth,
-                             GString   *string);
-
 static void
 dump_atk_table (AtkTable *table,
                 guint     depth,
@@ -532,17 +528,11 @@ dump_atk_table (AtkTable *table,
 
   obj = atk_table_get_summary (table);
   if (obj)
-    {
-      g_string_append_printf (string, "%*s<summary>\n", depth, "");
-      dump_accessible (obj, depth, string);
-    }
+    g_string_append_printf (string, "%*ssummary: %s\n", depth, "", get_name (obj));
 
   obj = atk_table_get_caption (table);
   if (obj)
-    {
-      g_string_append_printf (string, "%*s<caption>\n", depth, "");
-      dump_accessible (obj, depth, string);
-    }
+    g_string_append_printf (string, "%*scaption: %s\n", depth, "", get_name (obj));
 
   g_string_append_printf (string, "%*srows: %d\n", depth, "", atk_table_get_n_rows (table));
   g_string_append_printf (string, "%*scolumns: %d\n", depth, "", atk_table_get_n_columns (table));
@@ -577,10 +567,7 @@ dump_atk_table (AtkTable *table,
         g_string_append_printf (string, "%*scolumn %d description: %s\n", depth, "", i, desc);
       obj = atk_table_get_column_header (table, i);
       if (obj)
-        {
-          g_string_append_printf (string, "%*s<column %d header>\n", depth, "", i);
-          dump_accessible (obj, depth, string);
-        }
+        g_string_append_printf (string, "%*scolumn %d header: %s\n", depth, "", i, get_name (obj));
     }
 
   for (i = 0; i < atk_table_get_n_rows (table); i++)
@@ -590,10 +577,7 @@ dump_atk_table (AtkTable *table,
         g_string_append_printf (string, "%*srow %d description: %s\n", depth, "", i, desc);
       obj = atk_table_get_row_header (table, i);
       if (obj)
-        {
-          g_string_append_printf (string, "%*s<row %d header>\n", depth, "", i);
-          dump_accessible (obj, depth, string);
-        }
+        g_string_append_printf (string, "%*srow %d header: %s\n", depth, "", i, get_name (obj));
     }
 }
 
diff --git a/tests/a11y/appchooser.txt b/tests/a11y/appchooser.txt
index 7ee2fcc..d2f9384 100644
--- a/tests/a11y/appchooser.txt
+++ b/tests/a11y/appchooser.txt
@@ -105,22 +105,7 @@ window1
               rows: 1
               columns: 1
               column 0 description: 
-              <column 0 header>
-              unnamed-GtkButtonAccessible-6
-                "table column header"
-                parent: unnamed-GtkTreeViewAccessible-5
-                index: 0
-                name: 
-                state: enabled focusable selectable sensitive
-                toolkit: gtk
-                <AtkComponent>
-                layer: widget
-                alpha: 1
-                <AtkImage>
-                image size: -1 x -1
-                image description: (null)
-                <AtkAction>
-                action 0 name: click
+              column 0 header: unnamed-GtkButtonAccessible-6
               unnamed-GtkButtonAccessible-6
                 "table column header"
                 parent: unnamed-GtkTreeViewAccessible-5
diff --git a/tests/a11y/tree.txt b/tests/a11y/tree.txt
index 4e54aa6..27f2b8d 100644
--- a/tests/a11y/tree.txt
+++ b/tests/a11y/tree.txt
@@ -23,39 +23,9 @@ window1
     columns: 2
     selected rows: 0
     column 0 description: Column 1
-    <column 0 header>
-    unnamed-GtkButtonAccessible-0
-      "table column header"
-      parent: tree1
-      index: 0
-      name: Column 1
-      state: enabled sensitive showing visible
-      toolkit: gtk
-      <AtkComponent>
-      layer: widget
-      alpha: 1
-      <AtkImage>
-      image size: -1 x -1
-      image description: (null)
-      <AtkAction>
-      action 0 name: click
+    column 0 header: unnamed-GtkButtonAccessible-0
     column 1 description: Column 2
-    <column 1 header>
-    unnamed-GtkButtonAccessible-1
-      "table column header"
-      parent: tree1
-      index: 1
-      name: Column 2
-      state: enabled sensitive showing visible
-      toolkit: gtk
-      <AtkComponent>
-      layer: widget
-      alpha: 1
-      <AtkImage>
-      image size: -1 x -1
-      image description: (null)
-      <AtkAction>
-      action 0 name: click
+    column 1 header: unnamed-GtkButtonAccessible-1
     unnamed-GtkButtonAccessible-0
       "table column header"
       parent: tree1



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