OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 datetime | 5 import datetime |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import tempfile | 9 import tempfile |
10 import threading | 10 import threading |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 logcat_file = os.path.join( | 80 logcat_file = os.path.join( |
81 self._logcat_output_dir, | 81 self._logcat_output_dir, |
82 '%s_%s' % (d.adb.GetDeviceSerial(), | 82 '%s_%s' % (d.adb.GetDeviceSerial(), |
83 datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%S'))) | 83 datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%S'))) |
84 monitor = logcat_monitor.LogcatMonitor( | 84 monitor = logcat_monitor.LogcatMonitor( |
85 d.adb, clear=True, output_file=logcat_file) | 85 d.adb, clear=True, output_file=logcat_file) |
86 self._logcat_monitors.append(monitor) | 86 self._logcat_monitors.append(monitor) |
87 monitor.Start() | 87 monitor.Start() |
88 | 88 |
89 @property | 89 @property |
| 90 def blacklist(self): |
| 91 return self._blacklist |
| 92 |
| 93 @property |
90 def concurrent_adb(self): | 94 def concurrent_adb(self): |
91 return self._concurrent_adb | 95 return self._concurrent_adb |
92 | 96 |
93 @property | 97 @property |
94 def devices(self): | 98 def devices(self): |
95 if not self._devices: | 99 if not self._devices: |
96 raise device_errors.NoDevicesError() | 100 raise device_errors.NoDevicesError() |
97 return self._devices | 101 return self._devices |
98 | 102 |
99 @property | 103 @property |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 [m.output_file for m in self._logcat_monitors]) | 135 [m.output_file for m in self._logcat_monitors]) |
132 shutil.rmtree(self._logcat_output_dir) | 136 shutil.rmtree(self._logcat_output_dir) |
133 | 137 |
134 def BlacklistDevice(self, device, reason='local_device_failure'): | 138 def BlacklistDevice(self, device, reason='local_device_failure'): |
135 device_serial = device.adb.GetDeviceSerial() | 139 device_serial = device.adb.GetDeviceSerial() |
136 if self._blacklist: | 140 if self._blacklist: |
137 self._blacklist.Extend([device_serial], reason=reason) | 141 self._blacklist.Extend([device_serial], reason=reason) |
138 with self._devices_lock: | 142 with self._devices_lock: |
139 self._devices = [d for d in self._devices if str(d) != device_serial] | 143 self._devices = [d for d in self._devices if str(d) != device_serial] |
140 | 144 |
OLD | NEW |