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 | 8 |
9 from pylib import android_commands | 9 from pylib import android_commands |
10 from pylib import constants | 10 from pylib import constants |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 Args: | 240 Args: |
241 device: Device to run the tests. | 241 device: Device to run the tests. |
242 test_suite: A specific test suite to run, empty to run all. | 242 test_suite: A specific test suite to run, empty to run all. |
243 test_arguments: Additional arguments to pass to the test binary. | 243 test_arguments: Additional arguments to pass to the test binary. |
244 timeout: Timeout for each test. | 244 timeout: Timeout for each test. |
245 cleanup_test_files: Whether or not to cleanup test files on device. | 245 cleanup_test_files: Whether or not to cleanup test files on device. |
246 tool_name: Name of the Valgrind tool. | 246 tool_name: Name of the Valgrind tool. |
247 build_type: 'Release' or 'Debug'. | 247 build_type: 'Release' or 'Debug'. |
248 in_webkit_checkout: Whether the suite is being run from a WebKit checkout. | 248 in_webkit_checkout: Whether the suite is being run from a WebKit checkout. |
| 249 push_deps: If True, push all dependencies to the device. |
249 test_apk_package_name: Apk package name for tests running in APKs. | 250 test_apk_package_name: Apk package name for tests running in APKs. |
250 test_activity_name: Test activity to invoke for APK tests. | 251 test_activity_name: Test activity to invoke for APK tests. |
251 command_line_file: Filename to use to pass arguments to tests. | 252 command_line_file: Filename to use to pass arguments to tests. |
252 """ | 253 """ |
253 | 254 |
254 def __init__(self, device, test_suite, test_arguments, timeout, | 255 def __init__(self, device, test_suite, test_arguments, timeout, |
255 cleanup_test_files, tool_name, build_type, | 256 cleanup_test_files, tool_name, build_type, |
256 in_webkit_checkout, test_apk_package_name=None, | 257 in_webkit_checkout, push_deps, test_apk_package_name=None, |
257 test_activity_name=None, command_line_file=None): | 258 test_activity_name=None, command_line_file=None): |
258 super(TestRunner, self).__init__(device, tool_name, build_type) | 259 super(TestRunner, self).__init__(device, tool_name, build_type, push_deps) |
259 self._running_on_emulator = self.device.startswith('emulator') | 260 self._running_on_emulator = self.device.startswith('emulator') |
260 self._test_arguments = test_arguments | 261 self._test_arguments = test_arguments |
261 self.in_webkit_checkout = in_webkit_checkout | 262 self.in_webkit_checkout = in_webkit_checkout |
262 self._cleanup_test_files = cleanup_test_files | 263 self._cleanup_test_files = cleanup_test_files |
263 | 264 |
264 logging.warning('Test suite: ' + test_suite) | 265 logging.warning('Test suite: ' + test_suite) |
265 if os.path.splitext(test_suite)[1] == '.apk': | 266 if os.path.splitext(test_suite)[1] == '.apk': |
266 self.test_package = test_package_apk.TestPackageApk( | 267 self.test_package = test_package_apk.TestPackageApk( |
267 self.adb, | 268 self.adb, |
268 device, | 269 device, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 self.LaunchChromeTestServerSpawner() | 380 self.LaunchChromeTestServerSpawner() |
380 self.tool.SetupEnvironment() | 381 self.tool.SetupEnvironment() |
381 | 382 |
382 #override | 383 #override |
383 def TearDown(self): | 384 def TearDown(self): |
384 """Cleans up the test enviroment for the test suite.""" | 385 """Cleans up the test enviroment for the test suite.""" |
385 self.tool.CleanUpEnvironment() | 386 self.tool.CleanUpEnvironment() |
386 if self._cleanup_test_files: | 387 if self._cleanup_test_files: |
387 self.adb.RemovePushedFiles() | 388 self.adb.RemovePushedFiles() |
388 super(TestRunner, self).TearDown() | 389 super(TestRunner, self).TearDown() |
OLD | NEW |