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 constants | |
10 from pylib import pexpect | 9 from pylib import pexpect |
11 from pylib.base import base_test_result | 10 from pylib.base import base_test_result |
12 from pylib.base import base_test_runner | 11 from pylib.base import base_test_runner |
13 from pylib.device import device_errors | 12 from pylib.device import device_errors |
14 from pylib.perf import perf_control | 13 from pylib.perf import perf_control |
15 | 14 |
16 | 15 |
17 def _TestSuiteRequiresMockTestServer(suite_name): | 16 def _TestSuiteRequiresMockTestServer(suite_name): |
18 """Returns True if the test suite requires mock test server.""" | 17 """Returns True if the test suite requires mock test server.""" |
19 tests_require_net_test_server = ['unit_tests', 'net_unittests', | 18 tests_require_net_test_server = ['unit_tests', 'net_unittests', |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 timeout = timeout * 2 | 51 timeout = timeout * 2 |
53 | 52 |
54 self._timeout = timeout * self.tool.GetTimeoutScale() | 53 self._timeout = timeout * self.tool.GetTimeoutScale() |
55 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): | 54 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): |
56 self._perf_controller = perf_control.PerfControl(self.device) | 55 self._perf_controller = perf_control.PerfControl(self.device) |
57 | 56 |
58 #override | 57 #override |
59 def InstallTestPackage(self): | 58 def InstallTestPackage(self): |
60 self.test_package.Install(self.device) | 59 self.test_package.Install(self.device) |
61 | 60 |
62 #override | |
63 def PushDataDeps(self): | |
64 self.device.WaitUntilFullyBooted(timeout=20) | |
65 self.tool.CopyFiles() | |
66 if os.path.exists(constants.ISOLATE_DEPS_DIR): | |
67 # TODO(frankf): linux_dumper_unittest_helper needs to be in the same dir | |
68 # as breakpad_unittests exe. Find a better way to do this. | |
69 if self.test_package.suite_name == 'breakpad_unittests': | |
70 device_dir = constants.TEST_EXECUTABLE_DIR | |
71 else: | |
72 device_dir = self.device.GetExternalStoragePath() | |
73 self.device.PushChangedFiles( | |
74 [(os.path.join(constants.ISOLATE_DEPS_DIR, p), | |
75 os.path.join(device_dir, p)) | |
76 for p in os.listdir(constants.ISOLATE_DEPS_DIR)]) | |
77 | |
78 def _ParseTestOutput(self, p): | 61 def _ParseTestOutput(self, p): |
79 """Process the test output. | 62 """Process the test output. |
80 | 63 |
81 Args: | 64 Args: |
82 p: An instance of pexpect spawn class. | 65 p: An instance of pexpect spawn class. |
83 | 66 |
84 Returns: | 67 Returns: |
85 A TestRunResults object. | 68 A TestRunResults object. |
86 """ | 69 """ |
87 results = base_test_result.TestRunResults() | 70 results = base_test_result.TestRunResults() |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 self.tool.SetupEnvironment() | 172 self.tool.SetupEnvironment() |
190 | 173 |
191 #override | 174 #override |
192 def TearDown(self): | 175 def TearDown(self): |
193 """Cleans up the test enviroment for the test suite.""" | 176 """Cleans up the test enviroment for the test suite.""" |
194 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): | 177 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): |
195 self._perf_controller.SetDefaultPerfMode() | 178 self._perf_controller.SetDefaultPerfMode() |
196 self.test_package.ClearApplicationState(self.device) | 179 self.test_package.ClearApplicationState(self.device) |
197 self.tool.CleanUpEnvironment() | 180 self.tool.CleanUpEnvironment() |
198 super(TestRunner, self).TearDown() | 181 super(TestRunner, self).TearDown() |
OLD | NEW |