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 """Base class for running tests on a single device.""" |
| 6 |
5 import contextlib | 7 import contextlib |
6 import httplib | 8 import httplib |
7 import logging | 9 import logging |
8 import os | 10 import os |
9 import tempfile | 11 import tempfile |
10 import time | 12 import time |
11 | 13 |
12 from pylib import android_commands | 14 from pylib import android_commands |
13 from pylib import constants | 15 from pylib import constants |
14 from pylib import ports | 16 from pylib import ports |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 # Wait for 2 seconds then restart. | 208 # Wait for 2 seconds then restart. |
207 time.sleep(2) | 209 time.sleep(2) |
208 if not server_ready: | 210 if not server_ready: |
209 logging.error(';'.join(error_msgs)) | 211 logging.error(';'.join(error_msgs)) |
210 raise Exception('Can not start the test spawner server.') | 212 raise Exception('Can not start the test spawner server.') |
211 self._PushTestServerPortInfoToDevice() | 213 self._PushTestServerPortInfoToDevice() |
212 self._spawner_forwarder = self._CreateAndRunForwarder( | 214 self._spawner_forwarder = self._CreateAndRunForwarder( |
213 self.adb, | 215 self.adb, |
214 [(self.test_server_spawner_port, self.test_server_spawner_port)], | 216 [(self.test_server_spawner_port, self.test_server_spawner_port)], |
215 self.tool, '127.0.0.1', self.build_type) | 217 self.tool, '127.0.0.1', self.build_type) |
OLD | NEW |