summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Endrodi <ext-adam.endrodi@nokia.com>2010-12-21 14:39:16 +0200
committerAdam Endrodi <ext-adam.endrodi@nokia.com>2010-12-21 14:42:02 +0200
commit902a81bdd14a067cb81c56ba6106b9bff743d6fb (patch)
treeb2ecf7c4a9dc09bfb1451b7e81ecfc399005fe59
parent3853a2d6c77343e56975554830e9968562f9712c (diff)
make all tests pass even if there are notifications
This makes the tests more robust. * tests/functional/mcompositor-test-init.py: Find and unmap all existing notification windows before we begin.
-rwxr-xr-xtests/functional/mcompositor-test-init.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/functional/mcompositor-test-init.py b/tests/functional/mcompositor-test-init.py
index 87aafaa..c03ed8c 100755
--- a/tests/functional/mcompositor-test-init.py
+++ b/tests/functional/mcompositor-test-init.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
# Common initialisation commands for each test.
-import os, sys
+import os, sys, re
if os.system('/sbin/mcetool --unblank-screen --set-tklock-mode=unlocked --set-inhibit-mode=stay-on'):
print 'mcetool is missing!'
@@ -9,6 +9,11 @@ if os.system('/sbin/mcetool --unblank-screen --set-tklock-mode=unlocked --set-in
if os.system('/usr/bin/gconftool-2 --type bool --set /desktop/meego/notifications/previews_enabled false'):
print 'cannot disable notifications'
+# Find and unmap all existing notification windows, so they don't get in our way.
+r = re.compile("^(0x[0-9a-fA-F]+) NOTIFICATION ")
+for win in [ m.groups(1)[0] for m in [ r.match(l) for l in os.popen("windowstack m") ] if m is not None ]:
+ os.system('windowctl U %s' % win)
+
if os.system('pidof mcompositor'):
print 'mcompositor is not running'
sys.exit(1)