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