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

Unified Diff: build/android/pylib/uirobot/uirobot_test_instance.py

Issue 879983002: Add multiple device/os filtering and a config file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « build/android/pylib/remote/device/remote_device_test_run.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/uirobot/uirobot_test_instance.py
diff --git a/build/android/pylib/uirobot/uirobot_test_instance.py b/build/android/pylib/uirobot/uirobot_test_instance.py
index f73c569e619166b2959d8e18f1975b7990a562b0..d30c33ea1407956e96b97df6ba2305088283a847 100644
--- a/build/android/pylib/uirobot/uirobot_test_instance.py
+++ b/build/android/pylib/uirobot/uirobot_test_instance.py
@@ -3,6 +3,8 @@
# found in the LICENSE file.
import os
+import json
+import logging
from pylib import constants
from pylib.base import test_instance
@@ -20,16 +22,28 @@ class UirobotTestInstance(test_instance.TestInstance):
if not args.app_under_test:
error_func('Must set --app-under-test.')
self._app_under_test = args.app_under_test
+ self._minutes = args.minutes
+
+ if args.remote_device_file:
+ with open(args.remote_device_file) as remote_device_file:
+ device_json = json.load(remote_device_file)
+ else:
+ device_json = {}
+
+ device_type = device_json.get('device_type', 'Android')
jbudorick 2015/02/02 20:28:06 Perhaps we should either: - have the remote_devic
+ if args.device_type:
+ if device_type and device_type != args.device_type:
+ logging.info('Overriding device_type from %s to %s',
+ device_type, args.device_type)
+ device_type = args.device_type
- if args.device_type == 'Android':
+ if device_type == 'Android':
self._suite = 'Android Uirobot'
self._package_name = apk_helper.GetPackageName(self._app_under_test)
-
- elif args.device_type == 'iOS':
+ elif device_type == 'iOS':
self._suite = 'iOS Uirobot'
self._package_name = self._app_under_test
- self._minutes = args.minutes
#override
def TestType(self):
« no previous file with comments | « build/android/pylib/remote/device/remote_device_test_run.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698