Chromium Code Reviews| 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 pylib import android_commands | 10 from pylib import android_commands |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 self.dump_debug_info, | 77 self.dump_debug_info, |
| 78 symbols_dir) | 78 symbols_dir) |
| 79 | 79 |
| 80 def _TestSuiteRequiresMockTestServer(self): | 80 def _TestSuiteRequiresMockTestServer(self): |
| 81 """Returns True if the test suite requires mock test server.""" | 81 """Returns True if the test suite requires mock test server.""" |
| 82 tests_require_net_test_server = ['unit_tests', 'net_unittests', | 82 tests_require_net_test_server = ['unit_tests', 'net_unittests', |
| 83 'content_unittests'] | 83 'content_unittests'] |
| 84 return (self.test_package.test_suite_basename in | 84 return (self.test_package.test_suite_basename in |
| 85 tests_require_net_test_server) | 85 tests_require_net_test_server) |
| 86 | 86 |
| 87 def _GetFilterFileName(self): | |
| 88 """Returns the filename of gtest filter.""" | |
| 89 return os.path.join( | |
| 90 sys.path[0], 'gtest_filter', | |
| 91 self.test_package.test_suite_basename + '_disabled') | |
| 92 | |
| 93 def _GetAdditionalEmulatorFilterName(self): | |
| 94 """Returns the filename of additional gtest filter for emulator.""" | |
| 95 return os.path.join( | |
| 96 sys.path[0], 'gtest_filter', | |
| 97 self.test_package.test_suite_basename + | |
| 98 '_emulator_additional_disabled') | |
| 99 | |
| 100 def GetDisabledTests(self): | 87 def GetDisabledTests(self): |
| 101 """Returns a list of disabled tests. | 88 """Returns a list of disabled tests. |
| 102 | 89 |
| 103 Returns: | 90 Returns: |
| 104 A list of disabled tests obtained from gtest_filter/test_suite_disabled. | 91 A list of disabled tests obtained from gtest_filter/test_suite_disabled. |
|
frankf
2013/01/10 18:49:05
nit: Update the comment.
| |
| 105 """ | 92 """ |
| 106 disabled_tests = run_tests_helper.GetExpectations(self._GetFilterFileName()) | 93 gtest_filter_base_path = os.path.join( |
| 94 constants.CHROME_DIR, 'build', 'android', 'pylib', 'gtest', 'filter', | |
| 95 self.test_package.test_suite_basename) | |
|
frankf
2013/01/10 18:50:19
Oh, and this can be relative to __file__
| |
| 96 disabled_tests = run_tests_helper.GetExpectations( | |
| 97 gtest_filter_base_path + '_disabled') | |
| 107 if self._running_on_emulator: | 98 if self._running_on_emulator: |
| 108 # Append emulator's filter file. | 99 # Append emulator's filter file. |
| 109 disabled_tests.extend(run_tests_helper.GetExpectations( | 100 disabled_tests.extend(run_tests_helper.GetExpectations( |
| 110 self._GetAdditionalEmulatorFilterName())) | 101 gtest_filter_base_path + '_emulator_additional_disabled')) |
| 111 return disabled_tests | 102 return disabled_tests |
| 112 | 103 |
| 113 def GetDataFilesForTestSuite(self): | 104 def GetDataFilesForTestSuite(self): |
| 114 """Returns a list of data files/dirs needed by the test suite.""" | 105 """Returns a list of data files/dirs needed by the test suite.""" |
| 115 # Ideally, we'd just push all test data. However, it has >100MB, and a lot | 106 # Ideally, we'd just push all test data. However, it has >100MB, and a lot |
| 116 # of the files are not relevant (some are used for browser_tests, others for | 107 # of the files are not relevant (some are used for browser_tests, others for |
| 117 # features not supported, etc..). | 108 # features not supported, etc..). |
| 118 if self.test_package.test_suite_basename in ['base_unittests', | 109 if self.test_package.test_suite_basename in ['base_unittests', |
| 119 'sql_unittests', | 110 'sql_unittests', |
| 120 'unit_tests']: | 111 'unit_tests']: |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 def TearDown(self): | 274 def TearDown(self): |
| 284 """Cleans up the test enviroment for the test suite.""" | 275 """Cleans up the test enviroment for the test suite.""" |
| 285 self.tool.CleanUpEnvironment() | 276 self.tool.CleanUpEnvironment() |
| 286 if self.test_package.cleanup_test_files: | 277 if self.test_package.cleanup_test_files: |
| 287 self.adb.RemovePushedFiles() | 278 self.adb.RemovePushedFiles() |
| 288 if self.dump_debug_info: | 279 if self.dump_debug_info: |
| 289 self.dump_debug_info.StopRecordingLog() | 280 self.dump_debug_info.StopRecordingLog() |
| 290 if self.dump_debug_info: | 281 if self.dump_debug_info: |
| 291 self.dump_debug_info.ArchiveNewCrashFiles() | 282 self.dump_debug_info.ArchiveNewCrashFiles() |
| 292 super(SingleTestRunner, self).TearDown() | 283 super(SingleTestRunner, self).TearDown() |
| OLD | NEW |