OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Class for running uiautomator tests on a single device.""" | 5 """Class for running uiautomator tests on a single device.""" |
6 | 6 |
7 from pylib import constants | 7 from pylib import constants |
8 from pylib import flag_changer | 8 from pylib import flag_changer |
9 from pylib.device import intent | 9 from pylib.device import intent |
10 from pylib.instrumentation import test_options as instr_test_options | 10 from pylib.instrumentation import test_options as instr_test_options |
(...skipping 21 matching lines...) Expand all Loading... |
32 test_options.exclude_annotations, | 32 test_options.exclude_annotations, |
33 test_options.test_filter, | 33 test_options.test_filter, |
34 test_options.test_data, | 34 test_options.test_data, |
35 test_options.save_perf_json, | 35 test_options.save_perf_json, |
36 test_options.screenshot_failures, | 36 test_options.screenshot_failures, |
37 wait_for_debugger=False, | 37 wait_for_debugger=False, |
38 coverage_dir=None, | 38 coverage_dir=None, |
39 test_apk=None, | 39 test_apk=None, |
40 test_apk_path=None, | 40 test_apk_path=None, |
41 test_apk_jar_path=None, | 41 test_apk_jar_path=None, |
| 42 test_runner=None, |
42 test_support_apk_path=None) | 43 test_support_apk_path=None) |
43 super(TestRunner, self).__init__(instrumentation_options, device, | 44 super(TestRunner, self).__init__(instrumentation_options, device, |
44 shard_index, test_pkg) | 45 shard_index, test_pkg) |
45 | 46 |
46 cmdline_file = constants.PACKAGE_INFO[test_options.package].cmdline_file | 47 cmdline_file = constants.PACKAGE_INFO[test_options.package].cmdline_file |
47 self.flags = None | 48 self.flags = None |
48 if cmdline_file: | 49 if cmdline_file: |
49 self.flags = flag_changer.FlagChanger(self.device, cmdline_file) | 50 self.flags = flag_changer.FlagChanger(self.device, cmdline_file) |
50 self._package = constants.PACKAGE_INFO[test_options.package].package | 51 self._package = constants.PACKAGE_INFO[test_options.package].package |
51 self._activity = constants.PACKAGE_INFO[test_options.package].activity | 52 self._activity = constants.PACKAGE_INFO[test_options.package].activity |
(...skipping 15 matching lines...) Expand all Loading... |
67 else: | 68 else: |
68 self.flags.AddFlags(['--disable-fre']) | 69 self.flags.AddFlags(['--disable-fre']) |
69 self.device.StartActivity( | 70 self.device.StartActivity( |
70 intent.Intent(action='android.intent.action.MAIN', | 71 intent.Intent(action='android.intent.action.MAIN', |
71 activity=self._activity, | 72 activity=self._activity, |
72 package=self._package), | 73 package=self._package), |
73 blocking=True, | 74 blocking=True, |
74 force_stop=True) | 75 force_stop=True) |
75 return self.device.old_interface.RunUIAutomatorTest( | 76 return self.device.old_interface.RunUIAutomatorTest( |
76 test, self.test_pkg.GetPackageName(), timeout) | 77 test, self.test_pkg.GetPackageName(), timeout) |
OLD | NEW |