OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | |
6 import sys | |
7 | |
5 from pylib import constants | 8 from pylib import constants |
6 from pylib.gtest import gtest_test_instance | 9 from pylib.gtest import gtest_test_instance |
7 from pylib.utils import isolator | 10 from pylib.utils import isolator |
8 from pylib.uirobot import uirobot_test_instance | 11 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.
| |
9 | 12 |
10 | 13 sys.path.append(os.path.join( |
14 constants.DIR_SOURCE_ROOT, 'build', 'mobile')) | |
15 from bling.pylib.uirobot import ( | |
jbudorick
2015/01/09 22:06:50
ios
rnephew (Wrong account)
2015/01/09 23:35:36
Done.
| |
16 uirobot_test_instance as ios_uirobot_test_instance) | |
11 | 17 |
12 def CreateTestInstance(args, error_func): | 18 def CreateTestInstance(args, error_func): |
13 | 19 |
14 if args.command == 'gtest': | 20 if args.device_type == 'Android': |
15 return gtest_test_instance.GtestTestInstance( | 21 if args.command == 'gtest': |
16 args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func) | 22 return gtest_test_instance.GtestTestInstance( |
17 if args.command == 'uirobot': | 23 args, isolator.Isolator(constants.ISOLATE_DEPS_DIR), error_func) |
18 return uirobot_test_instance.UirobotTestInstance(args) | 24 if args.command == 'uirobot': |
19 # TODO(jbudorick) Add instrumentation test instance. | 25 return android_uirobot_test_instance.UirobotTestInstance(args) |
26 # TODO(jbudorick) Add instrumentation test instance. | |
27 | |
28 if args.device_type == 'iOS': | |
29 if args.command == 'uirobot': | |
30 return ios_uirobot_test_instance.UirobotTestInstance(args) | |
20 | 31 |
21 error_func('Unable to create %s test instance.' % args.command) | 32 error_func('Unable to create %s test instance.' % args.command) |
OLD | NEW |