Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2196)

Unified Diff: Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py

Issue 146173004: Fix run-blink-httpd to work w/ Apache and refactor webkitpy.layout_tests.servers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add cli_wrapper and update run-* scripts Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py b/Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py
index 08ead87d1c2a306cc9b930c262fc1c36114af5b2..c193d0b34b28885330fbd766e21c005df469c076 100644
--- a/Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py
+++ b/Tools/Scripts/webkitpy/layout_tests/servers/crash_service.py
@@ -26,62 +26,24 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""A class to help start/stop the crash service used by layout tests."""
+"""Start and stop the crash service as it is used by the layout tests."""
-import logging
-import os
-import time
+from webkitpy.layout_tests.servers import server_base
-from webkitpy.layout_tests.servers import http_server_base
-
-_log = logging.getLogger(__name__)
-
-
-class CrashService(http_server_base.HttpServerBase):
+class CrashService(server_base.ServerBase):
def __init__(self, port_obj, crash_dumps_dir):
"""Args:
crash_dumps_dir: the absolute path to the directory where to store crash dumps
"""
# Webkit tests
- http_server_base.HttpServerBase.__init__(self, port_obj)
+ super(CrashService, self).__init__(port_obj, port_obj.default_results_directory())
self._name = 'CrashService'
self._crash_dumps_dir = crash_dumps_dir
+ self._env = None
self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name)
-
- def _spawn_process(self):
- start_cmd = [self._port_obj._path_to_crash_service(),
- '--dumps-dir=%s' % self._crash_dumps_dir,
- '--no-window']
- _log.debug('Starting crash service, cmd = "%s"' % " ".join(start_cmd))
- process = self._executive.popen(start_cmd, shell=False, stderr=self._executive.PIPE)
- pid = process.pid
- self._filesystem.write_text_file(self._pid_file, str(pid))
- return pid
-
- def _stop_running_server(self):
- # FIXME: It would be nice if we had a cleaner way of killing this process.
- # Currently we throw away the process object created in _spawn_process,
- # since there doesn't appear to be any way to kill the server any more
- # cleanly using it than just killing the pid, and we need to support
- # killing a pid directly anyway for run-webkit-httpd and run-webkit-websocketserver.
- self._wait_for_action(self._check_and_kill)
- if self._filesystem.exists(self._pid_file):
- self._filesystem.remove(self._pid_file)
-
- def _check_and_kill(self):
- if self._executive.check_running_pid(self._pid):
- host = self._port_obj.host
- if host.platform.is_win() and not host.platform.is_cygwin():
- # FIXME: https://bugs.webkit.org/show_bug.cgi?id=106838
- # We need to kill all of the child processes as well as the
- # parent, so we can't use executive.kill_process().
- #
- # If this is actually working, we should figure out a clean API.
- self._executive.run_command(["taskkill.exe", "/f", "/t", "/pid", self._pid], error_handler=self._executive.ignore_error)
- else:
- self._executive.kill_process(self._pid)
- return False
- return True
+ self._start_cmd = [self._port_obj._path_to_crash_service(),
+ '--dumps-dir=%s' % self._crash_dumps_dir,
+ '--no-window']

Powered by Google App Engine
This is Rietveld 408576698