2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #include "../cspi/spi-private.h" /* A hack for now */
25 #include <glib-object.h>
28 #include <atk/atknoopobject.h>
29 #include <bonobo-activation/bonobo-activation-register.h>
33 main (int argc, char **argv)
36 Accessibility_Event e;
37 Accessibility_Registry registry;
39 SpiAccessible *source;
45 gtk_init (&argc, &argv);
47 object = g_object_new (GTK_TYPE_BUTTON, NULL);
48 atko = atk_no_op_object_new (object);
52 g_print ("starting stress test...\n");
54 CORBA_exception_init (&ev);
56 registry = bonobo_activation_activate_from_id (
57 "OAFIID:Accessibility_Registry:1.0", 0, NULL, &ev);
59 if (ev._major != CORBA_NO_EXCEPTION)
61 g_error ("Accessibility app error: exception during "
62 "registry activation from id: %s\n",
63 CORBA_exception_id (&ev));
64 CORBA_exception_free (&ev);
67 if (registry == CORBA_OBJECT_NIL)
69 g_error ("Could not locate registry");
74 source = spi_accessible_new (atko);
76 e.type = "object:test";
77 e.source = BONOBO_OBJREF (source);
81 timer = g_timer_new ();
82 g_timer_start (timer);
84 for (i = 0; i < 500; ++i) {
85 Accessibility_Accessible_ref (e.source, &ev);
86 Accessibility_Registry_notifyEvent (registry, &e, &ev);
89 g_print ("%d notifications sent in %f sec.\n", i,
90 g_timer_elapsed (timer, NULL));