[Libreoffice-commits] core.git: sw/qa

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 17 13:41:10 UTC 2019


 sw/qa/uitest/writer_tests5/xwindow.py |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 0fb575b34d039f7c732820467b6db6f8cebd485d
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed Apr 17 14:42:28 2019 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Apr 17 15:34:30 2019 +0200

    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 at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

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()


More information about the Libreoffice-commits mailing list