| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 'lib.target') | 210 'lib.target') |
| 211 self.test_package = test_package_executable.TestPackageExecutable( | 211 self.test_package = test_package_executable.TestPackageExecutable( |
| 212 self.adb, | 212 self.adb, |
| 213 device, | 213 device, |
| 214 test_suite, | 214 test_suite, |
| 215 timeout, | 215 timeout, |
| 216 self._cleanup_test_files, | 216 self._cleanup_test_files, |
| 217 self.tool, | 217 self.tool, |
| 218 symbols_dir) | 218 symbols_dir) |
| 219 | 219 |
| 220 | 220 #override |
| 221 def StripAndCopyFiles(self): | 221 def PushDependencies(self): |
| 222 """Strips and copies the required data files for the test suite.""" | |
| 223 self.test_package.StripAndCopyExecutable() | 222 self.test_package.StripAndCopyExecutable() |
| 224 self.test_package.PushDataAndPakFiles() | 223 self.test_package.PushDataAndPakFiles() |
| 225 self.tool.CopyFiles() | 224 self.tool.CopyFiles() |
| 226 test_data = _GetDataFilesForTestSuite(self.test_package.test_suite_basename) | 225 test_data = _GetDataFilesForTestSuite(self.test_package.test_suite_basename) |
| 227 if test_data: | 226 if test_data: |
| 228 # Make sure SD card is ready. | 227 # Make sure SD card is ready. |
| 229 self.adb.WaitForSdCardReady(20) | 228 self.adb.WaitForSdCardReady(20) |
| 230 for data in test_data: | 229 for data in test_data: |
| 231 self.CopyTestData([data], self.adb.GetExternalStorage()) | 230 self.CopyTestData([data], self.adb.GetExternalStorage()) |
| 232 optional_test_data = _GetOptionalDataFilesForTestSuite( | 231 optional_test_data = _GetOptionalDataFilesForTestSuite( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 test_results.AddResults( | 297 test_results.AddResults( |
| 299 [base_test_result.BaseTestResult(t, base_test_result.ResultType.UNKNOWN) | 298 [base_test_result.BaseTestResult(t, base_test_result.ResultType.UNKNOWN) |
| 300 for t in unknown_tests]) | 299 for t in unknown_tests]) |
| 301 retry = ':'.join([t.GetName() for t in test_results.GetNotPass()]) | 300 retry = ':'.join([t.GetName() for t in test_results.GetNotPass()]) |
| 302 return test_results, retry | 301 return test_results, retry |
| 303 | 302 |
| 304 #override | 303 #override |
| 305 def SetUp(self): | 304 def SetUp(self): |
| 306 """Sets up necessary test enviroment for the test suite.""" | 305 """Sets up necessary test enviroment for the test suite.""" |
| 307 super(TestRunner, self).SetUp() | 306 super(TestRunner, self).SetUp() |
| 308 self.StripAndCopyFiles() | |
| 309 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): | 307 if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename): |
| 310 self.LaunchChromeTestServerSpawner() | 308 self.LaunchChromeTestServerSpawner() |
| 311 self.tool.SetupEnvironment() | 309 self.tool.SetupEnvironment() |
| 312 | 310 |
| 313 #override | 311 #override |
| 314 def TearDown(self): | 312 def TearDown(self): |
| 315 """Cleans up the test enviroment for the test suite.""" | 313 """Cleans up the test enviroment for the test suite.""" |
| 316 self.tool.CleanUpEnvironment() | 314 self.tool.CleanUpEnvironment() |
| 317 if self._cleanup_test_files: | 315 if self._cleanup_test_files: |
| 318 self.adb.RemovePushedFiles() | 316 self.adb.RemovePushedFiles() |
| 319 super(TestRunner, self).TearDown() | 317 super(TestRunner, self).TearDown() |
| OLD | NEW |