| 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 re | 7 import re |
| 8 | 8 |
| 9 from pylib import android_commands | 9 from pylib import android_commands |
| 10 from pylib import constants | 10 from pylib import constants |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 tool_name: Name of the Valgrind tool. | 42 tool_name: Name of the Valgrind tool. |
| 43 build_type: 'Release' or 'Debug'. | 43 build_type: 'Release' or 'Debug'. |
| 44 in_webkit_checkout: Whether the suite is being run from a WebKit checkout. | 44 in_webkit_checkout: Whether the suite is being run from a WebKit checkout. |
| 45 push_deps: If True, push all dependencies to the device. | 45 push_deps: If True, push all dependencies to the device. |
| 46 test_apk_package_name: Apk package name for tests running in APKs. | 46 test_apk_package_name: Apk package name for tests running in APKs. |
| 47 test_activity_name: Test activity to invoke for APK tests. | 47 test_activity_name: Test activity to invoke for APK tests. |
| 48 command_line_file: Filename to use to pass arguments to tests. | 48 command_line_file: Filename to use to pass arguments to tests. |
| 49 """ | 49 """ |
| 50 super(TestRunner, self).__init__(device, tool_name, build_type, push_deps, | 50 super(TestRunner, self).__init__(device, tool_name, build_type, push_deps, |
| 51 cleanup_test_files) | 51 cleanup_test_files) |
| 52 self._running_on_emulator = self.device.startswith('emulator') | |
| 53 self._test_arguments = test_arguments | 52 self._test_arguments = test_arguments |
| 54 self.in_webkit_checkout = in_webkit_checkout | 53 self.in_webkit_checkout = in_webkit_checkout |
| 55 if timeout == 0: | 54 if timeout == 0: |
| 56 timeout = 60 | 55 timeout = 60 |
| 57 # On a VM (e.g. chromium buildbots), this timeout is way too small. | 56 # On a VM (e.g. chromium buildbots), this timeout is way too small. |
| 58 if os.environ.get('BUILDBOT_SLAVENAME'): | 57 if os.environ.get('BUILDBOT_SLAVENAME'): |
| 59 timeout = timeout * 2 | 58 timeout = timeout * 2 |
| 60 self.timeout = timeout * self.tool.GetTimeoutScale() | 59 self.timeout = timeout * self.tool.GetTimeoutScale() |
| 61 | 60 |
| 62 logging.warning('Test suite: ' + test_suite) | 61 logging.warning('Test suite: ' + test_suite) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 os.path.join(webkit_src, 'Source/WebKit/chromium/tests/data'), | 118 os.path.join(webkit_src, 'Source/WebKit/chromium/tests/data'), |
| 120 os.path.join( | 119 os.path.join( |
| 121 self.adb.GetExternalStorage(), | 120 self.adb.GetExternalStorage(), |
| 122 'third_party/WebKit/Source/WebKit/chromium/tests/data')) | 121 'third_party/WebKit/Source/WebKit/chromium/tests/data')) |
| 123 self.adb.PushIfNeeded( | 122 self.adb.PushIfNeeded( |
| 124 os.path.join(constants.DIR_SOURCE_ROOT, | 123 os.path.join(constants.DIR_SOURCE_ROOT, |
| 125 'third_party/hyphen/hyph_en_US.dic'), | 124 'third_party/hyphen/hyph_en_US.dic'), |
| 126 os.path.join(self.adb.GetExternalStorage(), | 125 os.path.join(self.adb.GetExternalStorage(), |
| 127 'third_party/hyphen/hyph_en_US.dic')) | 126 'third_party/hyphen/hyph_en_US.dic')) |
| 128 | 127 |
| 129 # TODO(craigdh): There is no reason for this to be part of TestRunner. | |
| 130 def GetDisabledTests(self): | |
| 131 """Returns a list of disabled tests. | |
| 132 | |
| 133 Returns: | |
| 134 A list of disabled tests obtained from 'filter' subdirectory. | |
| 135 """ | |
| 136 gtest_filter_base_path = os.path.join( | |
| 137 os.path.abspath(os.path.dirname(__file__)), | |
| 138 'filter', | |
| 139 self.test_package.test_suite_basename) | |
| 140 disabled_tests = run_tests_helper.GetExpectations( | |
| 141 gtest_filter_base_path + '_disabled') | |
| 142 if self._running_on_emulator: | |
| 143 # Append emulator's filter file. | |
| 144 disabled_tests.extend(run_tests_helper.GetExpectations( | |
| 145 gtest_filter_base_path + '_emulator_additional_disabled')) | |
| 146 return disabled_tests | |
| 147 | |
| 148 def _ParseTestOutput(self, p): | 128 def _ParseTestOutput(self, p): |
| 149 """Process the test output. | 129 """Process the test output. |
| 150 | 130 |
| 151 Args: | 131 Args: |
| 152 p: An instance of pexpect spawn class. | 132 p: An instance of pexpect spawn class. |
| 153 | 133 |
| 154 Returns: | 134 Returns: |
| 155 A TestRunResults object. | 135 A TestRunResults object. |
| 156 """ | 136 """ |
| 157 results = base_test_result.TestRunResults() | 137 results = base_test_result.TestRunResults() |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 super(TestRunner, self).SetUp() | 233 super(TestRunner, self).SetUp() |
| 254 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): | 234 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): |
| 255 self.LaunchChromeTestServerSpawner() | 235 self.LaunchChromeTestServerSpawner() |
| 256 self.tool.SetupEnvironment() | 236 self.tool.SetupEnvironment() |
| 257 | 237 |
| 258 #override | 238 #override |
| 259 def TearDown(self): | 239 def TearDown(self): |
| 260 """Cleans up the test enviroment for the test suite.""" | 240 """Cleans up the test enviroment for the test suite.""" |
| 261 self.tool.CleanUpEnvironment() | 241 self.tool.CleanUpEnvironment() |
| 262 super(TestRunner, self).TearDown() | 242 super(TestRunner, self).TearDown() |
| OLD | NEW |