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 contextlib | 5 import contextlib |
6 import httplib | 6 import httplib |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import tempfile | 9 import tempfile |
10 import time | 10 import time |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 '%d:%d' % (self.test_server_spawner_port, | 65 '%d:%d' % (self.test_server_spawner_port, |
66 self.test_server_port)) | 66 self.test_server_port)) |
67 | 67 |
68 def RunTest(self, test): | 68 def RunTest(self, test): |
69 """Runs a test. Needs to be overridden. | 69 """Runs a test. Needs to be overridden. |
70 | 70 |
71 Args: | 71 Args: |
72 test: A test to run. | 72 test: A test to run. |
73 | 73 |
74 Returns: | 74 Returns: |
75 Tuple containing: (test_result.TestResults, tests to rerun or None) | 75 Tuple containing: |
| 76 (base_test_result.TestRunResults, tests to rerun or None) |
76 """ | 77 """ |
77 raise NotImplementedError | 78 raise NotImplementedError |
78 | 79 |
79 def SetUp(self): | 80 def SetUp(self): |
80 """Run once before all tests are run.""" | 81 """Run once before all tests are run.""" |
81 Forwarder.KillDevice(self.adb, self.tool) | 82 Forwarder.KillDevice(self.adb, self.tool) |
82 | 83 |
83 def TearDown(self): | 84 def TearDown(self): |
84 """Run once after all tests are run.""" | 85 """Run once after all tests are run.""" |
85 self.ShutdownHelperToolsForTestSuite() | 86 self.ShutdownHelperToolsForTestSuite() |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 # Wait for 2 seconds then restart. | 201 # Wait for 2 seconds then restart. |
201 time.sleep(2) | 202 time.sleep(2) |
202 if not server_ready: | 203 if not server_ready: |
203 logging.error(';'.join(error_msgs)) | 204 logging.error(';'.join(error_msgs)) |
204 raise Exception('Can not start the test spawner server.') | 205 raise Exception('Can not start the test spawner server.') |
205 self._PushTestServerPortInfoToDevice() | 206 self._PushTestServerPortInfoToDevice() |
206 self._spawner_forwarder = self._CreateAndRunForwarder( | 207 self._spawner_forwarder = self._CreateAndRunForwarder( |
207 self.adb, | 208 self.adb, |
208 [(self.test_server_spawner_port, self.test_server_spawner_port)], | 209 [(self.test_server_spawner_port, self.test_server_spawner_port)], |
209 self.tool, '127.0.0.1', self.build_type) | 210 self.tool, '127.0.0.1', self.build_type) |
OLD | NEW |