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

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

Issue 1101603002: [Android] Rework device filtering and add DeviceUtils.HealthyDevices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perezju comments Created 5 years, 8 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
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8346762371c03883cdac138ab17a7ae6b754d053..0d02ca3e2f8eb81e91bfff8543e488a800b9db25 100644
--- a/build/android/pylib/local/device/local_device_environment.py
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -5,7 +5,6 @@
from pylib.base import environment
from pylib.device import adb_wrapper
from pylib.device import device_errors
-from pylib.device import device_filter
from pylib.device import device_utils
from pylib.utils import parallelizer
@@ -14,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):
- available_devices = adb_wrapper.AdbWrapper.Devices(
- filters=device_filter.DefaultFilters())
+ 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):
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698