| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 self._number_of_servers = number_of_servers | 51 self._number_of_servers = number_of_servers |
| 52 | 52 |
| 53 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) | 53 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) |
| 54 | 54 |
| 55 executable = self._port_obj.path_to_apache() | 55 executable = self._port_obj.path_to_apache() |
| 56 server_root = self._filesystem.dirname(self._filesystem.dirname(executab
le)) | 56 server_root = self._filesystem.dirname(self._filesystem.dirname(executab
le)) |
| 57 | 57 |
| 58 test_dir = self._port_obj.layout_tests_dir() | 58 test_dir = self._port_obj.layout_tests_dir() |
| 59 document_root = self._filesystem.join(test_dir, "http", "tests") | 59 document_root = self._filesystem.join(test_dir, "http", "tests") |
| 60 js_test_resources_dir = self._filesystem.join(test_dir, "resources") | 60 js_test_resources_dir = self._filesystem.join(test_dir, "resources") |
| 61 forms_test_resources_dir = self._filesystem.join(test_dir, "fast", "form
s", "resources") |
| 61 media_resources_dir = self._filesystem.join(test_dir, "media") | 62 media_resources_dir = self._filesystem.join(test_dir, "media") |
| 62 mime_types_path = self._filesystem.join(test_dir, "http", "conf", "mime.
types") | 63 mime_types_path = self._filesystem.join(test_dir, "http", "conf", "mime.
types") |
| 63 cert_file = self._filesystem.join(test_dir, "http", "conf", "webkit-http
d.pem") | 64 cert_file = self._filesystem.join(test_dir, "http", "conf", "webkit-http
d.pem") |
| 64 inspector_sources_dir = self._port_obj.inspector_build_directory() | 65 inspector_sources_dir = self._port_obj.inspector_build_directory() |
| 65 | 66 |
| 66 self._access_log_path = self._filesystem.join(output_dir, "access_log.tx
t") | 67 self._access_log_path = self._filesystem.join(output_dir, "access_log.tx
t") |
| 67 self._error_log_path = self._filesystem.join(output_dir, "error_log.txt"
) | 68 self._error_log_path = self._filesystem.join(output_dir, "error_log.txt"
) |
| 68 | 69 |
| 69 self._is_win = self._port_obj.host.platform.is_win() | 70 self._is_win = self._port_obj.host.platform.is_win() |
| 70 | 71 |
| 71 start_cmd = [ | 72 start_cmd = [ |
| 72 executable, | 73 executable, |
| 73 '-f', '%s' % self._port_obj.path_to_apache_config_file(), | 74 '-f', '%s' % self._port_obj.path_to_apache_config_file(), |
| 74 '-C', 'ServerRoot "%s"' % server_root, | 75 '-C', 'ServerRoot "%s"' % server_root, |
| 75 '-C', 'DocumentRoot "%s"' % document_root, | 76 '-C', 'DocumentRoot "%s"' % document_root, |
| 76 '-c', 'Alias /js-test-resources "%s"' % js_test_resources_dir, | 77 '-c', 'Alias /js-test-resources "%s"' % js_test_resources_dir, |
| 78 '-c', 'Alias /forms-test-resources "%s"' % forms_test_resources_dir, |
| 77 '-c', 'Alias /media-resources "%s"' % media_resources_dir, | 79 '-c', 'Alias /media-resources "%s"' % media_resources_dir, |
| 78 '-c', 'TypesConfig "%s"' % mime_types_path, | 80 '-c', 'TypesConfig "%s"' % mime_types_path, |
| 79 '-c', 'CustomLog "%s" common' % self._access_log_path, | 81 '-c', 'CustomLog "%s" common' % self._access_log_path, |
| 80 '-c', 'ErrorLog "%s"' % self._error_log_path, | 82 '-c', 'ErrorLog "%s"' % self._error_log_path, |
| 81 '-c', 'PidFile %s' % self._pid_file, | 83 '-c', 'PidFile %s' % self._pid_file, |
| 82 '-c', 'SSLCertificateFile "%s"' % cert_file, | 84 '-c', 'SSLCertificateFile "%s"' % cert_file, |
| 83 '-c', 'Alias /inspector-sources "%s"' % inspector_sources_dir, | 85 '-c', 'Alias /inspector-sources "%s"' % inspector_sources_dir, |
| 84 ] | 86 ] |
| 85 | 87 |
| 86 if self._is_win: | 88 if self._is_win: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 retval = proc.returncode | 166 retval = proc.returncode |
| 165 err = proc.stderr.read() | 167 err = proc.stderr.read() |
| 166 if retval or len(err): | 168 if retval or len(err): |
| 167 raise server_base.ServerError('Failed to stop %s: %s' % (self._name,
err)) | 169 raise server_base.ServerError('Failed to stop %s: %s' % (self._name,
err)) |
| 168 | 170 |
| 169 # For some reason apache isn't guaranteed to have actually stopped after | 171 # For some reason apache isn't guaranteed to have actually stopped after |
| 170 # the stop command returns, so we wait a little while longer for the | 172 # the stop command returns, so we wait a little while longer for the |
| 171 # pid file to be removed. | 173 # pid file to be removed. |
| 172 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p
id_file)): | 174 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p
id_file)): |
| 173 raise server_base.ServerError('Failed to stop %s: pid file still exi
sts' % self._name) | 175 raise server_base.ServerError('Failed to stop %s: pid file still exi
sts' % self._name) |
| OLD | NEW |