| 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 dbus, logging, os, re, shutil, socket, sys, time | 5 import dbus, logging, os, re, shutil, socket, sys, time |
| 6 import common | 6 import common |
| 7 import auth_server, constants as chromeos_constants, cryptohome, dns_server | 7 import auth_server, constants as chromeos_constants, cryptohome, dns_server |
| 8 import login, ui | 8 import login, log_reader, ui |
| 9 from autotest_lib.client.bin import test, site_log_reader, utils | 9 from autotest_lib.client.bin import test, utils |
| 10 from autotest_lib.client.common_lib import error | 10 from autotest_lib.client.common_lib import error |
| 11 from dbus.mainloop.glib import DBusGMainLoop | 11 from dbus.mainloop.glib import DBusGMainLoop |
| 12 | 12 |
| 13 sys.path.append(os.environ.get("SYSROOT", "/usr/local") + | 13 sys.path.append(os.environ.get("SYSROOT", "/usr/local") + |
| 14 "/usr/lib/flimflam/test") | 14 "/usr/lib/flimflam/test") |
| 15 import flimflam | 15 import flimflam |
| 16 | 16 |
| 17 | 17 |
| 18 class UITest(test.test): | 18 class UITest(test.test): |
| 19 """Base class for tests that drive some portion of the user interface. | 19 """Base class for tests that drive some portion of the user interface. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 creds: String specifying the credentials for this test case. Can | 153 creds: String specifying the credentials for this test case. Can |
| 154 be a named set of credentials as defined by | 154 be a named set of credentials as defined by |
| 155 chromeos_constants.CREDENTIALS, or a 'username:password' pair. | 155 chromeos_constants.CREDENTIALS, or a 'username:password' pair. |
| 156 Defaults to None -- browse without signing-in. | 156 Defaults to None -- browse without signing-in. |
| 157 | 157 |
| 158 """ | 158 """ |
| 159 | 159 |
| 160 # Mark /var/log/messages now; we'll run through all subsequent | 160 # Mark /var/log/messages now; we'll run through all subsequent |
| 161 # log messages at the end of the test and log info about processes that | 161 # log messages at the end of the test and log info about processes that |
| 162 # crashed. | 162 # crashed. |
| 163 self._log_reader = site_log_reader.LogReader() | 163 self._log_reader = log_reader.LogReader() |
| 164 self._log_reader.set_start_by_current() | 164 self._log_reader.set_start_by_current() |
| 165 | 165 |
| 166 if creds: | 166 if creds: |
| 167 self.start_authserver() | 167 self.start_authserver() |
| 168 | 168 |
| 169 if login.logged_in(): | 169 if login.logged_in(): |
| 170 login.attempt_logout() | 170 login.attempt_logout() |
| 171 | 171 |
| 172 (self.username, self.password) = self.__resolve_creds(creds) | 172 (self.username, self.password) = self.__resolve_creds(creds) |
| 173 # Ensure there's no stale cryptohome from previous tests. | 173 # Ensure there's no stale cryptohome from previous tests. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 self.stop_authserver() | 332 self.stop_authserver() |
| 333 self.__log_crashed_processes(self.crash_blacklist) | 333 self.__log_crashed_processes(self.crash_blacklist) |
| 334 | 334 |
| 335 | 335 |
| 336 def get_auth_endpoint_misses(self): | 336 def get_auth_endpoint_misses(self): |
| 337 if hasattr(self, '_authServer'): | 337 if hasattr(self, '_authServer'): |
| 338 return self._authServer.get_endpoint_misses() | 338 return self._authServer.get_endpoint_misses() |
| 339 else: | 339 else: |
| 340 return {} | 340 return {} |
| OLD | NEW |