Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 13 matching lines...) Expand all Loading... | |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 """Windows implementation of the Port interface.""" | 29 """Windows implementation of the Port interface.""" |
| 30 | 30 |
| 31 import os | 31 import os |
| 32 import logging | 32 import logging |
| 33 | 33 |
| 34 import _winreg | |
|
scottmg
2014/02/04 04:58:01
This doesn't exist on cygwin, someone will probabl
| |
| 35 | |
| 34 from webkitpy.layout_tests.breakpad.dump_reader_win import DumpReaderWin | 36 from webkitpy.layout_tests.breakpad.dump_reader_win import DumpReaderWin |
| 35 from webkitpy.layout_tests.models import test_run_results | 37 from webkitpy.layout_tests.models import test_run_results |
| 36 from webkitpy.layout_tests.port import base | 38 from webkitpy.layout_tests.port import base |
| 37 from webkitpy.layout_tests.servers import crash_service | 39 from webkitpy.layout_tests.servers import crash_service |
| 38 | 40 |
| 39 | 41 |
| 40 _log = logging.getLogger(__name__) | 42 _log = logging.getLogger(__name__) |
| 41 | 43 |
| 42 | 44 |
| 43 class WinPort(base.Port): | 45 class WinPort(base.Port): |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 71 self._dump_reader = DumpReaderWin(host, self._build_path()) | 73 self._dump_reader = DumpReaderWin(host, self._build_path()) |
| 72 self._crash_service = None | 74 self._crash_service = None |
| 73 self._crash_service_available = None | 75 self._crash_service_available = None |
| 74 | 76 |
| 75 def additional_drt_flag(self): | 77 def additional_drt_flag(self): |
| 76 flags = super(WinPort, self).additional_drt_flag() | 78 flags = super(WinPort, self).additional_drt_flag() |
| 77 if not self.get_option('disable_breakpad'): | 79 if not self.get_option('disable_breakpad'): |
| 78 flags += ['--enable-crash-reporter', '--crash-dumps-dir=%s' % self._ dump_reader.crash_dumps_directory()] | 80 flags += ['--enable-crash-reporter', '--crash-dumps-dir=%s' % self._ dump_reader.crash_dumps_directory()] |
| 79 return flags | 81 return flags |
| 80 | 82 |
| 83 def check_httpd(self): | |
| 84 res = super(WinPort, self).check_httpd() | |
| 85 if self.get_option('use_apache'): | |
| 86 res = self._check_reg(r'.cgi\Shell\ExecCGI\Command') and res | |
| 87 res = self._check_reg(r'.pl\Shell\ExecCGI\Command') and res | |
| 88 return res | |
| 89 | |
| 90 def _check_reg(self, sub_key): | |
| 91 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
| |
| 92 args = _winreg.QueryValue(hkey, '').split() | |
| 93 if len(args) == 2 and self._filesystem.exists(args[0]) and args[0].endsw ith('perl.exe') and args[1] == '-wT': | |
| 94 return True | |
| 95 | |
| 96 cmdline = self.path_from_chromium_base('third_party', 'perl', 'perl', 'b in', 'perl.exe') + ' -wT' | |
| 97 _log.error("Need to set HKCR\\%s to '%s'" % (sub_key, cmdline)) | |
| 98 | |
| 81 def setup_test_run(self): | 99 def setup_test_run(self): |
| 82 super(WinPort, self).setup_test_run() | 100 super(WinPort, self).setup_test_run() |
| 83 | 101 |
| 84 if not self.get_option('disable_breakpad'): | 102 if not self.get_option('disable_breakpad'): |
| 85 assert not self._crash_service, 'Already running a crash service' | 103 assert not self._crash_service, 'Already running a crash service' |
| 86 if self._crash_service_available == None: | 104 if self._crash_service_available == None: |
| 87 self._crash_service_available = self._check_crash_service_availa ble() | 105 self._crash_service_available = self._check_crash_service_availa ble() |
| 88 if not self._crash_service_available: | 106 if not self._crash_service_available: |
| 89 return | 107 return |
| 90 service = crash_service.CrashService(self, self._dump_reader.crash_d umps_directory()) | 108 service = crash_service.CrashService(self, self._dump_reader.crash_d umps_directory()) |
| 91 service.start() | 109 service.start() |
| 92 self._crash_service = service | 110 self._crash_service = service |
| 93 | 111 |
| 94 def clean_up_test_run(self): | 112 def clean_up_test_run(self): |
| 95 super(WinPort, self).clean_up_test_run() | 113 super(WinPort, self).clean_up_test_run() |
| 96 | 114 |
| 97 if self._crash_service: | 115 if self._crash_service: |
| 98 self._crash_service.stop() | 116 self._crash_service.stop() |
| 99 self._crash_service = None | 117 self._crash_service = None |
| 100 | 118 |
| 101 def setup_environ_for_server(self, server_name=None): | 119 def setup_environ_for_server(self, server_name=None): |
| 102 env = super(WinPort, self).setup_environ_for_server(server_name) | 120 env = super(WinPort, self).setup_environ_for_server(server_name) |
| 103 | 121 |
| 104 # FIXME: lighttpd depends on some environment variable we're not whiteli sting. | 122 # FIXME: lighttpd depends on some environment variable we're not whiteli sting. |
| 105 # We should add the variable to an explicit whitelist in base.Port. | 123 # We should add the variable to an explicit whitelist in base.Port. |
| 106 # FIXME: This is a temporary hack to get the cr-win bot online until | 124 # FIXME: This is a temporary hack to get the cr-win bot online until |
| 107 # someone from the cr-win port can take a look. | 125 # someone from the cr-win port can take a look. |
| 126 use_apache = self.get_option('use_apache') | |
| 127 apache_envvars = ['SYSTEMDRIVE', 'SYSTEMROOT', 'TEMP', 'TMP'] | |
| 108 for key, value in os.environ.items(): | 128 for key, value in os.environ.items(): |
| 109 if key not in env: | 129 if key not in env and (not use_apache or key in apache_envvars): |
| 110 env[key] = value | 130 env[key] = value |
| 111 | 131 |
| 132 if use_apache: | |
| 133 return env | |
| 134 | |
| 112 # Put the cygwin directory first in the path to find cygwin1.dll. | 135 # Put the cygwin directory first in the path to find cygwin1.dll. |
| 113 env["PATH"] = "%s;%s" % (self.path_from_chromium_base("third_party", "cy gwin", "bin"), env["PATH"]) | 136 env["PATH"] = "%s;%s" % (self.path_from_chromium_base("third_party", "cy gwin", "bin"), env["PATH"]) |
| 114 # Configure the cygwin directory so that pywebsocket finds proper | 137 # Configure the cygwin directory so that pywebsocket finds proper |
| 115 # python executable to run cgi program. | 138 # python executable to run cgi program. |
| 116 env["CYGWIN_PATH"] = self.path_from_chromium_base("third_party", "cygwin ", "bin") | 139 env["CYGWIN_PATH"] = self.path_from_chromium_base("third_party", "cygwin ", "bin") |
| 117 if self.get_option('register_cygwin'): | 140 if self.get_option('register_cygwin'): |
| 118 setup_mount = self.path_from_chromium_base("third_party", "cygwin", "setup_mount.bat") | 141 setup_mount = self.path_from_chromium_base("third_party", "cygwin", "setup_mount.bat") |
| 119 self._executive.run_command([setup_mount]) # Paths are all absolute , so this does not require a cwd. | 142 self._executive.run_command([setup_mount]) # Paths are all absolute , so this does not require a cwd. |
| 120 return env | 143 return env |
| 121 | 144 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 137 _log.error(' http://dev.chromium.org/developers/how-tos/build-ins tructions-windows') | 160 _log.error(' http://dev.chromium.org/developers/how-tos/build-ins tructions-windows') |
| 138 return result | 161 return result |
| 139 | 162 |
| 140 def operating_system(self): | 163 def operating_system(self): |
| 141 return 'win' | 164 return 'win' |
| 142 | 165 |
| 143 def relative_test_filename(self, filename): | 166 def relative_test_filename(self, filename): |
| 144 path = filename[len(self.layout_tests_dir()) + 1:] | 167 path = filename[len(self.layout_tests_dir()) + 1:] |
| 145 return path.replace('\\', '/') | 168 return path.replace('\\', '/') |
| 146 | 169 |
| 170 def uses_apache(self): | |
| 171 return self.get_option('use_apache') | |
| 172 | |
| 173 def path_to_apache(self): | |
| 174 return self.path_from_chromium_base('third_party', 'apache-win32', 'bin' , 'httpd.exe') | |
| 175 | |
| 176 def path_to_apache_config_file(self): | |
| 177 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'w in-httpd.conf') | |
| 178 | |
| 179 def _lighttpd_path(self, *comps): | |
| 180 return self.path_from_chromium_base('third_party', 'lighttpd', 'win', *c omps) | |
| 181 | |
| 182 def path_to_lighttpd(self): | |
| 183 return self._lighttpd_path('LightTPD.exe') | |
| 184 | |
| 185 def path_to_lighttpd_modules(self): | |
| 186 return self._lighttpd_path('lib') | |
| 187 | |
| 188 def path_to_lighttpd_php(self): | |
| 189 return self._lighttpd_path('php5', 'php-cgi.exe') | |
| 190 | |
| 147 # | 191 # |
| 148 # PROTECTED ROUTINES | 192 # PROTECTED ROUTINES |
| 149 # | 193 # |
| 150 | 194 |
| 151 def _uses_apache(self): | |
| 152 return False | |
| 153 | |
| 154 def _lighttpd_path(self, *comps): | |
| 155 return self.path_from_chromium_base('third_party', 'lighttpd', 'win', *c omps) | |
| 156 | |
| 157 def _path_to_apache(self): | |
| 158 return self.path_from_chromium_base('third_party', 'cygwin', 'usr', 'sbi n', 'httpd') | |
| 159 | |
| 160 def _path_to_apache_config_file(self): | |
| 161 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'c ygwin-httpd.conf') | |
| 162 | |
| 163 def _path_to_lighttpd(self): | |
| 164 return self._lighttpd_path('LightTPD.exe') | |
| 165 | |
| 166 def _path_to_lighttpd_modules(self): | |
| 167 return self._lighttpd_path('lib') | |
| 168 | |
| 169 def _path_to_lighttpd_php(self): | |
| 170 return self._lighttpd_path('php5', 'php-cgi.exe') | |
| 171 | |
| 172 def _path_to_driver(self, configuration=None): | 195 def _path_to_driver(self, configuration=None): |
| 173 binary_name = '%s.exe' % self.driver_name() | 196 binary_name = '%s.exe' % self.driver_name() |
| 174 return self._build_path_with_configuration(configuration, binary_name) | 197 return self._build_path_with_configuration(configuration, binary_name) |
| 175 | 198 |
| 176 def _path_to_helper(self): | 199 def _path_to_helper(self): |
| 177 binary_name = 'layout_test_helper.exe' | 200 binary_name = 'layout_test_helper.exe' |
| 178 return self._build_path(binary_name) | 201 return self._build_path(binary_name) |
| 179 | 202 |
| 180 def _path_to_crash_service(self): | 203 def _path_to_crash_service(self): |
| 181 binary_name = 'content_shell_crash_service.exe' | 204 binary_name = 'content_shell_crash_service.exe' |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 198 return result | 221 return result |
| 199 | 222 |
| 200 def look_for_new_crash_logs(self, crashed_processes, start_time): | 223 def look_for_new_crash_logs(self, crashed_processes, start_time): |
| 201 if self.get_option('disable_breakpad'): | 224 if self.get_option('disable_breakpad'): |
| 202 return None | 225 return None |
| 203 return self._dump_reader.look_for_new_crash_logs(crashed_processes, star t_time) | 226 return self._dump_reader.look_for_new_crash_logs(crashed_processes, star t_time) |
| 204 | 227 |
| 205 def clobber_old_port_specific_results(self): | 228 def clobber_old_port_specific_results(self): |
| 206 if not self.get_option('disable_breakpad'): | 229 if not self.get_option('disable_breakpad'): |
| 207 self._dump_reader.clobber_old_results() | 230 self._dump_reader.clobber_old_results() |
| OLD | NEW |