diff options
Diffstat (limited to 'toolkit')
3 files changed, 23 insertions, 22 deletions
diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java index f7709b63d560..ccdf2b87ff03 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java @@ -193,7 +193,7 @@ public class AccessibleStatusBar { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -218,17 +218,17 @@ public class AccessibleStatusBar { "com.sun.star.awt.Toolkit") ; XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xIfc); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); System.out.println("...OK."); XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, parentContext); @@ -289,8 +289,8 @@ public class AccessibleStatusBar { System.out.println("*** Now testing XAccessibleEventBroadcaster ***"); _XAccessibleEventBroadcaster _xAccEvBcast = new _XAccessibleEventBroadcaster(testObject, xWindow); - assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener()); - assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener()); + assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(xMSF)); + assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(xMSF)); } diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java index 530351e65b93..524aaf5148ee 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java @@ -196,7 +196,7 @@ public class AccessibleStatusBarItem { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -222,18 +222,18 @@ public class AccessibleStatusBarItem { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); xWindow = UnoRuntime.queryInterface( XWindow.class,tk.getActiveTopWindow()); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); if ( parentContext == null ) { fail("Could not create a test object."); } @@ -312,8 +312,8 @@ public class AccessibleStatusBarItem { System.out.println("*** Now testing XAccessibleEventBroadcaster ***"); _XAccessibleEventBroadcaster _xAccEvBcast = new _XAccessibleEventBroadcaster(object, xWindow); - assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener()); - assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener()); + assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(xMSF)); + assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(xMSF)); System.out.println("*** Now testing XAccessibleText ***"); _XAccessibleText _xAccText = diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java index 323553b754a4..fe48a6cb86b3 100644 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java @@ -18,18 +18,19 @@ package complex.toolkit.accessibility; -import com.sun.star.lang.EventObject; -import com.sun.star.awt.Rectangle; -import com.sun.star.awt.PosSize; -import com.sun.star.awt.XWindow; import com.sun.star.accessibility.AccessibleEventObject; import com.sun.star.accessibility.AccessibleStateType; import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.accessibility.XAccessibleEventBroadcaster; import com.sun.star.accessibility.XAccessibleEventListener; -import com.sun.star.accessibility.XAccessibleContext; -import com.sun.star.uno.XInterface; +import com.sun.star.awt.PosSize; +import com.sun.star.awt.Rectangle; +import com.sun.star.awt.XWindow; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; /** * Testing <code> @@ -108,14 +109,14 @@ public class _XAccessibleEventBroadcaster { * Adds two listeners and fires event by mean of object relation. <p> * Has <b> OK </b> status if both listeners were called */ - public boolean _addEventListener() { + public boolean _addEventListener(XMultiServiceFactory xMSF) { System.out.println("adding two listeners"); oObj.addAccessibleEventListener(list); boolean isTransient = chkTransient(oObj); System.out.println("fire event"); prod.fireEvent() ; - util.utils.pause(1500); + util.utils.waitForEventIdle(xMSF); boolean works = true; @@ -143,7 +144,7 @@ public class _XAccessibleEventBroadcaster { * <li> <code>addEventListener()</code> : to have added listeners </li> * </ul> */ - public boolean _removeEventListener() { + public boolean _removeEventListener(XMultiServiceFactory xMSF) { list.notifiedEvent = null; @@ -153,7 +154,7 @@ public class _XAccessibleEventBroadcaster { System.out.println("fire event"); prod.fireEvent() ; - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); if (list.notifiedEvent == null) { System.out.println("listener wasn't called -- OK"); |