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

Side by Side Diff: client/site_tests/desktopui_ScreenSaverUnlock/desktopui_ScreenSaverUnlock.py

Issue 3073014: Autotest for ScreenLocker (Closed) Base URL: ssh://git@gitrw.chromium.org/autotest.git
Patch Set: bvt only Created 10 years, 4 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 time
6 from autotest_lib.client.bin import site_ui_test, site_utils
7 from autotest_lib.client.common_lib import error
8
9 class desktopui_ScreenSaverUnlock(site_ui_test.UITest):
10 version = 1
11
12
13 def run_once(self, is_control=False):
14 self.wait_for_screensaver()
15 self.xsystem('xscreensaver-command -lock')
16
17 site_utils.poll_for_condition(
18 lambda: self.is_screensaver_locked(),
19 desc='screensaver lock')
20
21 ax = self.get_autox()
22
23 # Send a key and wait for the screensaver to wakeup and
24 # present the login dialog.
25 # TODO: a less brittle way to do this would be nice
26 ax.send_hotkey('Return')
27 time.sleep(2)
28
29 if is_control:
30 # send an incorrect password
31 ax.send_text('_boguspassword_')
32 ax.send_hotkey('Return')
33
34 # verify that the screen unlock attempt failed
35 try:
36 site_utils.poll_for_condition(
37 lambda: self.is_screensaver_unlocked(),
38 desc='screensaver unlock')
39 except error.TestError:
40 pass
41 else:
42 raise error.TestFail('screen saver unlocked with bogus password. ')
43 else:
44 # send the correct password
45 ax.send_text(self.password)
46 ax.send_hotkey('Return')
47
48 # wait for screen to unlock
49 site_utils.poll_for_condition(
50 lambda: self.is_screensaver_unlocked(),
51 desc='screensaver unlock')
OLDNEW
« no previous file with comments | « client/site_tests/desktopui_ScreenLocker/desktopui_ScreenLocker.py ('k') | server/site_tests/suite_BuildVerify/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698