summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-04-17 14:42:28 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-04-17 15:34:30 +0200
commit0fb575b34d039f7c732820467b6db6f8cebd485d (patch)
tree283fbfc7efe4a9cca50c6ed6e602287d647d58bb
parente0ccbe72ed6eb0d309ed272a78fd67a512acff5d (diff)
Wait for async events to be delivered
Follow-up fix for 6f43902b12dd36fa2b69401065df198ef9ffdb09 Also remove calling to super class (doesn't work and those methods return void anyway) Change-Id: I1aa927e373e6d19e4060daba1f34ef72428ead59 Reviewed-on: https://gerrit.libreoffice.org/70878 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--sw/qa/uitest/writer_tests5/xwindow.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/sw/qa/uitest/writer_tests5/xwindow.py b/sw/qa/uitest/writer_tests5/xwindow.py
index 0ed53f49c9c7..9187edc87cf6 100644
--- a/sw/qa/uitest/writer_tests5/xwindow.py
+++ b/sw/qa/uitest/writer_tests5/xwindow.py
@@ -31,26 +31,24 @@ class XMouseListenerExtended(unohelper.Base, XMouseListener):
def mousePressed(self, xMouseEvent):
global mouseEventsIntercepted
mouseEventsIntercepted += 1
- return super(XMouseListenerExtended, self).mousePressed(xMouseEvent)
# is invoked when a mouse button has been released on a window.
@classmethod
def mouseReleased(self, xMouseEvent):
global mouseEventsIntercepted
mouseEventsIntercepted += 1
- return super(XMouseListenerExtended, self).mouseReleased(xMouseEvent)
# is invoked when the mouse enters a window.
@classmethod
def mouseEntered(self, xMouseEvent):
- # doesn't work in UI tests
- return super(XMouseListenerExtended, self).mouseEntered(xMouseEvent)
+ global mouseEventsIntercepted
+ mouseEventsIntercepted += 1
# is invoked when the mouse exits a window.
@classmethod
def mouseExited(self, xMouseEvent):
- # doesn't work in UI tests
- return super(XMouseListenerExtended, self).mouseExited(xMouseEvent)
+ global mouseEventsIntercepted
+ mouseEventsIntercepted += 1
class XKeyListenerExtended(unohelper.Base, XKeyListener):
@@ -135,13 +133,17 @@ 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 keymouseEventsIntercepted
# Not expected 2 interceptions
self.assertEqual(0, keymouseEventsIntercepted)
global mouseEventsIntercepted
# mousePressed, mouseReleased and mouseEntered should be triggered
- self.assertEqual(2, mouseEventsIntercepted)
+ self.assertEqual(3, mouseEventsIntercepted)
# close document
self.ui_test.close_doc()