Chromium Code Reviews| Index: build/android/pylib/base/test_instance_factory.py |
| diff --git a/build/android/pylib/base/test_instance_factory.py b/build/android/pylib/base/test_instance_factory.py |
| index 6fd3ca9b74ac8471ae91d8b2c4dafe4125b0bff1..2df1196c12fc55e0826e0b12631e1874f2a5b3e8 100644 |
| --- a/build/android/pylib/base/test_instance_factory.py |
| +++ b/build/android/pylib/base/test_instance_factory.py |
| @@ -2,20 +2,31 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import os |
| +import sys |
| + |
| from pylib import constants |
| from pylib.gtest import gtest_test_instance |
| from pylib.utils import isolator |
| -from pylib.uirobot import uirobot_test_instance |
| - |
| +from pylib.uirobot import uirobot_test_instance as android_uirobot_test_instance |
|
jbudorick
2015/01/09 22:06:50
We generally try to avoid aliasing, but until we m
rnephew (Wrong account)
2015/01/09 23:35:36
Acknowledged.
|
| +sys.path.append(os.path.join( |
| + constants.DIR_SOURCE_ROOT, 'build', 'mobile')) |
| +from bling.pylib.uirobot import ( |
|
jbudorick
2015/01/09 22:06:50
ios
rnephew (Wrong account)
2015/01/09 23:35:36
Done.
|
| + uirobot_test_instance as ios_uirobot_test_instance) |
| def CreateTestInstance(args, error_func): |
| - if args.command == 'gtest': |
| - return gtest_test_instance.GtestTestInstance( |
| - args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func) |
| - if args.command == 'uirobot': |
| - return uirobot_test_instance.UirobotTestInstance(args) |
| - # TODO(jbudorick) Add instrumentation test instance. |
| + if args.device_type == 'Android': |
| + if args.command == 'gtest': |
| + return gtest_test_instance.GtestTestInstance( |
| + args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func) |
| + if args.command == 'uirobot': |
| + return android_uirobot_test_instance.UirobotTestInstance(args) |
| + # TODO(jbudorick) Add instrumentation test instance. |
| + |
| + if args.device_type == 'iOS': |
| + if args.command == 'uirobot': |
| + return ios_uirobot_test_instance.UirobotTestInstance(args) |
| error_func('Unable to create %s test instance.' % args.command) |