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.""" | 5 """Base class for running tests on a single device.""" |
6 | 6 |
7 # TODO(jbudorick) Deprecate and remove this class and all subclasses after | 7 # TODO(jbudorick) Deprecate and remove this class and all subclasses after |
8 # any relevant parts have been ported to the new environment + test instance | 8 # any relevant parts have been ported to the new environment + test instance |
9 # model. | 9 # model. |
10 | 10 |
11 import logging | 11 import logging |
12 | 12 |
13 from pylib import ports | 13 from devil.android import device_utils |
14 from pylib.device import device_utils | 14 from devil.android import ports |
15 from pylib.forwarder import Forwarder | 15 from pylib.forwarder import Forwarder |
16 from pylib.valgrind_tools import CreateTool | 16 from pylib.valgrind_tools import CreateTool |
17 # TODO(frankf): Move this to pylib/utils | 17 # TODO(frankf): Move this to pylib/utils |
18 import lighttpd_server | 18 import lighttpd_server |
19 | 19 |
20 | 20 |
21 # A file on device to store ports of net test server. The format of the file is | 21 # A file on device to store ports of net test server. The format of the file is |
22 # test-spawner-server-port:test-server-port | 22 # test-spawner-server-port:test-server-port |
23 NET_TEST_SERVER_PORT_INFO_FILE = 'net-test-server-ports' | 23 NET_TEST_SERVER_PORT_INFO_FILE = 'net-test-server-ports' |
24 | 24 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 # will be left open even after the forwarder has been killed. | 129 # will be left open even after the forwarder has been killed. |
130 if not ports.IsDevicePortUsed(self.device, self._forwarder_device_port): | 130 if not ports.IsDevicePortUsed(self.device, self._forwarder_device_port): |
131 self._ForwardPortsForHttpServer() | 131 self._ForwardPortsForHttpServer() |
132 | 132 |
133 def ShutdownHelperToolsForTestSuite(self): | 133 def ShutdownHelperToolsForTestSuite(self): |
134 """Shuts down the server and the forwarder.""" | 134 """Shuts down the server and the forwarder.""" |
135 if self._http_server: | 135 if self._http_server: |
136 self._UnmapPorts([(self._forwarder_device_port, self._http_server.port)]) | 136 self._UnmapPorts([(self._forwarder_device_port, self._http_server.port)]) |
137 self._http_server.ShutdownHttpServer() | 137 self._http_server.ShutdownHttpServer() |
138 | 138 |
OLD | NEW |