summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 21:14:17 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-26 21:14:17 +0000
commite1454e262443a3048c2c51718c1ff463c7e63f03 (patch)
tree6e393c88e868342a171f2da4891aa379c3ee9631
parent46491f691e2d322192769544f2d7c6a82deaaf4b (diff)
downloadchromium_src-e1454e262443a3048c2c51718c1ff463c7e63f03.zip
chromium_src-e1454e262443a3048c2c51718c1ff463c7e63f03.tar.gz
chromium_src-e1454e262443a3048c2c51718c1ff463c7e63f03.tar.bz2
Landing thakis's change from http://codereview.chromium.org/42487
Tested on Mac and Linux with layout_package/http_server.sh --server start layout_package/http_server.sh --server stop Note LGTM from mark@chromium.org on original CL. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12603 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_linux.py11
-rw-r--r--webkit/tools/layout_tests/layout_package/platform_utils_mac.py11
2 files changed, 11 insertions, 11 deletions
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
index b37f0bf..0ea0bec 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_linux.py
@@ -7,6 +7,7 @@
import os
import re
+import signal
import subprocess
import sys
@@ -146,17 +147,11 @@ class PlatformUtility(object):
"""
# server_process is not set when "http_server.py stop" is run manually.
if server_process is None:
- # Try to determine the HTTP server process.
# TODO(mmoss) This isn't ideal, since it could conflict with lighttpd
# processes not started by http_server.py, but good enough for now.
- proc = subprocess.Popen(('ps', '--no-headers', '-o', 'pid',
- '-C', 'lighttpd'),
- stdout=subprocess.PIPE)
- pid = proc.stdout.readline().strip()
+ subprocess.call(['killall', '-u', os.getenv('USER'), '-TERM', 'lighttpd'])
else:
- pid = server_process.pid
- subprocess.Popen(('kill', '-TERM', '%s' % pid), stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
+ os.kill(server_process.pid, signal.SIGTERM)
def WDiffExecutablePath(self):
"""Path to the WDiff executable, which we assume is already installed and
diff --git a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
index fd0e725..82dfcb1 100644
--- a/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
+++ b/webkit/tools/layout_tests/layout_package/platform_utils_mac.py
@@ -7,6 +7,7 @@
import os
import re
+import signal
import subprocess
import sys
@@ -123,9 +124,13 @@ class PlatformUtility(object):
Args:
server_process: The subprocess object representing the running server
"""
- subprocess.Popen(('kill', '-TERM', '%d' % server_process.pid),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
+ # server_process is not set when "http_server.py stop" is run manually.
+ if server_process is None:
+ # TODO(mmoss) This isn't ideal, since it could conflict with lighttpd
+ # processes not started by http_server.py, but good enough for now.
+ subprocess.call(['killall', '-u', os.getenv('USER'), '-TERM', 'lighttpd'])
+ else:
+ os.kill(server_process.pid, signal.SIGTERM)
def WDiffExecutablePath(self):
"""Path to the WDiff executable, which we assume is already installed and