[gnome-settings-daemon] power: Check brightness reset after dimming



commit c8ec2b43ec7f1bb9bde24baed5ee1192a2df68b4
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 29 14:49:09 2013 +0100

    power: Check brightness reset after dimming

 plugins/power/test.py |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index 0ce7de6..a587b37 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -527,6 +527,24 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
 
         self.assertEqual(self.get_status(), gsdpowerenums.GSM_PRESENCE_STATUS_AVAILABLE)
 
+        # Bring down the screensaver
+        self.obj_screensaver.SetActive(True)
+        self.assertTrue(self.obj_screensaver.GetActive(), 'screensaver not turned on')
+
+        # Check that we blank
+        self.check_blank(2)
+
+        # Go to sleep
+        self.obj_logind.EmitSignal('', 'PrepareForSleep', 'b', [True], dbus_interface='org.freedesktop.DBus.Mock')
+        time.sleep(1)
+
+        # Wake up
+        self.obj_logind.EmitSignal('', 'PrepareForSleep', 'b', [False], dbus_interface='org.freedesktop.DBus.Mock')
+        time.sleep(1)
+
+        # And check that we have the pre-dim brightness
+        self.assertTrue(self.get_brightness() == gsdpowerconstants.GSD_MOCK_DEFAULT_BRIGHTNESS , 'incorrect unblanked brightness')
+
     def test_no_suspend_lid_close(self):
         '''Check that we don't suspend on lid close with an external monitor'''
 



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