| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 """Start and stop the WPTserve servers as they're used by the layout tests.""" | 5 """Start and stop the WPTserve servers as they're used by the layout tests.""" |
| 6 | 6 |
| 7 from webkitpy.layout_tests.servers import server_base | 7 from webkitpy.layout_tests.servers import server_base |
| 8 | 8 |
| 9 | 9 |
| 10 class WPTServe(server_base.ServerBase): | 10 class WPTServe(server_base.ServerBase): |
| 11 |
| 11 def __init__(self, port_obj, output_dir): | 12 def __init__(self, port_obj, output_dir): |
| 12 super(WPTServe, self).__init__(port_obj, output_dir) | 13 super(WPTServe, self).__init__(port_obj, output_dir) |
| 13 # These ports must match wpt_support/wpt.config.json | 14 # These ports must match wpt_support/wpt.config.json |
| 14 http_port, http_alt_port, https_port = (8001, 8081, 8444) | 15 http_port, http_alt_port, https_port = (8001, 8081, 8444) |
| 15 ws_port, wss_port = (9001, 9444) | 16 ws_port, wss_port = (9001, 9444) |
| 16 self._name = 'wptserve' | 17 self._name = 'wptserve' |
| 17 self._log_prefixes = ('access_log', 'error_log') | 18 self._log_prefixes = ('access_log', 'error_log') |
| 18 self._mappings = [{'port': http_port}, | 19 self._mappings = [{'port': http_port}, |
| 19 {'port': http_alt_port}, | 20 {'port': http_alt_port}, |
| 20 {'port': https_port, 'sslcert': True}, | 21 {'port': https_port, 'sslcert': True}, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if self._pid and not self._executive.check_running_pid(self._pid): | 54 if self._pid and not self._executive.check_running_pid(self._pid): |
| 54 self._filesystem.remove(self._pid_file) | 55 self._filesystem.remove(self._pid_file) |
| 55 return | 56 return |
| 56 | 57 |
| 57 # TODO(burnik): Figure out a cleaner way of stopping wptserve. | 58 # TODO(burnik): Figure out a cleaner way of stopping wptserve. |
| 58 self._executive.interrupt(self._pid) | 59 self._executive.interrupt(self._pid) |
| 59 | 60 |
| 60 # According to Popen.wait(), this can deadlock when using stdout=PIPE an
d/or stderr=PIPE. | 61 # According to Popen.wait(), this can deadlock when using stdout=PIPE an
d/or stderr=PIPE. |
| 61 # We're using DEVNULL for both so that should not occur. | 62 # We're using DEVNULL for both so that should not occur. |
| 62 self._process.wait() | 63 self._process.wait() |
| OLD | NEW |