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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import logging, os, time, utils
6 from autotest_lib.client.bin import site_login, test
7 from autotest_lib.client.common_lib import error
8 from autotest_lib.client.bin import chromeos_constants
9
10 class desktopui_ScreenSaverUnlock(test.test):
11 version = 1
12
13 def system_as(self, cmd, user='chronos'):
14 utils.system('su %s -c \'%s\'' % (user, cmd))
15
16 def setup(self):
17 site_login.setup_autox(self)
18
19 def run_once(self):
20 if site_login.logged_in():
21 if not site_login.attempt_logout():
22 raise error.TestFail('Could not terminate existing session')
23
24 if not site_login.attempt_login(self, 'autox_script.json'):
25 raise error.TestFail('Could not login')
26
27 # first sleep to let the login finish and start xscreensaver
28 time.sleep(10)
29 self.system_as('DISPLAY=:0.0 xscreensaver-command -lock')
30
31 # some sleep to let the screen lock
32 time.sleep(5)
33 self.system_as('DISPLAY=:0.0 xscreensaver-command -time | ' +
34 'grep -q locked')
35
36 time.sleep(10)
37 if not site_login.attempt_login(self, 'autox_unlock.json'):
38 raise error.TestFail('Could not unlock screensaver')
39
40 # wait for screen to unlock
41 time.sleep(5)
42 self.system_as('DISPLAY=:0.0 xscreensaver-command -time | ' +
43 'grep -q non-blanked')
OLDNEW
« 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