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 os, time |
6 from autotest_lib.client.bin import site_login, test | 6 from autotest_lib.client.bin import site_ui_test, site_login |
7 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
8 | 8 |
9 class desktopui_FailedLogin(test.test): | 9 class desktopui_FailedLogin(site_ui_test.UITest): |
10 version = 1 | 10 version = 1 |
11 | 11 |
12 def setup(self): | 12 auto_login = False |
13 site_login.setup_autox(self) | |
14 | 13 |
15 def run_once(self, script): | 14 def run_once(self): |
16 # Can't test login while logged in, so logout. | |
17 if site_login.logged_in(): | |
18 site_login.attempt_logout() | |
19 | |
20 # Test account information embedded into json file. | |
21 # TODO(cmasone): find better way to determine login has failed. | 15 # TODO(cmasone): find better way to determine login has failed. |
22 try: | 16 try: |
23 site_login.attempt_login(self, script) | 17 self.login('bogus@bogus.gmail.com', 'bogus') |
24 except site_login.TimeoutError: | 18 except site_login.TimeoutError: |
25 pass | 19 pass |
26 else: | 20 else: |
27 raise error.TestFail('Should not have logged in') | 21 raise error.TestFail('Should not have logged in') |
28 | |
29 # Re-set to a good state | |
30 site_login.nuke_login_manager() | |
OLD | NEW |