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

Unified Diff: build/android/pylib/local/device/local_device_environment.py

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/local/device/local_device_environment.py
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py
index 72acb6e2ec44e71ce1922b88225888035123a68d..0d02ca3e2f8eb81e91bfff8543e488a800b9db25 100644
--- a/build/android/pylib/local/device/local_device_environment.py
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -13,26 +13,24 @@ class LocalDeviceEnvironment(environment.Environment):
def __init__(self, args, _error_func):
super(LocalDeviceEnvironment, self).__init__()
- self._device = args.test_device
+ self._device_serial = args.test_device
self._devices = []
self._max_tries = 1 + args.num_retries
self._tool_name = args.tool
#override
def SetUp(self):
- # TODO(jbudorick): This can be refined to support filters etc.
- available_devices = adb_wrapper.AdbWrapper.GetDevices()
+ available_devices = device_utils.DeviceUtils.HealthyDevices()
if not available_devices:
raise device_errors.NoDevicesError
- if self._device:
- if self._device not in available_devices:
+ if self._device_serial:
+ self._devices = [d for d in available_devices
+ if d.adb.GetDeviceSerial == self._device_serial]
+ if not self._devices:
raise device_errors.DeviceUnreachableError(
- 'Could not find device %r' % self._device)
- self._devices = [device_utils.DeviceUtils(self._device)]
+ 'Could not find device %r' % self._device_serial)
else:
- self._devices = [
- device_utils.DeviceUtils(s)
- for s in available_devices]
+ self._devices = available_devices
@property
def devices(self):

Powered by Google App Engine
This is Rietveld 408576698