Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os, time | 5 import time |
| 6 from autotest_lib.client.bin import site_login, test | 6 from autotest_lib.client.bin import site_ui_test |
| 7 from autotest_lib.client.common_lib import error | |
| 8 | 7 |
| 9 class desktopui_DoLogin(test.test): | 8 class desktopui_DoLogin(site_ui_test.UITest): |
| 10 version = 1 | 9 version = 1 |
| 10 | |
| 11 | 11 |
| 12 def setup(self): | 12 def run_once(self): |
| 13 site_login.setup_autox(self) | 13 time.sleep(10) # Local login is so fast, it needs to be slowed down. |
|
kmixter1
2010/03/26 02:38:45
Adding the blocking call to the constructor should
| |
| 14 | |
| 15 def run_once(self, script): | |
| 16 logged_in = site_login.logged_in() | |
| 17 | |
| 18 # Can't test login while logged in, so logout. | |
| 19 if logged_in: | |
| 20 if not site_login.attempt_logout(): | |
| 21 raise error.TestFail('Could not terminate existing session') | |
| 22 if not site_login.wait_for_login_manager(): | |
| 23 raise error.TestFail("Login manager didn't come back") | |
| 24 | |
| 25 # Test account information embedded into json file. | |
| 26 if not site_login.attempt_login(self, script): | |
| 27 raise error.TestFail('Could not login') | |
| 28 | |
| 29 # If we started logged out, log back out. | |
| 30 if not logged_in: | |
| 31 site_login.attempt_logout() | |
| OLD | NEW |