| 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 | 7 |
| 8 from pylib import android_commands | 8 from pylib import android_commands |
| 9 from pylib import constants | 9 from pylib import constants |
| 10 from pylib.android_commands import errors | 10 from pylib.android_commands import errors |
| 11 from pylib.base import base_test_result | 11 from pylib.base import base_test_result |
| 12 from pylib.base import base_test_runner | 12 from pylib.base import base_test_runner |
| 13 from pylib.utils import run_tests_helper | 13 from pylib.utils import run_tests_helper |
| 14 | 14 |
| 15 import test_package_apk | 15 import test_package_apk |
| 16 import test_package_executable | 16 import test_package_executable |
| 17 | 17 |
| 18 | 18 |
| 19 # We're moving to using isolate files instead of harcoding | 19 # We're moving to using isolate files instead of harcoding |
| 20 # dependencies here. Look at the TODO in dispatch.py. | 20 # dependencies here. Look at the TODO in setup.py. |
| 21 def _GetDataFilesForTestSuite(test_suite_basename): | 21 def _GetDataFilesForTestSuite(test_suite_basename): |
| 22 """Returns a list of data files/dirs needed by the test suite. | 22 """Returns a list of data files/dirs needed by the test suite. |
| 23 | 23 |
| 24 Args: | 24 Args: |
| 25 test_suite_basename: The test suite basename (e.g. base_unittests). | 25 test_suite_basename: The test suite basename (e.g. base_unittests). |
| 26 | 26 |
| 27 Returns: | 27 Returns: |
| 28 A list of test file and directory paths. | 28 A list of test file and directory paths. |
| 29 """ | 29 """ |
| 30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot | 30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 cleanup_test_files, tool_name, build_type, | 173 cleanup_test_files, tool_name, build_type, |
| 174 in_webkit_checkout, push_deps, test_apk_package_name=None, | 174 in_webkit_checkout, push_deps, test_apk_package_name=None, |
| 175 test_activity_name=None, command_line_file=None, deps_dir=None): | 175 test_activity_name=None, command_line_file=None, deps_dir=None): |
| 176 super(TestRunner, self).__init__(device, tool_name, build_type, push_deps) | 176 super(TestRunner, self).__init__(device, tool_name, build_type, push_deps) |
| 177 self._running_on_emulator = self.device.startswith('emulator') | 177 self._running_on_emulator = self.device.startswith('emulator') |
| 178 self._test_arguments = test_arguments | 178 self._test_arguments = test_arguments |
| 179 self.in_webkit_checkout = in_webkit_checkout | 179 self.in_webkit_checkout = in_webkit_checkout |
| 180 self._cleanup_test_files = cleanup_test_files | 180 self._cleanup_test_files = cleanup_test_files |
| 181 self._deps_dir = deps_dir | 181 self._deps_dir = deps_dir |
| 182 | 182 |
| 183 logging.warning('Test suite: ' + test_suite) | 183 logging.warning('Test suite: ' + str(test_suite)) |
| 184 if os.path.splitext(test_suite)[1] == '.apk': | 184 if os.path.splitext(test_suite)[1] == '.apk': |
| 185 self.test_package = test_package_apk.TestPackageApk( | 185 self.test_package = test_package_apk.TestPackageApk( |
| 186 self.adb, | 186 self.adb, |
| 187 device, | 187 device, |
| 188 test_suite, | 188 test_suite, |
| 189 timeout, | 189 timeout, |
| 190 self._cleanup_test_files, | 190 self._cleanup_test_files, |
| 191 self.tool, | 191 self.tool, |
| 192 test_apk_package_name, | 192 test_apk_package_name, |
| 193 test_activity_name, | 193 test_activity_name, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 self.LaunchChromeTestServerSpawner() | 303 self.LaunchChromeTestServerSpawner() |
| 304 self.tool.SetupEnvironment() | 304 self.tool.SetupEnvironment() |
| 305 | 305 |
| 306 #override | 306 #override |
| 307 def TearDown(self): | 307 def TearDown(self): |
| 308 """Cleans up the test enviroment for the test suite.""" | 308 """Cleans up the test enviroment for the test suite.""" |
| 309 self.tool.CleanUpEnvironment() | 309 self.tool.CleanUpEnvironment() |
| 310 if self._cleanup_test_files: | 310 if self._cleanup_test_files: |
| 311 self.adb.RemovePushedFiles() | 311 self.adb.RemovePushedFiles() |
| 312 super(TestRunner, self).TearDown() | 312 super(TestRunner, self).TearDown() |
| OLD | NEW |