summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-21 14:34:42 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-21 16:00:55 +0000
commitd19307846e6e360aacdec7fc81e3a923d387d1d2 (patch)
tree86689fbf575caa4c25d26fa86f9633fed5fc8e46 /uitest
parent996af54669056770c4d60f700adb60b353bf11e1 (diff)
uitest: add an optional way to print all received event names
Change-Id: I8180d131c2f4dbc9759ca1166192970bc06231c0 Reviewed-on: https://gerrit.libreoffice.org/32280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/libreoffice/uno/eventlistener.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/uitest/libreoffice/uno/eventlistener.py b/uitest/libreoffice/uno/eventlistener.py
index 8338f6f123c5..2dbdd68f086e 100644
--- a/uitest/libreoffice/uno/eventlistener.py
+++ b/uitest/libreoffice/uno/eventlistener.py
@@ -18,12 +18,13 @@ except ImportError:
class EventListener(XDocumentEventListener,unohelper.Base):
- def __init__(self, xContext, eventNames):
+ def __init__(self, xContext, eventNames, **kwargs):
self.xGEB = xContext.ServiceManager.createInstanceWithContext(
"com.sun.star.frame.GlobalEventBroadcaster", xContext)
self.xContext = xContext
self.executed = False
self.eventExecuted = []
+ self.printEvents = kwargs.get('printNames', False)
if isinstance(eventNames, str):
self.eventNames = [eventNames]
elif isinstance(eventNames, list):
@@ -37,6 +38,9 @@ class EventListener(XDocumentEventListener,unohelper.Base):
self.xGEB.removeDocumentEventListener(self)
def documentEventOccured(self, event):
+ if self.printEvents is True:
+ print(event.EventName)
+
if event.EventName in self.eventNames:
self.executed = True
self.eventExecuted.append(event.EventName)