summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-09-17 16:08:54 +0200
committerBastien Nocera <hadess@hadess.net>2013-09-17 18:35:46 +0200
commit9677668d62c487cbcd5c31a6b4c95cb0ae68f77c (patch)
tree3beb4c082bade3d5cb3383826f8acfe3640a3a46 /tests
parent22c4d34fc89d3507bbb62ed2a843e22b8007f318 (diff)
downloadgnome-settings-daemon-9677668d62c487cbcd5c31a6b4c95cb0ae68f77c.tar.gz
power: Use a real mutter in our tests
Instead of a fake one that doesn't implement the necessary idle time APIs.
Diffstat (limited to 'tests')
-rw-r--r--tests/gsdtestcase.py49
1 files changed, 13 insertions, 36 deletions
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index c2ec2957..01df9bc8 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -185,46 +185,23 @@ class GSDTestCase(dbusmock.DBusTestCase):
self.logind.terminate()
self.logind.wait()
- def start_mutter(self):
- ''' start mock mutter DisplayConfig '''
- self.mutter = self.spawn_server('org.gnome.Mutter.DisplayConfig',
- '/org/gnome/Mutter/DisplayConfig',
- 'org.gnome.Mutter.DisplayConfig',
- stdout=subprocess.PIPE)
- self.obj_mutter = self.session_bus_con.get_object(
- 'org.gnome.Mutter.DisplayConfig', '/org/gnome/Mutter/DisplayConfig')
+ def start_mutter(klass):
+ ''' start mutter '''
- self.obj_mutter.AddMethods('',
- [
- ('GetResources', '', 'ua(uxiiiiiuaua{sv})a(uxiausauaua{sv})a(uxuud)ii', '''
-ret = (1, [(0, 1, 0, 0, 1024, 768, 0, 0, [0, 1, 2, 3, 4, 5, 6, 7], {}),
- (1, 2, 0, 0, 0, 0, -1, 0, [], {})],
- [(0, 3, 0, [0, 1], 'LVDS1', [0, 1], [], {'vendor': 'FOO',
- 'product': '0x0000',
- 'serial': '0x0000000',
- 'display-name': 'Built-in Display',
- 'backlight': -1,
- 'primary': True })],
- [(0, 5, 1024, 768, 60), (1, 6, 800, 600, 60)], 8192, 8192)'''),
- ('ApplyConfiguration', 'uba(uiiiuaua{sv})a(ua{sv})', '', ''),
- ('ChangeBacklight', 'uui', '', ''),
- ('GetCrtcGamma', 'uu', 'aqaqaq', 'ret = ([],[],[])'),
- ('SetCrtcGamma', 'uuaqaqaq', '', ''),
- ], dbus_interface='org.freedesktop.DBus.Mock')
-
- self.obj_mutter.AddProperties('',
- {
- 'PowerSaveMode': 0,
- })
+ klass.mutter_log = open(os.path.join(klass.workdir, 'mutter.log'), 'wb')
+ klass.mutter = subprocess.Popen(['mutter'],
+ stdout=klass.monitor_log,
+ stderr=subprocess.STDOUT)
- # set log to nonblocking
- set_nonblock(self.mutter.stdout)
+ def stop_mutter(klass):
+ '''stop mutter'''
- def stop_mutter(self):
- '''stop mock mutter'''
+ assert klass.monitor
+ klass.mutter.terminate()
+ klass.mutter.wait()
- self.mutter.terminate()
- self.mutter.wait()
+ klass.mutter_log.flush()
+ klass.mutter_log.close()
@classmethod
def start_xorg(klass):