Tweaks to tests, and a new stress test. (no changes to libs)
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 12 Jun 2002 17:59:42 +0000 (17:59 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 12 Jun 2002 17:59:42 +0000 (17:59 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@314 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
test/Makefile.am
test/event-listener-test.c
test/key-listener-test.c

index 48db1cb..6630254 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2002-06-12  Bill Haneman  <bill.haneman@sun.com>
+
+       * test/Makefile.am:
+       Added target for new stress-test.
+       
+       * test/stress-test.c:
+       New test, sends 1000 focus notifies in quick succession.
+
+       * test/key-listener-test.c:
+       Now we report whether a keylistener registration
+       request succeeded or failed.
+
+       * test/event-listener-test.c:
+       Uncommented some listeners which are now implemented.
+
+
 2002-06-06  Bill Haneman  <bill.haneman@sun.com>
 
        * registryd/deviceeventcontroller.c:
index 1fc1fd1..6e3bb6a 100644 (file)
@@ -1,9 +1,11 @@
 NULL=
 
-noinst_PROGRAMS = test-simple at app simple-at keysynth-demo accessx-gui key-listener-test event-listener-test screen-review-test
+noinst_PROGRAMS = test-simple at app simple-at stress-test keysynth-demo accessx-gui key-listener-test event-listener-test screen-review-test
 
 key_listener_test_SOURCES = key-listener-test.c
 
+stress_test_SOURCES = stress-test.c
+
 event_listener_test_SOURCES = event-listener-test.c
 
 screen_review_test_SOURCES = screen-review-test.c
index 3853cef..7a776ac 100644 (file)
@@ -70,6 +70,7 @@ main (int argc, char **argv)
                                   "object:visible-data-changed"); 
   SPI_registerGlobalEventListener (generic_listener,
                                   "object:text-selection-changed"); 
+
   SPI_registerGlobalEventListener (generic_listener,
                                   "object:text-caret-moved"); 
   SPI_registerGlobalEventListener (generic_listener,
@@ -100,7 +101,6 @@ main (int argc, char **argv)
                                   "window:deactivate");
   SPI_registerGlobalEventListener (generic_listener,
                                   "window:close");
-#ifdef NOT_YET_IMPLEMENTED
   SPI_registerGlobalEventListener (generic_listener,
                                   "window:lower");
   SPI_registerGlobalEventListener (generic_listener,
@@ -111,6 +111,7 @@ main (int argc, char **argv)
                                   "window:shade");
   SPI_registerGlobalEventListener (generic_listener,
                                   "window:unshade");
+#ifdef NOT_YET_IMPLEMENTED
   /* event below possibly should just be property change? */
   SPI_registerGlobalEventListener (generic_listener,
                                   "window:restyle"); 
@@ -178,7 +179,9 @@ traverse_accessible_tree (Accessible *accessible)
 void
 report_event (const AccessibleEvent *event, void *user_data)
 {
-  fprintf (stderr, "%s\n", event->type);
+  char *s = Accessible_getName (event->source);
+  fprintf (stderr, "%s %s\n", event->type, s);
+  if (s) SPI_freeString (s);
 }
 
 void
index c1bba64..2a2d78d 100644 (file)
@@ -50,6 +50,7 @@ main (int argc, char **argv)
 {
   char *tab_strings[1];
   short keycodes[] = {65, 64, 23};
+  SPIBoolean retval = FALSE;
        
   SPI_init ();
 
@@ -65,35 +66,45 @@ main (int argc, char **argv)
   sync_keyset = SPI_createAccessibleKeySet (3, "def", NULL, NULL);
   tab_strings[0] = "Tab";
   tab_keyset = SPI_createAccessibleKeySet (1,  NULL, NULL, tab_strings);
-  SPI_registerAccessibleKeystrokeListener(command_key_listener,
-                                         command_keyset,
+  retval = SPI_registerAccessibleKeystrokeListener(command_key_listener,
+                                         command_keyset,
                                          SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL,
                                          (unsigned long) ( SPI_KEY_PRESSED ),
                                          SPI_KEYLISTENER_ALL_WINDOWS);
-
-  SPI_registerAccessibleKeystrokeListener(ordinary_key_listener,
+  fprintf (stderr, "Command key registry: result %s\n", retval ? "succeeded" : 
+       "failed");
+  retval = SPI_registerAccessibleKeystrokeListener(ordinary_key_listener,
                                          async_keyset,
                                          SPI_KEYMASK_UNMODIFIED,
                                          (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
                                          SPI_KEYLISTENER_NOSYNC);
 
-  SPI_registerAccessibleKeystrokeListener(synchronous_key_listener,
+  retval = SPI_registerAccessibleKeystrokeListener(synchronous_key_listener,
                                          sync_keyset,
                                          SPI_KEYMASK_UNMODIFIED,
                                          (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
                                          SPI_KEYLISTENER_CANCONSUME);
 
-  SPI_registerAccessibleKeystrokeListener(tab_key_listener,
+  retval = SPI_registerAccessibleKeystrokeListener(tab_key_listener,
                                          tab_keyset,
                                          SPI_KEYMASK_ALT,
                                          (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
                                          SPI_KEYLISTENER_ALL_WINDOWS);
+  fprintf (stderr, "tab listener registry: %s\n", retval ? "succeeded" : "failed");
 
-  SPI_registerAccessibleKeystrokeListener(all_key_listener,
+  retval = SPI_registerAccessibleKeystrokeListener(all_key_listener,
                                          SPI_KEYSET_ALL_KEYS,
-                                         SPI_KEYMASK_UNMODIFIED,
+                                         SPI_KEYMASK_CONTROL,
                                          (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
-                                         SPI_KEYLISTENER_CANCONSUME);
+                                         SPI_KEYLISTENER_ALL_WINDOWS);
+       
+  fprintf (stderr, "all key registry: %s\n", retval ? "succeeded" : "failed" );
+
+  SPI_registerAccessibleKeystrokeListener(all_key_listener,
+                                        SPI_KEYSET_ALL_KEYS,
+                                        SPI_KEYMASK_UNMODIFIED,
+                                        (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+                                        SPI_KEYLISTENER_NOSYNC);
 
   SPI_event_main ();