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

Unified Diff: build/android/pylib/remote/device/remote_device_environment.py

Issue 840393003: Add support for ios_uirobot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bling -> ios Created 5 years, 11 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/remote/device/remote_device_environment.py
diff --git a/build/android/pylib/remote/device/remote_device_environment.py b/build/android/pylib/remote/device/remote_device_environment.py
index 6936bcbd802e7aa3287533f38cfbd4d18f88d7b3..706ff3c55acd6d5f47fa946bd55bfd900035e9a7 100644
--- a/build/android/pylib/remote/device/remote_device_environment.py
+++ b/build/android/pylib/remote/device/remote_device_environment.py
@@ -62,6 +62,10 @@ class RemoteDeviceEnvironment(environment.Environment):
self._runner_type = args.runner_type
self._device = ''
self._verbose_count = args.verbose_count
+ if (args.device_type != 'Android'
+ and args.device_type != "iOS"):
+ error_func('device-type must be iOS or Android')
+ self._device_type=args.device_type
if not args.trigger and not args.collect:
self._trigger = True
@@ -128,7 +132,7 @@ class RemoteDeviceEnvironment(environment.Environment):
device_list = dev_list_res.json()['response']
random.shuffle(device_list)
for device in device_list:
- if device['os_name'] != 'Android':
+ if device['os_name'] != self._device_type:
continue
if self._remote_device and device['name'] != self._remote_device:
continue
@@ -150,9 +154,9 @@ class RemoteDeviceEnvironment(environment.Environment):
return c
return 0
- logging.critical('Available Android Devices:')
- android_devices = (d for d in device_list if d['os_name'] == 'Android')
- for d in sorted(android_devices, compare_devices):
+ logging.critical('Available %s Devices:', self._device_type)
+ devices = (d for d in device_list if d['os_name'] == self._device_type)
+ for d in sorted(devices, compare_devices):
logging.critical(' %s %s', d['os_version'].ljust(7), d['name'])
def _NoDeviceFound(self, device_list):

Powered by Google App Engine
This is Rietveld 408576698