Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: build/android/pylib/local/device/local_device_environment.py

Issue 1292053006: Revert of [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 pylib.base import environment 5 from pylib.base import environment
6 from pylib.device import adb_wrapper 6 from pylib.device import adb_wrapper
7 from pylib.device import device_blacklist
8 from pylib.device import device_errors 7 from pylib.device import device_errors
9 from pylib.device import device_utils 8 from pylib.device import device_utils
10 from pylib.utils import parallelizer 9 from pylib.utils import parallelizer
11 10
12 11
13 class LocalDeviceEnvironment(environment.Environment): 12 class LocalDeviceEnvironment(environment.Environment):
14 13
15 def __init__(self, args, _error_func): 14 def __init__(self, args, _error_func):
16 super(LocalDeviceEnvironment, self).__init__() 15 super(LocalDeviceEnvironment, self).__init__()
17 self._blacklist = device_blacklist.Blacklist(
18 args.blacklist_file or device_blacklist.BLACKLIST_JSON)
19 self._device_serial = args.test_device 16 self._device_serial = args.test_device
20 self._devices = [] 17 self._devices = []
21 self._max_tries = 1 + args.num_retries 18 self._max_tries = 1 + args.num_retries
22 self._tool_name = args.tool 19 self._tool_name = args.tool
23 20
24 #override 21 #override
25 def SetUp(self): 22 def SetUp(self):
26 available_devices = device_utils.DeviceUtils.HealthyDevices( 23 available_devices = device_utils.DeviceUtils.HealthyDevices()
27 self._blacklist)
28 if not available_devices: 24 if not available_devices:
29 raise device_errors.NoDevicesError 25 raise device_errors.NoDevicesError
30 if self._device_serial: 26 if self._device_serial:
31 self._devices = [d for d in available_devices 27 self._devices = [d for d in available_devices
32 if d.adb.GetDeviceSerial() == self._device_serial] 28 if d.adb.GetDeviceSerial() == self._device_serial]
33 if not self._devices: 29 if not self._devices:
34 raise device_errors.DeviceUnreachableError( 30 raise device_errors.DeviceUnreachableError(
35 'Could not find device %r' % self._device_serial) 31 'Could not find device %r' % self._device_serial)
36 else: 32 else:
37 self._devices = available_devices 33 self._devices = available_devices
(...skipping 11 matching lines...) Expand all
49 return self._max_tries 45 return self._max_tries
50 46
51 @property 47 @property
52 def tool(self): 48 def tool(self):
53 return self._tool_name 49 return self._tool_name
54 50
55 #override 51 #override
56 def TearDown(self): 52 def TearDown(self):
57 pass 53 pass
58 54
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_jar.py ('k') | build/android/pylib/perf/perf_control_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698