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 | |
7 import psutil | 6 import psutil |
8 import signal | 7 import signal |
9 | 8 |
10 from pylib import android_commands | 9 from pylib import android_commands |
11 | 10 |
12 | 11 |
13 def _KillWebServers(): | 12 def _KillWebServers(): |
14 for s in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT, signal.SIGKILL]: | 13 for s in [signal.SIGTERM, signal.SIGINT, signal.SIGQUIT, signal.SIGKILL]: |
15 signalled = [] | 14 signalled = [] |
16 for server in ['lighttpd', 'webpagereplay']: | 15 for server in ['lighttpd', 'webpagereplay']: |
(...skipping 20 matching lines...) Expand all Loading... |
37 did_restart_host_adb = False | 36 did_restart_host_adb = False |
38 for device in android_commands.GetAttachedDevices(): | 37 for device in android_commands.GetAttachedDevices(): |
39 adb = android_commands.AndroidCommands(device, api_strict_mode=True) | 38 adb = android_commands.AndroidCommands(device, api_strict_mode=True) |
40 # Make sure we restart the host adb server only once. | 39 # Make sure we restart the host adb server only once. |
41 if not did_restart_host_adb: | 40 if not did_restart_host_adb: |
42 adb.RestartAdbServer() | 41 adb.RestartAdbServer() |
43 did_restart_host_adb = True | 42 did_restart_host_adb = True |
44 adb.RestartAdbdOnDevice() | 43 adb.RestartAdbdOnDevice() |
45 adb.EnableAdbRoot() | 44 adb.EnableAdbRoot() |
46 adb.WaitForDevicePm() | 45 adb.WaitForDevicePm() |
OLD | NEW |