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 import glob | 5 import glob |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 from base_test_runner import BaseTestRunner | 10 from base_test_runner import BaseTestRunner |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 else: | 49 else: |
50 self.dump_debug_info = None | 50 self.dump_debug_info = None |
51 self.fast_and_loose = fast_and_loose | 51 self.fast_and_loose = fast_and_loose |
52 | 52 |
53 logging.warning('Test suite: ' + test_suite) | 53 logging.warning('Test suite: ' + test_suite) |
54 if os.path.splitext(test_suite)[1] == '.apk': | 54 if os.path.splitext(test_suite)[1] == '.apk': |
55 self.test_package = TestPackageApk(self.adb, device, | 55 self.test_package = TestPackageApk(self.adb, device, |
56 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, | 56 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, |
57 self.tool, self.dump_debug_info) | 57 self.tool, self.dump_debug_info) |
58 else: | 58 else: |
59 # Put a copy into the android out/target directory, to allow stack trace | |
60 # generation. | |
61 symbols_dir = os.path.join(constants.CHROME_DIR, 'out', build_type, | |
62 'lib.target') | |
59 self.test_package = TestPackageExecutable( | 63 self.test_package = TestPackageExecutable( |
60 self.adb, device, | 64 self.adb, device, |
61 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, | 65 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, |
62 self.tool, self.dump_debug_info) | 66 self.tool, self.dump_debug_info, symbols_dir) |
63 self._performance_test_setup = None | 67 self._performance_test_setup = None |
64 if performance_test: | 68 if performance_test: |
65 self._performance_test_setup = perf_tests_helper.PerfTestSetup(self.adb) | 69 self._performance_test_setup = perf_tests_helper.PerfTestSetup(self.adb) |
66 | 70 |
67 def _TestSuiteRequiresMockTestServer(self): | 71 def _TestSuiteRequiresMockTestServer(self): |
68 """Returns True if the test suite requires mock test server.""" | 72 """Returns True if the test suite requires mock test server.""" |
69 return False | 73 tests_require_net_test_server = ['unit_tests', 'net_unittests', |
70 # TODO(yfriedman): Disabled because of flakiness. | 74 'content_unittests'] |
71 # (self.test_package.test_suite_basename == 'unit_tests' or | 75 return (self.test_package.test_suite_basename in |
72 # self.test_package.test_suite_basename == 'net_unittests' or | 76 tests_require_net_test_server) |
73 # False) | |
Anthony Berent
2012/10/25 16:02:05
No longer flaky
| |
74 | 77 |
75 def _GetFilterFileName(self): | 78 def _GetFilterFileName(self): |
76 """Returns the filename of gtest filter.""" | 79 """Returns the filename of gtest filter.""" |
77 return os.path.join(sys.path[0], 'gtest_filter', | 80 return os.path.join(sys.path[0], 'gtest_filter', |
78 self.test_package.test_suite_basename + '_disabled') | 81 self.test_package.test_suite_basename + '_disabled') |
79 | 82 |
80 def _GetAdditionalEmulatorFilterName(self): | 83 def _GetAdditionalEmulatorFilterName(self): |
81 """Returns the filename of additional gtest filter for emulator.""" | 84 """Returns the filename of additional gtest filter for emulator.""" |
82 return os.path.join(sys.path[0], 'gtest_filter', | 85 return os.path.join(sys.path[0], 'gtest_filter', |
83 self.test_package.test_suite_basename + | 86 self.test_package.test_suite_basename + |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 ] | 192 ] |
190 if self.test_package.test_suite_basename == 'unit_tests': | 193 if self.test_package.test_suite_basename == 'unit_tests': |
191 test_files += ['chrome/test/data/simple_open_search.xml'] | 194 test_files += ['chrome/test/data/simple_open_search.xml'] |
192 # The following are spell check data. Now only list the data under | 195 # The following are spell check data. Now only list the data under |
193 # third_party/hunspell_dictionaries which are used by unit tests. | 196 # third_party/hunspell_dictionaries which are used by unit tests. |
194 old_cwd = os.getcwd() | 197 old_cwd = os.getcwd() |
195 os.chdir(constants.CHROME_DIR) | 198 os.chdir(constants.CHROME_DIR) |
196 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic') | 199 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic') |
197 os.chdir(old_cwd) | 200 os.chdir(old_cwd) |
198 return test_files | 201 return test_files |
202 elif self.test_package.test_suite_basename == 'media_unittests': | |
203 return [ | |
204 'media/test/data', | |
205 ] | |
199 elif self.test_package.test_suite_basename == 'net_unittests': | 206 elif self.test_package.test_suite_basename == 'net_unittests': |
200 return [ | 207 return [ |
201 'net/data/cache_tests', | 208 'net/data/cache_tests', |
202 'net/data/filter_unittests', | 209 'net/data/filter_unittests', |
203 'net/data/ftp', | 210 'net/data/ftp', |
204 'net/data/proxy_resolver_v8_unittest', | 211 'net/data/proxy_resolver_v8_unittest', |
205 'net/data/ssl/certificates', | 212 'net/data/ssl/certificates', |
206 'net/data/url_request_unittest/', | 213 'net/data/url_request_unittest/', |
207 'net/data/proxy_script_fetcher_unittest' | 214 'net/data/proxy_script_fetcher_unittest' |
208 ] | 215 ] |
209 elif self.test_package.test_suite_basename == 'ui_tests': | 216 elif self.test_package.test_suite_basename == 'ui_tests': |
210 return [ | 217 return [ |
211 'chrome/test/data/dromaeo', | 218 'chrome/test/data/dromaeo', |
212 'chrome/test/data/json2.js', | 219 'chrome/test/data/json2.js', |
213 'chrome/test/data/sunspider', | 220 'chrome/test/data/sunspider', |
214 'chrome/test/data/v8_benchmark', | 221 'chrome/test/data/v8_benchmark', |
215 'chrome/test/perf/sunspider_uitest.js', | 222 'chrome/test/perf/sunspider_uitest.js', |
216 'chrome/test/perf/v8_benchmark_uitest.js', | 223 'chrome/test/perf/v8_benchmark_uitest.js', |
217 ] | 224 ] |
218 elif self.test_package.test_suite_basename == 'page_cycler_tests': | |
219 data = [ | |
220 'tools/page_cycler', | |
221 'data/page_cycler', | |
222 ] | |
223 for d in data: | |
224 if not os.path.exists(d): | |
225 raise Exception('Page cycler data not found.') | |
226 return data | |
Anthony Berent
2012/10/25 16:02:05
Page cycler tests now run by other means.
| |
227 elif self.test_package.test_suite_basename == 'webkit_unit_tests': | 225 elif self.test_package.test_suite_basename == 'webkit_unit_tests': |
228 return [ | 226 return [ |
229 'third_party/WebKit/Source/WebKit/chromium/tests/data', | 227 'third_party/WebKit/Source/WebKit/chromium/tests/data', |
230 ] | 228 ] |
231 elif self.test_package.test_suite_basename == 'content_unittests': | 229 elif self.test_package.test_suite_basename == 'content_unittests': |
232 return [ | 230 return [ |
233 'content/test/data/gpu/webgl_conformance_test_expectations.txt', | 231 'content/test/data/gpu/webgl_conformance_test_expectations.txt', |
234 'net/data/ssl/certificates/', | 232 'net/data/ssl/certificates/', |
235 'webkit/data/dom_storage/webcore_test_database.localstorage', | 233 'webkit/data/dom_storage/webcore_test_database.localstorage', |
236 'third_party/hyphen/hyph_en_US.dic', | 234 'third_party/hyphen/hyph_en_US.dic', |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 self.tool.CleanUpEnvironment() | 332 self.tool.CleanUpEnvironment() |
335 if self.test_package.cleanup_test_files: | 333 if self.test_package.cleanup_test_files: |
336 self.adb.RemovePushedFiles() | 334 self.adb.RemovePushedFiles() |
337 if self.dump_debug_info: | 335 if self.dump_debug_info: |
338 self.dump_debug_info.StopRecordingLog() | 336 self.dump_debug_info.StopRecordingLog() |
339 if self._performance_test_setup: | 337 if self._performance_test_setup: |
340 self._performance_test_setup.TearDown() | 338 self._performance_test_setup.TearDown() |
341 if self.dump_debug_info: | 339 if self.dump_debug_info: |
342 self.dump_debug_info.ArchiveNewCrashFiles() | 340 self.dump_debug_info.ArchiveNewCrashFiles() |
343 super(SingleTestRunner, self).TearDown() | 341 super(SingleTestRunner, self).TearDown() |
OLD | NEW |