OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Base class for Android Python-driven tests. | 5 """Base class for Android Python-driven tests. |
6 | 6 |
7 This test case is intended to serve as the base class for any Python-driven | 7 This test case is intended to serve as the base class for any Python-driven |
8 tests. It is similar to the Python unitttest module in that the user's tests | 8 tests. It is similar to the Python unitttest module in that the user's tests |
9 inherit from this case and add their tests in that case. | 9 inherit from this case and add their tests in that case. |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 test: name of the test method to run (e.g. testFooBar) | 73 test: name of the test method to run (e.g. testFooBar) |
74 | 74 |
75 Returns: | 75 Returns: |
76 TestRunResults object with a single test result. | 76 TestRunResults object with a single test result. |
77 """ | 77 """ |
78 test = self._ComposeFullTestName(fname, suite, test) | 78 test = self._ComposeFullTestName(fname, suite, test) |
79 test_pkg = test_package.TestPackage( | 79 test_pkg = test_package.TestPackage( |
80 self.options.test_apk_path, self.options.test_apk_jar_path) | 80 self.options.test_apk_path, self.options.test_apk_jar_path) |
81 java_test_runner = test_runner.TestRunner(self.options.build_type, | 81 java_test_runner = test_runner.TestRunner(self.options.build_type, |
82 self.options.test_data, | 82 self.options.test_data, |
83 self.options.install_apk, | |
84 self.options.save_perf_json, | 83 self.options.save_perf_json, |
85 self.options.screenshot_failures, | 84 self.options.screenshot_failures, |
86 self.options.tool, | 85 self.options.tool, |
87 self.options.wait_for_debugger, | 86 self.options.wait_for_debugger, |
88 self.options.disable_assertions, | 87 self.options.disable_assertions, |
89 self.options.push_deps, | 88 self.options.push_deps, |
90 self.options.cleanup_test_files, | 89 self.options.cleanup_test_files, |
91 self.device_id, | 90 self.device_id, |
92 self.shard_index, test_pkg, | 91 self.shard_index, test_pkg, |
93 self.ports_to_forward) | 92 self.ports_to_forward) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 134 |
136 def _ComposeFullTestName(self, fname, suite, test): | 135 def _ComposeFullTestName(self, fname, suite, test): |
137 package_name = self._GetPackageName(fname) | 136 package_name = self._GetPackageName(fname) |
138 return package_name + '.' + suite + '#' + test | 137 return package_name + '.' + suite + '#' + test |
139 | 138 |
140 def _GetPackageName(self, fname): | 139 def _GetPackageName(self, fname): |
141 """Extracts the package name from the test file path.""" | 140 """Extracts the package name from the test file path.""" |
142 dirname = os.path.dirname(fname) | 141 dirname = os.path.dirname(fname) |
143 package = dirname[dirname.rfind(BASE_ROOT) + len(BASE_ROOT):] | 142 package = dirname[dirname.rfind(BASE_ROOT) + len(BASE_ROOT):] |
144 return package.replace(os.sep, '.') | 143 return package.replace(os.sep, '.') |
OLD | NEW |