diff options
Diffstat (limited to 'sw/qa/uitest/writer_tests5')
-rw-r--r-- | sw/qa/uitest/writer_tests5/xwindow.py | 16 |
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() |