summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-09 13:27:06 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-02-06 08:54:28 -0500
commit757ed85c6f2ebbebe0b2c15dd8fc675b3fad6ffd (patch)
tree37791f2cf853ef83bcd91cc0cbb0e9e3ffb7a622 /framework
parentaafa3867bed7b69cd0b36e302e8731a7abfd0b0e (diff)
speed up Java unit tests by removing sleeps
and replacing them with a call to XToolkitExperimental:: processEventsToIdle Reviewed-on: https://gerrit.libreoffice.org/16201 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> (cherry picked from commit 754ade38ddb2e96187d00f3e621203cea34961fa) Change-Id: I9fd6cb8af43d902587186310aebe78b5a5ee6932
Diffstat (limited to 'framework')
-rw-r--r--framework/qa/complex/XUserInputInterception/EventTest.java4
-rw-r--r--framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java6
2 files changed, 4 insertions, 6 deletions
diff --git a/framework/qa/complex/XUserInputInterception/EventTest.java b/framework/qa/complex/XUserInputInterception/EventTest.java
index 86c0051d1f7d..fc92beb9a63b 100644
--- a/framework/qa/complex/XUserInputInterception/EventTest.java
+++ b/framework/qa/complex/XUserInputInterception/EventTest.java
@@ -267,7 +267,7 @@ public class EventTest {
et.run();
- util.utils.pause(m_threadWait);
+ util.utils.waitForEventIdle(getMSF());
System.out.println("key listener thread should be finished.");
assertTrue("key event does not work!", m_keyPressed && m_keyReleased);
@@ -300,7 +300,7 @@ public class EventTest {
et.run();
- util.utils.pause(m_threadWait);
+ util.utils.waitForEventIdle(getMSF());
System.out.println("mouse listener thread should be finished.");
assertTrue("mouse event does not work!", m_mousePressed && m_mouseReleased);
diff --git a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java
index 6516d27d7f4c..6b3317dc79b1 100644
--- a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java
+++ b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java
@@ -46,7 +46,6 @@ import util.AccessibilityTools;
import util.DesktopTools;
import util.DrawTools;
import util.SOfficeFactory;
-import util.utils;
import org.openoffice.test.OfficeFileUrl;
// ---------- junit imports -----------------
@@ -121,7 +120,7 @@ public class CheckContextMenuInterceptor
xFrame = xModel.getCurrentController().getFrame();
// ensure that the document content is optimal visible
- DesktopTools.zoomToEntirePage(xDrawDoc);
+ DesktopTools.zoomToEntirePage(xMSF, xDrawDoc);
XBitmap xBitmap = null;
@@ -278,8 +277,7 @@ public class CheckContextMenuInterceptor
System.out.println("couldn't press mouse button");
}
- utils.pause(3000);
-
+ util.utils.waitForEventIdle(getMSF());
}
private XMultiServiceFactory getMSF()