| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium 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 logging | 5 import logging |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from telemetry.core import exceptions | 8 from telemetry.core import exceptions |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry import decorators | 10 from telemetry import decorators |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 # incognito browser in a separate process, which we need to wait for. | 134 # incognito browser in a separate process, which we need to wait for. |
| 135 util.WaitFor(lambda: pid != self.pid, 10) | 135 util.WaitFor(lambda: pid != self.pid, 10) |
| 136 elif self.browser_options.gaia_login: | 136 elif self.browser_options.gaia_login: |
| 137 self.oobe.NavigateGaiaLogin(self._username, self._password) | 137 self.oobe.NavigateGaiaLogin(self._username, self._password) |
| 138 else: | 138 else: |
| 139 self.oobe.NavigateFakeLogin(self._username, self._password, | 139 self.oobe.NavigateFakeLogin(self._username, self._password, |
| 140 self._gaia_id, not self.browser_options.disable_gaia_services) | 140 self._gaia_id, not self.browser_options.disable_gaia_services) |
| 141 | 141 |
| 142 self._WaitForLogin() | 142 self._WaitForLogin() |
| 143 except exceptions.TimeoutException: | 143 except exceptions.TimeoutException: |
| 144 self._cri.TakeScreenShot('login-screen') | 144 self._cri.TakeScreenshotWithPrefix('login-screen') |
| 145 raise exceptions.LoginException('Timed out going through login screen. ' | 145 raise exceptions.LoginException('Timed out going through login screen. ' |
| 146 + self._GetLoginStatus()) | 146 + self._GetLoginStatus()) |
| 147 | 147 |
| 148 logging.info('Browser is up!') | 148 logging.info('Browser is up!') |
| 149 | 149 |
| 150 def Close(self): | 150 def Close(self): |
| 151 super(CrOSBrowserBackend, self).Close() | 151 super(CrOSBrowserBackend, self).Close() |
| 152 | 152 |
| 153 if self._cri: | 153 if self._cri: |
| 154 self._cri.RestartUI(False) # Logs out. | 154 self._cri.RestartUI(False) # Logs out. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 # Wait for cryptohome to mount. | 225 # Wait for cryptohome to mount. |
| 226 util.WaitFor(self._IsLoggedIn, 60) | 226 util.WaitFor(self._IsLoggedIn, 60) |
| 227 | 227 |
| 228 # For incognito mode, the session manager actually relaunches chrome with | 228 # For incognito mode, the session manager actually relaunches chrome with |
| 229 # new arguments, so we have to wait for the browser to come up. | 229 # new arguments, so we have to wait for the browser to come up. |
| 230 self._WaitForBrowserToComeUp() | 230 self._WaitForBrowserToComeUp() |
| 231 | 231 |
| 232 # Wait for extensions to load. | 232 # Wait for extensions to load. |
| 233 if self._supports_extensions: | 233 if self._supports_extensions: |
| 234 self._WaitForExtensionsToLoad() | 234 self._WaitForExtensionsToLoad() |
| OLD | NEW |