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 logging | 5 import logging |
6 import os | 6 import os |
7 import sys | 7 import sys |
8 | 8 |
9 from base_test_runner import BaseTestRunner | 9 from base_test_runner import BaseTestRunner |
10 import debug_info | 10 import debug_info |
(...skipping 30 matching lines...) Expand all Loading... | |
41 self._test_arguments = test_arguments | 41 self._test_arguments = test_arguments |
42 self.test_results = TestResults() | 42 self.test_results = TestResults() |
43 if dump_debug_info: | 43 if dump_debug_info: |
44 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device, | 44 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device, |
45 os.path.basename(test_suite), gtest_filter) | 45 os.path.basename(test_suite), gtest_filter) |
46 else: | 46 else: |
47 self.dump_debug_info = None | 47 self.dump_debug_info = None |
48 self.fast_and_loose = fast_and_loose | 48 self.fast_and_loose = fast_and_loose |
49 | 49 |
50 if os.path.splitext(test_suite)[1] == '.apk': | 50 if os.path.splitext(test_suite)[1] == '.apk': |
51 self._apk_test_suite = True; | |
Yaron
2012/05/16 21:23:55
This violates the point of having TestPackage and
John Grabowski
2012/05/16 22:24:17
agree. E.g. use FilterName() as an overridable me
nilesh
2012/05/16 22:36:54
Done.
| |
51 self.test_package = TestPackageApk( | 52 self.test_package = TestPackageApk( |
52 self.adb, device, | 53 self.adb, device, |
53 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, | 54 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, |
54 tool, self.dump_debug_info) | 55 tool, self.dump_debug_info) |
55 else: | 56 else: |
57 self._apk_test_suite = False; | |
56 self.test_package = TestPackageExecutable( | 58 self.test_package = TestPackageExecutable( |
57 self.adb, device, | 59 self.adb, device, |
58 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, | 60 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, |
59 tool, self.dump_debug_info) | 61 tool, self.dump_debug_info) |
60 | 62 |
61 def _GetHttpServerDocumentRootForTestSuite(self): | 63 def _GetHttpServerDocumentRootForTestSuite(self): |
62 """Returns the document root needed by the test suite.""" | 64 """Returns the document root needed by the test suite.""" |
63 if self.test_package.test_suite_basename == 'page_cycler_tests': | 65 if self.test_package.test_suite_basename == 'page_cycler_tests': |
64 return os.path.join(run_tests_helper.CHROME_DIR, 'data', 'page_cycler') | 66 return os.path.join(run_tests_helper.CHROME_DIR, 'data', 'page_cycler') |
65 return None | 67 return None |
66 | 68 |
67 | 69 |
68 def _TestSuiteRequiresMockTestServer(self): | 70 def _TestSuiteRequiresMockTestServer(self): |
69 """Returns True if the test suite requires mock test server.""" | 71 """Returns True if the test suite requires mock test server.""" |
70 return False | 72 return False |
71 # TODO(yfriedman): Disabled because of flakiness. | 73 # TODO(yfriedman): Disabled because of flakiness. |
72 # (self.test_package.test_suite_basename == 'unit_tests' or | 74 # (self.test_package.test_suite_basename == 'unit_tests' or |
73 # self.test_package.test_suite_basename == 'net_unittests' or | 75 # self.test_package.test_suite_basename == 'net_unittests' or |
74 # False) | 76 # False) |
75 | 77 |
76 def _GetFilterFileName(self): | 78 def _GetFilterFileName(self): |
77 """Returns the filename of gtest filter.""" | 79 """Returns the filename of gtest filter.""" |
78 filter_dir = os.path.join(sys.path[0], 'gtest_filter') | 80 filter_dir = os.path.join(sys.path[0], 'gtest_filter') |
79 filter_name = self.test_package.test_suite_basename + '_disabled' | 81 filter_name = self.test_package.test_suite_basename + '_disabled' |
82 if self._apk_test_suite: | |
John Grabowski
2012/05/16 22:24:17
Staging/transition makes for odd choices.
In the f
| |
83 # APK test suite names end with '-debug.apk' | |
84 filter_name = self.test_package.test_suite_basename.rsplit( | |
85 '-debug', 1)[0] + '_disabled' | |
80 disabled_filter = os.path.join(filter_dir, filter_name) | 86 disabled_filter = os.path.join(filter_dir, filter_name) |
81 return disabled_filter | 87 return disabled_filter |
82 | 88 |
83 def _GetAdditionalEmulatorFilterName(self): | 89 def _GetAdditionalEmulatorFilterName(self): |
84 """Returns the filename of additional gtest filter for emulator.""" | 90 """Returns the filename of additional gtest filter for emulator.""" |
85 filter_dir = os.path.join(sys.path[0], 'gtest_filter') | 91 filter_dir = os.path.join(sys.path[0], 'gtest_filter') |
86 filter_name = '%s%s' % (self.test_package.test_suite_basename, | 92 filter_name = '%s%s' % (self.test_package.test_suite_basename, |
87 '_emulator_additional_disabled') | 93 '_emulator_additional_disabled') |
88 disabled_filter = os.path.join(filter_dir, filter_name) | 94 disabled_filter = os.path.join(filter_dir, filter_name) |
89 return disabled_filter | 95 return disabled_filter |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 def TearDown(self): | 314 def TearDown(self): |
309 """Cleans up the test enviroment for the test suite.""" | 315 """Cleans up the test enviroment for the test suite.""" |
310 self.test_package.tool.CleanUpEnvironment() | 316 self.test_package.tool.CleanUpEnvironment() |
311 if self.test_package.cleanup_test_files: | 317 if self.test_package.cleanup_test_files: |
312 self.adb.RemovePushedFiles() | 318 self.adb.RemovePushedFiles() |
313 if self.dump_debug_info: | 319 if self.dump_debug_info: |
314 self.dump_debug_info.StopRecordingLog() | 320 self.dump_debug_info.StopRecordingLog() |
315 if self.test_package.performance_test: | 321 if self.test_package.performance_test: |
316 self.adb.TearDownPerformanceTest() | 322 self.adb.TearDownPerformanceTest() |
317 super(SingleTestRunner, self).TearDown() | 323 super(SingleTestRunner, self).TearDown() |
OLD | NEW |