Chromium Code Reviews| Index: Tools/Scripts/webkitpy/layout_tests/port/win.py |
| diff --git a/Tools/Scripts/webkitpy/layout_tests/port/win.py b/Tools/Scripts/webkitpy/layout_tests/port/win.py |
| index 88e8d0de15e3ef0de01ea1ae4019f43f1fbb7b63..2f022e6317ed72b314a01dbf3b963dfd2f4b982b 100644 |
| --- a/Tools/Scripts/webkitpy/layout_tests/port/win.py |
| +++ b/Tools/Scripts/webkitpy/layout_tests/port/win.py |
| @@ -31,6 +31,8 @@ |
| import os |
| import logging |
| +import _winreg |
|
scottmg
2014/02/04 04:58:01
This doesn't exist on cygwin, someone will probabl
|
| + |
| from webkitpy.layout_tests.breakpad.dump_reader_win import DumpReaderWin |
| from webkitpy.layout_tests.models import test_run_results |
| from webkitpy.layout_tests.port import base |
| @@ -78,6 +80,22 @@ class WinPort(base.Port): |
| flags += ['--enable-crash-reporter', '--crash-dumps-dir=%s' % self._dump_reader.crash_dumps_directory()] |
| return flags |
| + def check_httpd(self): |
| + res = super(WinPort, self).check_httpd() |
| + if self.get_option('use_apache'): |
| + res = self._check_reg(r'.cgi\Shell\ExecCGI\Command') and res |
| + res = self._check_reg(r'.pl\Shell\ExecCGI\Command') and res |
| + return res |
| + |
| + def _check_reg(self, sub_key): |
| + hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, sub_key) |
|
scottmg
2014/02/04 04:58:01
add some sort of rationalization as to why futzing
|
| + args = _winreg.QueryValue(hkey, '').split() |
| + if len(args) == 2 and self._filesystem.exists(args[0]) and args[0].endswith('perl.exe') and args[1] == '-wT': |
| + return True |
| + |
| + cmdline = self.path_from_chromium_base('third_party', 'perl', 'perl', 'bin', 'perl.exe') + ' -wT' |
| + _log.error("Need to set HKCR\\%s to '%s'" % (sub_key, cmdline)) |
| + |
| def setup_test_run(self): |
| super(WinPort, self).setup_test_run() |
| @@ -105,10 +123,15 @@ class WinPort(base.Port): |
| # We should add the variable to an explicit whitelist in base.Port. |
| # FIXME: This is a temporary hack to get the cr-win bot online until |
| # someone from the cr-win port can take a look. |
| + use_apache = self.get_option('use_apache') |
| + apache_envvars = ['SYSTEMDRIVE', 'SYSTEMROOT', 'TEMP', 'TMP'] |
| for key, value in os.environ.items(): |
| - if key not in env: |
| + if key not in env and (not use_apache or key in apache_envvars): |
| env[key] = value |
| + if use_apache: |
| + return env |
| + |
| # Put the cygwin directory first in the path to find cygwin1.dll. |
| env["PATH"] = "%s;%s" % (self.path_from_chromium_base("third_party", "cygwin", "bin"), env["PATH"]) |
| # Configure the cygwin directory so that pywebsocket finds proper |
| @@ -144,31 +167,31 @@ class WinPort(base.Port): |
| path = filename[len(self.layout_tests_dir()) + 1:] |
| return path.replace('\\', '/') |
| - # |
| - # PROTECTED ROUTINES |
| - # |
| + def uses_apache(self): |
| + return self.get_option('use_apache') |
| - def _uses_apache(self): |
| - return False |
| + def path_to_apache(self): |
| + return self.path_from_chromium_base('third_party', 'apache-win32', 'bin', 'httpd.exe') |
| + |
| + def path_to_apache_config_file(self): |
| + return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'win-httpd.conf') |
| def _lighttpd_path(self, *comps): |
| return self.path_from_chromium_base('third_party', 'lighttpd', 'win', *comps) |
| - def _path_to_apache(self): |
| - return self.path_from_chromium_base('third_party', 'cygwin', 'usr', 'sbin', 'httpd') |
| - |
| - def _path_to_apache_config_file(self): |
| - return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'cygwin-httpd.conf') |
| - |
| - def _path_to_lighttpd(self): |
| + def path_to_lighttpd(self): |
| return self._lighttpd_path('LightTPD.exe') |
| - def _path_to_lighttpd_modules(self): |
| + def path_to_lighttpd_modules(self): |
| return self._lighttpd_path('lib') |
| - def _path_to_lighttpd_php(self): |
| + def path_to_lighttpd_php(self): |
| return self._lighttpd_path('php5', 'php-cgi.exe') |
| + # |
| + # PROTECTED ROUTINES |
| + # |
| + |
| def _path_to_driver(self, configuration=None): |
| binary_name = '%s.exe' % self.driver_name() |
| return self._build_path_with_configuration(configuration, binary_name) |