| 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 errno, logging, os, re, utils, signal, subprocess, time | 5 import errno, logging, os, re, utils, signal, subprocess, time |
| 6 from autotest_lib.client.bin import chromeos_constants, site_cryptohome | 6 from autotest_lib.client.bin import chromeos_constants, site_cryptohome |
| 7 from autotest_lib.client.bin import site_utils, test | 7 from autotest_lib.client.bin import site_utils, test |
| 8 from autotest_lib.client.common_lib import error, log_watcher, site_ui | 8 from autotest_lib.client.common_lib import error, log_watcher, site_ui |
| 9 | 9 |
| 10 _DEFAULT_TIMEOUT = 30 | 10 _DEFAULT_TIMEOUT = 30 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 Args: | 285 Args: |
| 286 timeout: float number of seconds to wait | 286 timeout: float number of seconds to wait |
| 287 | 287 |
| 288 Raises: | 288 Raises: |
| 289 UnexpectedCondition: called while already logged in | 289 UnexpectedCondition: called while already logged in |
| 290 TimeoutError: chrome didn't start before timeout | 290 TimeoutError: chrome didn't start before timeout |
| 291 """ | 291 """ |
| 292 if logged_in(): | 292 if logged_in(): |
| 293 raise UnexpectedCondition('Already logged in') | 293 raise UnexpectedCondition('Already logged in') |
| 294 wait_for_browser() |
| 295 wait_for_login_prompt() |
| 294 try: | 296 try: |
| 295 os.unlink(chromeos_constants.LOGIN_PROMPT_READY_MAGIC_FILE) | 297 os.unlink(chromeos_constants.LOGIN_PROMPT_READY_MAGIC_FILE) |
| 296 except OSError, e: | 298 except OSError, e: |
| 297 if e.errno != errno.ENOENT: | 299 if e.errno != errno.ENOENT: |
| 298 raise e | 300 raise e |
| 299 wait_for_browser() | |
| 300 nuke_process_by_name(chromeos_constants.BROWSER, with_prejudice=True) | 301 nuke_process_by_name(chromeos_constants.BROWSER, with_prejudice=True) |
| 301 wait_for_browser() | 302 wait_for_browser() |
| 302 wait_for_login_prompt() | 303 wait_for_login_prompt() |
| OLD | NEW |