| 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 logging, os, utils, signal, time | 5 import logging, os, utils, signal, time |
| 6 from autotest_lib.client.bin import chromeos_constants, test | 6 from autotest_lib.client.bin import chromeos_constants, test |
| 7 from autotest_lib.client.common_lib import error, site_ui | 7 from autotest_lib.client.common_lib import error, site_ui |
| 8 | 8 |
| 9 | 9 |
| 10 def setup_autox(test): | 10 def setup_autox(test): |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 'xscreensaver after %i seconds' % | 84 'xscreensaver after %i seconds' % |
| 85 time.time() - start_time) | 85 time.time() - start_time) |
| 86 return False | 86 return False |
| 87 | 87 |
| 88 return True | 88 return True |
| 89 | 89 |
| 90 | 90 |
| 91 def nuke_login_manager(): | 91 def nuke_login_manager(): |
| 92 nuke_process_by_name('session_manager') | 92 nuke_process_by_name('session_manager') |
| 93 wait_for_browser() | 93 wait_for_browser() |
| 94 |
| 94 | 95 |
| 95 def nuke_process_by_name(name, with_prejudice=False): | 96 def nuke_process_by_name(name, with_prejudice=False): |
| 96 pid = int(utils.system_output('pgrep -o ^%s$' % name)) | 97 pid = int(utils.system_output('pgrep -o ^%s$' % name)) |
| 97 if with_prejudice: | 98 if with_prejudice: |
| 98 utils.nuke_pid(pid, [signal.SIGKILL]) | 99 utils.nuke_pid(pid, [signal.SIGKILL]) |
| 99 else: | 100 else: |
| 100 utils.nuke_pid(pid) | 101 utils.nuke_pid(pid) |
| OLD | NEW |