Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """A "Test Server Spawner" that handles killing/stopping per-test test servers. | 5 """A "Test Server Spawner" that handles killing/stopping per-test test servers. |
| 6 | 6 |
| 7 It's used to accept requests from the device to spawn and kill instances of the | 7 It's used to accept requests from the device to spawn and kill instances of the |
| 8 chrome test server on the host. | 8 chrome test server on the host. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 logging.info('Starting test server spawner') | 396 logging.info('Starting test server spawner') |
| 397 self.server.serve_forever() | 397 self.server.serve_forever() |
| 398 | 398 |
| 399 def Start(self): | 399 def Start(self): |
| 400 listener_thread = threading.Thread(target=self._Listen) | 400 listener_thread = threading.Thread(target=self._Listen) |
| 401 listener_thread.setDaemon(True) | 401 listener_thread.setDaemon(True) |
| 402 listener_thread.start() | 402 listener_thread.start() |
| 403 time.sleep(1) | 403 time.sleep(1) |
| 404 | 404 |
| 405 def Stop(self): | 405 def Stop(self): |
| 406 self.CleanupTestServer() | |
| 407 self.server.shutdown() | |
| 408 | |
| 409 def CleanupTestServer(self): | |
|
frankf
2013/03/08 19:59:52
Could you also add dosctrings for all the methods
nilesh
2013/03/08 23:37:52
Renamed and added doc.
| |
| 406 if self.server.test_server_instance: | 410 if self.server.test_server_instance: |
| 407 self.server.test_server_instance.Stop() | 411 self.server.test_server_instance.Stop() |
| 408 self.server.shutdown() | 412 self.server.test_server_instance = None |
| OLD | NEW |