qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java |   22 
+++++++---
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 2a583603dec40090289ddb5b4b70d800794cf57b
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Fri Jul 3 16:57:50 2015 +0200

    Make test code more robust
    
    Change-Id: If3b58c02b289224938b1dfd8074f9802ea6d2474

diff --git 
a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java 
b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
index a5d0740..2971669 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
@@ -77,7 +77,9 @@ public class _XAccessibleEventBroadcaster extends 
MultiMethodTest {
             if (nev instanceof com.sun.star.accessibility.XAccessible) {
                 System.out.println("New: 
"+((XAccessible)nev).getAccessibleContext().getAccessibleName());
             }
-            notifiedEvent = ev;
+            synchronized (this) {
+                notifiedEvent = ev;
+            }
         }
 
         public void disposing(EventObject ev) {}
@@ -118,7 +120,11 @@ public class _XAccessibleEventBroadcaster extends 
MultiMethodTest {
 
         boolean works = true;
 
-        if (list.notifiedEvent == null) {
+        AccessibleEventObject ne;
+        synchronized (list) {
+            ne = list.notifiedEvent;
+        }
+        if (ne == null) {
             if (!isTransient) {
                 log.println("listener wasn't called");
                 works = false;
@@ -151,17 +157,23 @@ public class _XAccessibleEventBroadcaster extends 
MultiMethodTest {
     public void _removeEventListener() throws Exception {
         requiredMethod("addEventListener()");
 
-        list.notifiedEvent = null;
-
         log.println("remove listener");
         oObj.removeAccessibleEventListener(list);
 
+        synchronized (list) {
+            list.notifiedEvent = null;
+        }
+
         log.println("fire event");
         prod.fireEvent() ;
 
         waitForEventIdle();
 
-        if (list.notifiedEvent == null) {
+        AccessibleEventObject ne;
+        synchronized (list) {
+            ne = list.notifiedEvent;
+        }
+        if (ne == null) {
             log.println("listener wasn't called -- OK");
         }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to