From b342deb70f497295819a2f6206817f6585450955 Mon Sep 17 00:00:00 2001 From: billh Date: Wed, 12 Jun 2002 17:59:42 +0000 Subject: [PATCH] Tweaks to tests, and a new stress test. (no changes to libs) git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@314 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 16 ++++++++++++++++ test/Makefile.am | 4 +++- test/event-listener-test.c | 7 +++++-- test/key-listener-test.c | 29 ++++++++++++++++++++--------- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48db1cbb..66302547 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2002-06-12 Bill Haneman + + * 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 * registryd/deviceeventcontroller.c: diff --git a/test/Makefile.am b/test/Makefile.am index 1fc1fd18..6e3bb6a1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 diff --git a/test/event-listener-test.c b/test/event-listener-test.c index 3853ceff..7a776acf 100644 --- a/test/event-listener-test.c +++ b/test/event-listener-test.c @@ -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 diff --git a/test/key-listener-test.c b/test/key-listener-test.c index c1bba647..2a2d78d5 100644 --- a/test/key-listener-test.c +++ b/test/key-listener-test.c @@ -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 (); -- 2.34.1