summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py')
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py60
1 files changed, 32 insertions, 28 deletions
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 5eb0ba1..2e3de85 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -29,6 +29,7 @@
"""Chromium Win implementation of the Port interface."""
+import logging
import os
import platform
import signal
@@ -37,6 +38,8 @@ import sys
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_win")
+
class ChromiumWinPort(chromium.ChromiumPort):
"""Chromium Win implementation of the Port class."""
@@ -44,33 +47,37 @@ class ChromiumWinPort(chromium.ChromiumPort):
def __init__(self, port_name=None, options=None):
if port_name is None:
port_name = 'chromium-win' + self.version()
- if options and not hasattr(options, 'target'):
- options.target = 'Release'
+ if options and not hasattr(options, 'configuration'):
+ options.configuration = 'Release'
chromium.ChromiumPort.__init__(self, port_name, options)
def baseline_search_path(self):
dirs = []
if self._name == 'chromium-win-xp':
- dirs.append(self._chromium_baseline_path(self._name))
+ dirs.append(self._webkit_baseline_path('chromium-win-xp'))
if self._name in ('chromium-win-xp', 'chromium-win-vista'):
- dirs.append(self._chromium_baseline_path('chromium-win-vista'))
- dirs.append(self._chromium_baseline_path('chromium-win'))
+ dirs.append(self._webkit_baseline_path('chromium-win-vista'))
+ dirs.append(self._webkit_baseline_path('chromium-win'))
+ dirs.append(self._webkit_baseline_path('chromium'))
dirs.append(self._webkit_baseline_path('win'))
dirs.append(self._webkit_baseline_path('mac'))
return dirs
- def check_sys_deps(self):
- # TODO(dpranke): implement this
- return True
+ def check_build(self, needs_http):
+ result = chromium.ChromiumPort.check_build(self, needs_http)
+ if not result:
+ _log.error('For complete Windows build requirements, please '
+ 'see:')
+ _log.error('')
+ _log.error(' http://dev.chromium.org/developers/how-tos/'
+ 'build-instructions-windows')
+ return result
def get_absolute_path(self, filename):
"""Return the absolute path in unix format for the given filename."""
abspath = os.path.abspath(filename)
return abspath.replace('\\', '/')
- def num_cores(self):
- return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
-
def relative_test_filename(self, filename):
path = filename[len(self.layout_tests_dir()) + 1:]
return path.replace('\\', '/')
@@ -80,6 +87,8 @@ class ChromiumWinPort(chromium.ChromiumPort):
return 'win' + self.version()
def version(self):
+ if not hasattr(sys, 'getwindowsversion'):
+ return ''
winver = sys.getwindowsversion()
if winver[0] == 6 and (winver[1] == 1):
return '-7'
@@ -94,24 +103,15 @@ class ChromiumWinPort(chromium.ChromiumPort):
#
def _build_path(self, *comps):
- # FIXME(dpranke): allow for builds under 'chrome' as well.
- return self.path_from_chromium_base('webkit', self._options.target,
- *comps)
+ p = self.path_from_chromium_base('webkit', *comps)
+ if os.path.exists(p):
+ return p
+ return self.path_from_chromium_base('chrome', *comps)
def _lighttpd_path(self, *comps):
return self.path_from_chromium_base('third_party', 'lighttpd', 'win',
*comps)
- def _kill_process(self, pid):
- """Forcefully kill the process.
-
- Args:
- pid: The id of the process to be killed.
- """
- subprocess.call(('taskkill.exe', '/f', '/pid', str(pid)),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
-
def _path_to_apache(self):
return self.path_from_chromium_base('third_party', 'cygwin', 'usr',
'sbin', 'httpd')
@@ -129,14 +129,16 @@ class ChromiumWinPort(chromium.ChromiumPort):
def _path_to_lighttpd_php(self):
return self._lighttpd_path('php5', 'php-cgi.exe')
- def _path_to_driver(self):
- return self._build_path('test_shell.exe')
+ def _path_to_driver(self, configuration=None):
+ if not configuration:
+ configuration = self._options.configuration
+ return self._build_path(configuration, 'test_shell.exe')
def _path_to_helper(self):
- return self._build_path('layout_test_helper.exe')
+ return self._build_path(self._options.configuration, 'layout_test_helper.exe')
def _path_to_image_diff(self):
- return self._build_path('image_diff.exe')
+ return self._build_path(self._options.configuration, 'image_diff.exe')
def _path_to_wdiff(self):
return self.path_from_chromium_base('third_party', 'cygwin', 'bin',
@@ -150,8 +152,10 @@ class ChromiumWinPort(chromium.ChromiumPort):
server_pid: The process ID of the running server.
"""
subprocess.Popen(('taskkill.exe', '/f', '/im', 'LightTPD.exe'),
+ stdin=open(os.devnull, 'r'),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).wait()
subprocess.Popen(('taskkill.exe', '/f', '/im', 'httpd.exe'),
+ stdin=open(os.devnull, 'r'),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).wait()