Chromium Code Reviews| 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:54
from the other review:
Perhaps we should either:
rnephew (Wrong account)
2015/02/02 20:41:03
Alternatively, I was thinking of having device_typ
|
| + 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): |