~ubuntu-branches/ubuntu/lucid/libgail-gnome/lucid

« back to all changes in this revision

Viewing changes to test/test-gail-gnome.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-02-01 13:14:16 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060201131416-az9kbd6rzlbvxyyu
Tags: 1.1.3-0ubuntu2
* debian/control:
  - added Replaces to libgail-gnome-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
setup_outproc_control (void)
60
60
{
61
61
        AtkObject *atko;
62
 
        outproc_widget = bonobo_widget_new_control ("OAFIID:Bonobo_Sample_Entry", NULL);
 
62
        outproc_widget = bonobo_widget_new_control ("OAFIID:GNOME_ClockApplet", NULL);
63
63
        atko = gtk_widget_get_accessible (outproc_widget);
64
64
        atk_object_set_name (atko, "outproc control");
65
65
        gtk_widget_show (GTK_WIDGET (outproc_widget));
72
72
        AtkObject                *socket_obj;
73
73
        Accessibility_Accessible  accessible;
74
74
        Accessibility_Accessible  parent;
 
75
        Accessibility_Accessible  child;
75
76
        Accessibility_Accessible  tmp;
76
77
        CORBA_long                num_children;
77
78
        CORBA_Environment         env;
94
95
        parent = Accessibility_Accessible__get_parent (accessible, &env);
95
96
        g_assert (env._major == CORBA_NO_EXCEPTION);
96
97
        g_assert (accessible != CORBA_OBJECT_NIL);
97
 
 
98
 
        num_children = Accessibility_Accessible__get_childCount (accessible, &env);
99
 
        g_assert (env._major == CORBA_NO_EXCEPTION);
100
 
        g_assert (num_children == 1);
 
98
        fprintf (stderr, "parent: [%p] [%s]\n", 
 
99
                 parent, Accessibility_Accessible_getRoleName (parent, &env));
101
100
 
102
101
        num_children = Accessibility_Accessible__get_childCount (parent, &env);
103
102
        g_assert (env._major == CORBA_NO_EXCEPTION);
104
103
        g_assert (num_children == 1);
105
104
 
 
105
        fprintf (stderr, "remote accessible (1 of %d children) [%p] [%s]\n", 
 
106
                 num_children, accessible, Accessibility_Accessible_getRoleName (accessible, &env));
 
107
 
106
108
        tmp = Accessibility_Accessible_getChildAtIndex (parent, 0, &env);
107
109
        g_assert (env._major == CORBA_NO_EXCEPTION);
108
110
        g_assert (CORBA_Object_is_equivalent (accessible, tmp, &env));
109
111
        g_assert (env._major == CORBA_NO_EXCEPTION);
110
112
 
 
113
        num_children = Accessibility_Accessible__get_childCount (accessible, &env);
 
114
        g_assert (env._major == CORBA_NO_EXCEPTION);
 
115
        g_assert (num_children == 1);
 
116
 
 
117
        child = Accessibility_Accessible_getChildAtIndex (accessible, 0, &env);
 
118
        g_assert (env._major == CORBA_NO_EXCEPTION);
 
119
        fprintf (stderr, "child: (1 of %d) [%p] [%s]\n", 
 
120
                 num_children, child, Accessibility_Accessible_getRoleName (child, &env));
 
121
 
 
122
        parent = Accessibility_Accessible__get_parent (child, &env);
 
123
        g_assert (env._major == CORBA_NO_EXCEPTION);
 
124
        g_assert (parent != CORBA_OBJECT_NIL);
 
125
        g_assert (CORBA_Object_is_equivalent (accessible, parent, &env));
 
126
        g_assert (env._major == CORBA_NO_EXCEPTION);
 
127
 
 
128
        num_children = Accessibility_Accessible__get_childCount (child, &env);
 
129
        g_assert (env._major == CORBA_NO_EXCEPTION);
 
130
 
 
131
        if (num_children > 0)
 
132
        {
 
133
            tmp = Accessibility_Accessible_getChildAtIndex (child, 0, &env);
 
134
            g_assert (env._major == CORBA_NO_EXCEPTION);
 
135
            fprintf (stderr, "grandchild: (1 of %d) [%p] [%s]\n", 
 
136
                     num_children, tmp, Accessibility_Accessible_getRoleName (tmp, &env));
 
137
            
 
138
            parent = Accessibility_Accessible__get_parent (tmp, &env);
 
139
            g_assert (env._major == CORBA_NO_EXCEPTION);
 
140
            g_assert (parent != CORBA_OBJECT_NIL);
 
141
            g_assert (CORBA_Object_is_equivalent (child, parent, &env));
 
142
            g_assert (env._major == CORBA_NO_EXCEPTION);
 
143
        }
 
144
        fprintf (stderr, "parent-child relationships OK.\n");
111
145
        CORBA_exception_free (&env);
112
146
}
113
147
 
124
158
 
125
159
        test_spi_stuff (BONOBO_WIDGET (inproc_widget));
126
160
        test_spi_stuff (BONOBO_WIDGET (outproc_widget));
127
 
        
128
 
        gtk_main ();
129
 
 
 
161
 
 
162
        fprintf (stderr, "destroying components...\n");
 
163
}
 
164
 
 
165
gboolean 
 
166
end_test (void *data)
 
167
{
 
168
        gtk_widget_destroy (outproc_widget);
130
169
        gtk_widget_destroy (inproc_widget);
131
 
        gtk_widget_destroy (outproc_widget);
 
170
        gtk_main_quit ();
 
171
        return FALSE;
132
172
}
133
173
 
134
174
int
145
185
                            argc, argv, NULL);
146
186
 
147
187
        SPI_init ();
148
 
 
 
188
        
149
189
        test_gail_gnome ();
150
190
 
 
191
        /* If you want to at-poke this test program instead of run batch, comment this out! */
 
192
        g_idle_add (end_test, NULL);
 
193
 
 
194
        gtk_main ();
 
195
 
151
196
        if ((leaked = SPI_exit ()))
152
197
                g_error ("Leaked %d SPI handles", leaked);
153
198