[gnome-settings-daemon] power: Fix test_sleep_inhibition check the wrong log for unwanted dim



commit b618f94cfc364b5dae945912aa6e99268c467d1b
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 22 11:37:19 2013 +0100

    power: Fix test_sleep_inhibition check the wrong log for unwanted dim

 plugins/power/test.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index abd82ee..a300dfe 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -138,17 +138,15 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
             self.assertFalse(b' Suspend' in log, 'unexpected Suspend request')
             self.assertFalse(b' Hibernate' in log, 'unexpected Hibernate request')
 
-    def check_no_idle_no_suspend(self, seconds):
+    def check_no_idle(self, seconds):
         '''Check that no idle mode is set in the given time'''
 
         # wait for specified time to ensure it didn't do anything
         time.sleep(seconds)
-        # check that it did not suspend or hibernate
-        log = self.logind.stdout.read()
+        # check that we don't dim
+        log = self.plugin_log.read()
         if log:
             self.assertFalse(b' Doing a state transition: dim' in log, 'unexpected dim request')
-            self.assertFalse(b' Suspend' in log, 'unexpected Suspend request')
-            self.assertFalse(b' Hibernate' in log, 'unexpected Hibernate request')
 
     def check_blank(self, timeout):
         '''Check that blank is requested.
@@ -294,7 +292,8 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
         inhibit_id = self.obj_session_mgr.Inhibit(
             'testsuite', dbus.UInt32(0), 'for testing',
             dbus.UInt32(gsdpowerenums.GSM_INHIBITOR_FLAG_IDLE | gsdpowerenums.GSM_INHIBITOR_FLAG_SUSPEND))
-        self.check_no_idle_no_suspend(7)
+        self.check_no_suspend(7)
+        self.check_no_idle(0)
 
         # Check that we didn't go to idle either
         obj_session_presence = self.session_bus_con.get_object(



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]