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 functools | 6 import functools |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import tempfile | 10 import tempfile |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 on_failure(dev, f.__name__) | 70 on_failure(dev, f.__name__) |
71 return None | 71 return None |
72 | 72 |
73 return wrapper | 73 return wrapper |
74 | 74 |
75 return decorator | 75 return decorator |
76 | 76 |
77 | 77 |
78 class LocalDeviceEnvironment(environment.Environment): | 78 class LocalDeviceEnvironment(environment.Environment): |
79 | 79 |
80 def __init__(self, args, _error_func): | 80 def __init__(self, args, output_manager, _error_func): |
81 super(LocalDeviceEnvironment, self).__init__() | 81 super(LocalDeviceEnvironment, self).__init__(output_manager) |
82 self._blacklist = (device_blacklist.Blacklist(args.blacklist_file) | 82 self._blacklist = (device_blacklist.Blacklist(args.blacklist_file) |
83 if args.blacklist_file | 83 if args.blacklist_file |
84 else None) | 84 else None) |
85 self._device_serials = args.test_devices | 85 self._device_serials = args.test_devices |
86 self._devices_lock = threading.Lock() | 86 self._devices_lock = threading.Lock() |
87 self._devices = None | 87 self._devices = None |
88 self._concurrent_adb = args.enable_concurrent_adb | 88 self._concurrent_adb = args.enable_concurrent_adb |
89 self._enable_device_cache = args.enable_device_cache | 89 self._enable_device_cache = args.enable_device_cache |
90 self._logcat_monitors = [] | 90 self._logcat_monitors = [] |
91 self._logcat_output_dir = args.logcat_output_dir | 91 self._logcat_output_dir = args.logcat_output_dir |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if not trace_event.trace_is_enabled(): | 271 if not trace_event.trace_is_enabled(): |
272 logging.warning('Tracing is not running.') | 272 logging.warning('Tracing is not running.') |
273 else: | 273 else: |
274 trace_event.trace_disable() | 274 trace_event.trace_disable() |
275 | 275 |
276 def EnableTracing(self): | 276 def EnableTracing(self): |
277 if trace_event.trace_is_enabled(): | 277 if trace_event.trace_is_enabled(): |
278 logging.warning('Tracing is already running.') | 278 logging.warning('Tracing is already running.') |
279 else: | 279 else: |
280 trace_event.trace_enable(self._trace_output) | 280 trace_event.trace_enable(self._trace_output) |
OLD | NEW |