| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 """A class to help start/stop the lighttpd server used by layout tests.""" | 29 """A class to help start/stop the lighttpd server used by layout tests.""" |
| 30 | 30 |
| 31 import logging | 31 import logging |
| 32 import os | 32 import os |
| 33 import time | 33 import time |
| 34 | 34 |
| 35 from webkitpy.layout_tests.servers import http_server_base | 35 from webkitpy.layout_tests.servers import server_base |
| 36 | 36 |
| 37 | 37 |
| 38 _log = logging.getLogger(__name__) | 38 _log = logging.getLogger(__name__) |
| 39 | 39 |
| 40 | 40 |
| 41 class Lighttpd(http_server_base.HttpServerBase): | 41 class Lighttpd(server_base.ServerBase): |
| 42 | 42 |
| 43 def __init__(self, port_obj, output_dir, background=False, port=None, | 43 def __init__(self, port_obj, output_dir, background=False, port=None, |
| 44 root=None, run_background=None, additional_dirs=None, | 44 root=None, run_background=None, additional_dirs=None, |
| 45 layout_tests_dir=None, number_of_servers=None): | 45 layout_tests_dir=None, number_of_servers=None): |
| 46 """Args: | 46 """Args: |
| 47 output_dir: the absolute path to the layout test result directory | 47 output_dir: the absolute path to the layout test result directory |
| 48 """ | 48 """ |
| 49 # Webkit tests | 49 # Webkit tests |
| 50 http_server_base.HttpServerBase.__init__(self, port_obj, number_of_serve
rs) | 50 super(Lighttpd, self).__init__(port_obj, number_of_servers) |
| 51 self._name = 'lighttpd' | 51 self._name = 'lighttpd' |
| 52 self._output_dir = output_dir | 52 self._output_dir = output_dir |
| 53 self._port = port | 53 self._port = port |
| 54 self._root = root | 54 self._root = root |
| 55 self._run_background = run_background | 55 self._run_background = run_background |
| 56 self._additional_dirs = additional_dirs | 56 self._additional_dirs = additional_dirs |
| 57 self._layout_tests_dir = layout_tests_dir | 57 self._layout_tests_dir = layout_tests_dir |
| 58 | 58 |
| 59 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) | 59 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) |
| 60 | 60 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=106838 | 219 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=106838 |
| 220 # We need to kill all of the child processes as well as the | 220 # We need to kill all of the child processes as well as the |
| 221 # parent, so we can't use executive.kill_process(). | 221 # parent, so we can't use executive.kill_process(). |
| 222 # | 222 # |
| 223 # If this is actually working, we should figure out a clean API. | 223 # If this is actually working, we should figure out a clean API. |
| 224 self._executive.run_command(["taskkill.exe", "/f", "/t", "/pid",
self._pid], error_handler=self._executive.ignore_error) | 224 self._executive.run_command(["taskkill.exe", "/f", "/t", "/pid",
self._pid], error_handler=self._executive.ignore_error) |
| 225 else: | 225 else: |
| 226 self._executive.kill_process(self._pid) | 226 self._executive.kill_process(self._pid) |
| 227 return False | 227 return False |
| 228 return True | 228 return True |
| OLD | NEW |