Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py

Issue 1203002: add ScreenSaverUnlock autotest and teach ScreenSaverRunning to log in (Closed)
Patch Set: fix copyright year in control file, again Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/desktopui_ScreenSaverUnlock/control ('k') | server/site_tests/suite_BuildVerify/control » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py
diff --git a/client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py b/client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py
new file mode 100644
index 0000000000000000000000000000000000000000..4a42398196b39d2ab3aae7770e1e218c26d8d52c
--- /dev/null
+++ b/client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging, os, time, utils
+from autotest_lib.client.bin import site_login, test
+from autotest_lib.client.common_lib import error
+from autotest_lib.client.bin import chromeos_constants
+
+class desktopui_ScreenSaverUnlock(test.test):
+ version = 1
+
+ def system_as(self, cmd, user='chronos'):
+ utils.system('su %s -c \'%s\'' % (user, cmd))
+
+ def setup(self):
+ site_login.setup_autox(self)
+
+ def run_once(self):
+ if site_login.logged_in():
+ if not site_login.attempt_logout():
+ raise error.TestFail('Could not terminate existing session')
+
+ if not site_login.attempt_login(self, 'autox_script.json'):
+ raise error.TestFail('Could not login')
+
+ # first sleep to let the login finish and start xscreensaver
+ time.sleep(10)
+ self.system_as('DISPLAY=:0.0 xscreensaver-command -lock')
+
+ # some sleep to let the screen lock
+ time.sleep(5)
+ self.system_as('DISPLAY=:0.0 xscreensaver-command -time | ' +
+ 'grep -q locked')
+
+ time.sleep(10)
+ if not site_login.attempt_login(self, 'autox_unlock.json'):
+ raise error.TestFail('Could not unlock screensaver')
+
+ # wait for screen to unlock
+ time.sleep(5)
+ self.system_as('DISPLAY=:0.0 xscreensaver-command -time | ' +
+ 'grep -q non-blanked')
« no previous file with comments | « client/site_tests/desktopui_ScreenSaverUnlock/control ('k') | server/site_tests/suite_BuildVerify/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698