Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: client/bin/site_login.py

Issue 3342011: Poll X server for login prompt, in addition to watching file system (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() 294 wait_for_browser()
295 wait_for_login_prompt() 295 wait_for_login_prompt()
296 oldpid = __get_session_manager_pid()
296 try: 297 try:
297 os.unlink(chromeos_constants.LOGIN_PROMPT_READY_MAGIC_FILE) 298 os.unlink(chromeos_constants.LOGIN_PROMPT_READY_MAGIC_FILE)
298 except OSError, e: 299 except OSError, e:
299 if e.errno != errno.ENOENT: 300 if e.errno != errno.ENOENT:
300 raise e 301 raise e
301 nuke_process_by_name(chromeos_constants.BROWSER, with_prejudice=True) 302 nuke_login_manager()
302 wait_for_browser() 303 site_utils.poll_for_condition(
304 lambda: __session_manager_restarted(oldpid),
305 TimeoutError('Timed out waiting for logout'),
306 timeout)
303 wait_for_login_prompt() 307 wait_for_login_prompt()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698