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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py

Issue 2513423003: DevTools: Convert inspector-unit tests to use reusable test harness (Closed)
Patch Set: Moved type definition out of externs Created 4 years 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 server_root = self._filesystem.dirname(self._filesystem.dirname(executab le)) 56 server_root = self._filesystem.dirname(self._filesystem.dirname(executab le))
57 57
58 test_dir = self._port_obj.layout_tests_dir() 58 test_dir = self._port_obj.layout_tests_dir()
59 document_root = self._filesystem.join(test_dir, "http", "tests") 59 document_root = self._filesystem.join(test_dir, "http", "tests")
60 forms_test_resources_dir = self._filesystem.join(test_dir, "fast", "form s", "resources") 60 forms_test_resources_dir = self._filesystem.join(test_dir, "fast", "form s", "resources")
61 imported_resources_dir = self._filesystem.join(test_dir, "imported", "wp t", "resources") 61 imported_resources_dir = self._filesystem.join(test_dir, "imported", "wp t", "resources")
62 media_resources_dir = self._filesystem.join(test_dir, "media") 62 media_resources_dir = self._filesystem.join(test_dir, "media")
63 mime_types_path = self._filesystem.join(self._port_obj.apache_config_dir ectory(), "mime.types") 63 mime_types_path = self._filesystem.join(self._port_obj.apache_config_dir ectory(), "mime.types")
64 cert_file = self._filesystem.join(self._port_obj.apache_config_directory (), "webkit-httpd.pem") 64 cert_file = self._filesystem.join(self._port_obj.apache_config_directory (), "webkit-httpd.pem")
65 inspector_sources_dir = self._port_obj.inspector_build_directory() 65 inspector_sources_dir = self._port_obj.inspector_build_directory()
66 inspector_debug_dir = self._port_obj.inspector_debug_directory()
67 66
68 self._access_log_path = self._filesystem.join(output_dir, "access_log.tx t") 67 self._access_log_path = self._filesystem.join(output_dir, "access_log.tx t")
69 self._error_log_path = self._filesystem.join(output_dir, "error_log.txt" ) 68 self._error_log_path = self._filesystem.join(output_dir, "error_log.txt" )
70 69
71 self._is_win = self._port_obj.host.platform.is_win() 70 self._is_win = self._port_obj.host.platform.is_win()
72 71
73 start_cmd = [ 72 start_cmd = [
74 executable, 73 executable,
75 '-f', '%s' % self._port_obj.path_to_apache_config_file(), 74 '-f', '%s' % self._port_obj.path_to_apache_config_file(),
76 '-C', 'ServerRoot "%s"' % server_root, 75 '-C', 'ServerRoot "%s"' % server_root,
77 '-C', 'DocumentRoot "%s"' % document_root, 76 '-C', 'DocumentRoot "%s"' % document_root,
78 '-c', 'AliasMatch /(.*/)?js-test-resources/(.+) "%s/$1resources/$2"' % test_dir, 77 '-c', 'AliasMatch /(.*/)?js-test-resources/(.+) "%s/$1resources/$2"' % test_dir,
79 '-c', 'AliasMatch ^/resources/testharness([r.].*) "%s/testharness$1" ' % imported_resources_dir, 78 '-c', 'AliasMatch ^/resources/testharness([r.].*) "%s/testharness$1" ' % imported_resources_dir,
80 '-c', 'Alias /w3c/resources/WebIDLParser.js "%s/webidl2/lib/webidl2. js"' % imported_resources_dir, 79 '-c', 'Alias /w3c/resources/WebIDLParser.js "%s/webidl2/lib/webidl2. js"' % imported_resources_dir,
81 '-c', 'Alias /w3c/resources "%s"' % imported_resources_dir, 80 '-c', 'Alias /w3c/resources "%s"' % imported_resources_dir,
82 '-c', 'Alias /forms-test-resources "%s"' % forms_test_resources_dir, 81 '-c', 'Alias /forms-test-resources "%s"' % forms_test_resources_dir,
83 '-c', 'Alias /media-resources "%s"' % media_resources_dir, 82 '-c', 'Alias /media-resources "%s"' % media_resources_dir,
84 '-c', 'TypesConfig "%s"' % mime_types_path, 83 '-c', 'TypesConfig "%s"' % mime_types_path,
85 '-c', 'CustomLog "%s" common' % self._access_log_path, 84 '-c', 'CustomLog "%s" common' % self._access_log_path,
86 '-c', 'ErrorLog "%s"' % self._error_log_path, 85 '-c', 'ErrorLog "%s"' % self._error_log_path,
87 '-c', 'PidFile %s' % self._pid_file, 86 '-c', 'PidFile %s' % self._pid_file,
88 '-c', 'SSLCertificateFile "%s"' % cert_file, 87 '-c', 'SSLCertificateFile "%s"' % cert_file,
89 '-c', 'Alias /inspector-sources "%s"' % inspector_sources_dir, 88 '-c', 'Alias /inspector-sources "%s"' % inspector_sources_dir,
90 '-c', 'Alias /inspector-debug "%s"' % inspector_debug_dir,
91 '-c', 'DefaultType None', 89 '-c', 'DefaultType None',
92 ] 90 ]
93 91
94 if self._is_win: 92 if self._is_win:
95 start_cmd += ['-c', "ThreadsPerChild %d" % (self._number_of_servers * 8)] 93 start_cmd += ['-c', "ThreadsPerChild %d" % (self._number_of_servers * 8)]
96 else: 94 else:
97 start_cmd += ['-c', "StartServers %d" % self._number_of_servers, 95 start_cmd += ['-c', "StartServers %d" % self._number_of_servers,
98 '-c', "MinSpareServers %d" % self._number_of_servers, 96 '-c', "MinSpareServers %d" % self._number_of_servers,
99 '-c', "MaxSpareServers %d" % self._number_of_servers, 97 '-c', "MaxSpareServers %d" % self._number_of_servers,
100 '-C', 'User "%s"' % self._port_obj.host.environ.get('U SERNAME', 98 '-C', 'User "%s"' % self._port_obj.host.environ.get('U SERNAME',
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 retval = proc.returncode 171 retval = proc.returncode
174 err = proc.stderr.read() 172 err = proc.stderr.read()
175 if retval or len(err): 173 if retval or len(err):
176 raise server_base.ServerError('Failed to stop %s: %s' % (self._name, err)) 174 raise server_base.ServerError('Failed to stop %s: %s' % (self._name, err))
177 175
178 # For some reason apache isn't guaranteed to have actually stopped after 176 # For some reason apache isn't guaranteed to have actually stopped after
179 # the stop command returns, so we wait a little while longer for the 177 # the stop command returns, so we wait a little while longer for the
180 # pid file to be removed. 178 # pid file to be removed.
181 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p id_file)): 179 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p id_file)):
182 raise server_base.ServerError('Failed to stop %s: pid file still exi sts' % self._name) 180 raise server_base.ServerError('Failed to stop %s: pid file still exi sts' % self._name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698