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 from autotest_lib.client.common_lib import error | 5 from autotest_lib.client.common_lib import error |
6 from autotest_lib.client.cros import auth_server, login, ui_test | 6 from autotest_lib.client.cros import auth_server, cros_ui_test, login |
7 | 7 |
8 class login_BadAuthentication(ui_test.UITest): | 8 class login_BadAuthentication(cros_ui_test.UITest): |
9 version = 1 | 9 version = 1 |
10 | 10 |
11 auto_login = False | 11 auto_login = False |
12 | 12 |
13 _errorString = None | 13 _errorString = None |
14 | 14 |
15 def __login_denier(self, handler, url_args): | 15 def __login_denier(self, handler, url_args): |
16 handler.send_response(403) | 16 handler.send_response(403) |
17 handler.end_headers() | 17 handler.end_headers() |
18 handler.wfile.write(self._errorString) | 18 handler.wfile.write(self._errorString) |
(...skipping 13 matching lines...) Expand all Loading... |
32 def run_once(self, error_string='BadAuthentication'): | 32 def run_once(self, error_string='BadAuthentication'): |
33 self._errorString = "Error=" + error_string | 33 self._errorString = "Error=" + error_string |
34 # TODO(cmasone): find better way to determine login has failed. | 34 # TODO(cmasone): find better way to determine login has failed. |
35 try: | 35 try: |
36 self.login(self.username, self.password) | 36 self.login(self.username, self.password) |
37 except login.TimeoutError: | 37 except login.TimeoutError: |
38 pass | 38 pass |
39 else: | 39 else: |
40 raise error.TestFail('Should not have logged in') | 40 raise error.TestFail('Should not have logged in') |
41 self._authServer.wait_for_client_login() | 41 self._authServer.wait_for_client_login() |
OLD | NEW |