summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-16 22:08:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-16 22:52:44 +0200
commitedeb858b57d5b45dbc20e04d323085cf9ce95f55 (patch)
tree8d168f5ea19cb76c305303cbc5ae9bdf13f09906
parent141c75847a0fc470915a16c83e80f8effb7a22b6 (diff)
Make xwindow.py test more robust
...by waiting for all events to be processed before the listeners are removed Change-Id: I1aa4f6c43de97a567877a499c4c8fb51ef53eeea Reviewed-on: https://gerrit.libreoffice.org/72432 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sw/qa/uitest/writer_tests5/xwindow.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/qa/uitest/writer_tests5/xwindow.py b/sw/qa/uitest/writer_tests5/xwindow.py
index 7e561fe8de2f..29a89bb5809c 100644
--- a/sw/qa/uitest/writer_tests5/xwindow.py
+++ b/sw/qa/uitest/writer_tests5/xwindow.py
@@ -140,6 +140,10 @@ class XWindow(UITestCase):
xToolkitRobot.keyPress(xKeyEvent)
xToolkitRobot.keyRelease(xKeyEvent)
+ # Wait for async events to be processed
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
+
# remove mouse listener
xWindow.removeMouseListener(xMouseListener)
self.assertEqual(1, mouseListenerCount)
@@ -149,10 +153,6 @@ class XWindow(UITestCase):
xWindow.removeKeyListener(xKeyListener)
del xKeyListener
- # Wait for async events to be processed
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
-
global keymousePressedEventsIntercepted
# Not expected any interceptions
self.assertEqual(0, keymousePressedEventsIntercepted)