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 from devil.android import device_blacklist | 5 from devil.android import device_blacklist |
6 from devil.android import device_errors | 6 from devil.android import device_errors |
7 from devil.android import device_utils | 7 from devil.android import device_utils |
8 from devil.android.sdk import adb_wrapper | 8 from devil.android.sdk import adb_wrapper |
9 from devil.utils import parallelizer | 9 from devil.utils import parallelizer |
10 from pylib.base import environment | 10 from pylib.base import environment |
11 | 11 |
12 | 12 |
13 class LocalDeviceEnvironment(environment.Environment): | 13 class LocalDeviceEnvironment(environment.Environment): |
14 | 14 |
15 def __init__(self, args, _error_func): | 15 def __init__(self, args, _error_func): |
16 super(LocalDeviceEnvironment, self).__init__() | 16 super(LocalDeviceEnvironment, self).__init__() |
17 self._blacklist = (device_blacklist.Blacklist(args.blacklist_file) | 17 self._blacklist = device_blacklist.Blacklist( |
18 if args.blacklist_file | 18 args.blacklist_file or device_blacklist.BLACKLIST_JSON) |
19 else None) | |
20 self._device_serial = args.test_device | 19 self._device_serial = args.test_device |
21 self._devices = [] | 20 self._devices = [] |
22 self._max_tries = 1 + args.num_retries | 21 self._max_tries = 1 + args.num_retries |
23 self._tool_name = args.tool | 22 self._tool_name = args.tool |
24 | 23 |
25 #override | 24 #override |
26 def SetUp(self): | 25 def SetUp(self): |
27 available_devices = device_utils.DeviceUtils.HealthyDevices( | 26 available_devices = device_utils.DeviceUtils.HealthyDevices( |
28 self._blacklist) | 27 self._blacklist) |
29 if not available_devices: | 28 if not available_devices: |
(...skipping 20 matching lines...) Expand all Loading... |
50 return self._max_tries | 49 return self._max_tries |
51 | 50 |
52 @property | 51 @property |
53 def tool(self): | 52 def tool(self): |
54 return self._tool_name | 53 return self._tool_name |
55 | 54 |
56 #override | 55 #override |
57 def TearDown(self): | 56 def TearDown(self): |
58 pass | 57 pass |
59 | 58 |
OLD | NEW |