Changeset 203400 in webkit
- Timestamp:
- Jul 19, 2016 12:38:55 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203394 r203400 1 2016-07-19 Youenn Fablet <youenn@apple.com> 2 3 Add new aliases to http test server 4 https://bugs.webkit.org/show_bug.cgi?id=159878 5 6 Reviewed by Darin Adler. 7 8 * http/tests/xmlhttprequest/set-bad-headervalue.html: Updating testharness.js and testharnessreport.js links to 9 ensure these new links are working on test servers. 10 1 11 2016-07-18 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html
r188333 r203400 4 4 <meta charset="utf-8"> 5 5 <title>XMLHttpRequest: setRequestHeader() value argument checks</title> 6 <script src="/ js-test-resources/testharness.js"></script>7 <script src="/ js-test-resources/testharnessreport.js"></script>6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 8 <!-- Test based on http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/setrequestheader-bogus-value.htm This test should be removed once wpt XMLHttpRequest is imported if both tests are in sync --> 9 9 </head> -
trunk/Tools/ChangeLog
r203386 r203400 1 2016-07-19 Youenn Fablet <youenn@apple.com> 2 3 Add new aliases to http test server 4 https://bugs.webkit.org/show_bug.cgi?id=159878 5 6 Reviewed by Darin Adler. 7 8 Adding testharness.css, testharness.js and testharnessreport.js new aliases to http test servers. 9 Adding explicitly these links to perl script. 10 Extracting default alias in an aliases.json file. 11 Reading that file from python scripts to initialize aliases from that file. 12 13 Python script changes covered by unit tests and changed layout test. 14 15 * Scripts/webkitperl/httpd.pm: 16 (getDefaultConfigForTestDirectory): Adding 3 new aliases 17 * Scripts/webkitpy/layout_tests/servers/aliases.json: Added. 18 * Scripts/webkitpy/layout_tests/servers/apache_http_server.py: 19 (LayoutTestApacheHttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter. 20 Adding -c directives for each alias. 21 * Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py: 22 (TestLayoutTestApacheHttpd.test_start_cmd): Adding aliases.json mock-up file. 23 * Scripts/webkitpy/layout_tests/servers/http_server.py: 24 (Lighttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter. 25 Adding alias directive for each alias. 26 (Lighttpd._prepare_config): 27 * Scripts/webkitpy/layout_tests/servers/http_server_base.py: 28 (HttpServerBase.__init__): Adding tests_dir member with a default value being layout tests directory. 29 (HttpServerBase.aliases): Computing of alias from the json file, paths to the real files being relative to 30 layout tests directory. 31 * Scripts/webkitpy/layout_tests/servers/http_server_unittest.py: 32 (TestHttpServer.test_start_cmd): Adding aliases.json mock-up file and updating test expectation. 33 (TestHttpServer.test_win32_start_and_stop): Adding aliases.json mock-up file. 34 1 35 2016-07-18 Aakash Jain <aakash_jain@apple.com> 2 36 -
trunk/Tools/Scripts/webkitperl/httpd.pm
r179405 r203400 113 113 my $httpdConfig = getHTTPDConfigPathForTestDirectory($testDirectory); 114 114 my $documentRoot = File::Spec->catfile($testDirectory, "http", "tests"); 115 116 # Aliases should be kept synchronized with Tools/Scripts/webkitpy/layout_tests/servers/aliases.json. 115 117 my $jsTestResourcesDirectory = File::Spec->catfile($testDirectory, "resources"); 116 118 my $mediaResourcesDirectory = File::Spec->catfile($testDirectory, "media"); 119 my $testharnesscssDirectory = File::Spec->catfile($testDirectory, "resources", "testharness.css"); 120 my $testharnessjsDirectory = File::Spec->catfile($testDirectory, "resources", "testharness.js"); 121 my $testharnessreportjsDirectory = File::Spec->catfile($testDirectory, "resources", "testharnessreport.js"); 122 117 123 my $typesConfig = File::Spec->catfile($testDirectory, "http", "conf", "mime.types"); 118 124 my $httpdLockFile = File::Spec->catfile($httpdPidDir, "httpd.lock"); … … 125 131 "-c", "Alias /js-test-resources \"$jsTestResourcesDirectory\"", 126 132 "-c", "Alias /media-resources \"$mediaResourcesDirectory\"", 133 "-c", "Alias /testharness.css \"$testharnesscssDirectory\"", 134 "-c", "Alias /testharness.js \"$testharnessjsDirectory\"", 135 "-c", "Alias /testharnessreport.js \"$testharnessreportjsDirectory\"", 127 136 "-c", "TypesConfig \"$typesConfig\"", 128 137 # Apache wouldn't run CGIs with permissions==700 otherwise -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py
r196778 r203400 35 35 import re 36 36 import socket 37 import sys38 37 39 38 from webkitpy.layout_tests.servers import http_server_base … … 66 65 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name) 67 66 68 test_dir = self._port_obj.layout_tests_dir()69 70 67 if port_obj.host.platform.is_win(): 71 68 # Convert to MSDOS file naming: … … 74 71 output_dir = precompiledBuildbot.sub("C:/cygwin/home/buildbot", output_dir) 75 72 output_dir = precompiledDrive.sub("C:", output_dir) 76 test_dir = precompiledBuildbot.sub("C:/cygwin/home/buildbot", test_dir)77 test_dir = precompiledDrive.sub("C:", test_dir)73 self.tests_dir = precompiledBuildbot.sub("C:/cygwin/home/buildbot", self.tests_dir) 74 self.tests_dir = precompiledDrive.sub("C:", self.tests_dir) 78 75 self._pid_file = self._filesystem.join("C:/xampp/apache/logs", '%s.pid' % self._name) 79 76 80 js_test_resources_dir = self._filesystem.join(test_dir, "resources") 81 media_resources_dir = self._filesystem.join(test_dir, "media") 82 mime_types_path = self._filesystem.join(test_dir, "http", "conf", "mime.types") 83 cert_file = self._filesystem.join(test_dir, "http", "conf", "webkit-httpd.pem") 77 mime_types_path = self._filesystem.join(self.tests_dir, "http", "conf", "mime.types") 78 cert_file = self._filesystem.join(self.tests_dir, "http", "conf", "webkit-httpd.pem") 84 79 access_log = self._filesystem.join(output_dir, "access_log.txt") 85 80 error_log = self._filesystem.join(output_dir, "error_log.txt") 86 document_root = self._filesystem.join( test_dir, "http", "tests")81 document_root = self._filesystem.join(self.tests_dir, "http", "tests") 87 82 88 83 if port_obj.get_option('http_access_log'): … … 96 91 97 92 start_cmd = [executable, 98 '-f', "\"%s\"" % self._get_apache_config_file_path( test_dir, output_dir),93 '-f', "\"%s\"" % self._get_apache_config_file_path(self.tests_dir, output_dir), 99 94 '-C', "\'DocumentRoot \"%s\"\'" % document_root, 100 '-c', "\'Alias /js-test-resources \"%s\"'" % js_test_resources_dir,101 '-c', "\'Alias /media-resources \"%s\"'" % media_resources_dir,102 95 '-c', "\'TypesConfig \"%s\"\'" % mime_types_path, 103 96 '-c', "\'CustomLog \"%s\" common\'" % access_log, … … 105 98 '-c', "\'PidFile %s'" % self._pid_file, 106 99 '-k', "start"] 100 101 for alias in self.aliases(): 102 start_cmd.extend(['-c', "\'Alias %s \"%s\"'" % (alias[0], alias[1])]) 107 103 108 104 if not port_obj.host.platform.is_win(): … … 144 140 145 141 stop_cmd = [executable, 146 '-f', "\"%s\"" % self._get_apache_config_file_path( test_dir, output_dir),142 '-f', "\"%s\"" % self._get_apache_config_file_path(self.tests_dir, output_dir), 147 143 '-c', "\'PidFile %s'" % self._pid_file, 148 144 '-k', "stop"] -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py
r192944 r203400 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import re30 29 import sys 31 30 import unittest … … 36 35 from webkitpy.port import test 37 36 from webkitpy.layout_tests.servers.apache_http_server import LayoutTestApacheHttpd 38 from webkitpy.layout_tests.servers.http_server_base import ServerError39 37 40 38 … … 53 51 test_port = test.TestPort(host) 54 52 host.filesystem.write_text_file(test_port._path_to_apache_config_file(), '') 53 host.filesystem.write_text_file( 54 "/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json", '[["/js-test-resources", "resources"], ["/media-resources", "media"], ["/test/test.file", "resources/testfile"]]') 55 55 56 56 server = LayoutTestApacheHttpd(test_port, "/mock/output_dir") -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py
r196778 r203400 55 55 self._run_background = run_background 56 56 self._additional_dirs = additional_dirs 57 self._layout_tests_dir = layout_tests_dir 57 if layout_tests_dir: 58 self.tests_dir = layout_tests_dir 58 59 59 60 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name) … … 62 63 self._port = int(self._port) 63 64 64 if not self._layout_tests_dir: 65 self._layout_tests_dir = self._port_obj.layout_tests_dir() 66 67 self._webkit_tests = os.path.join(self._layout_tests_dir, 'http', 'tests') 68 self._js_test_resource = os.path.join(self._layout_tests_dir, 'resources') 69 self._media_resource = os.path.join(self._layout_tests_dir, 'media') 65 self._webkit_tests = os.path.join(self.tests_dir, 'http', 'tests') 70 66 71 67 # Self generated certificate for SSL server (for client cert get … … 127 123 f.write(('server.upload-dirs = ( "%s" )\n\n') % (self._output_dir)) 128 124 129 # Setup a link to where the js test templates are stored 130 f.write(('alias.url = ( "/js-test-resources" => "%s" )\n\n') % 131 (self._js_test_resource)) 125 # Setup a link to where the js test templates and media resources are stored. 126 operator = "=" 127 for alias in self.aliases(): 128 f.write(('alias.url %s ( "%s" => "%s" )\n\n') % (operator, alias[0], alias[1])) 129 operator = "+=" 132 130 133 131 if self._additional_dirs: 134 132 for alias, path in self._additional_dirs.iteritems(): 135 133 f.write(('alias.url += ( "%s" => "%s" )\n\n') % (alias, path)) 136 137 # Setup a link to where the media resources are stored.138 f.write(('alias.url += ( "/media-resources" => "%s" )\n\n') %139 (self._media_resource))140 134 141 135 # dump out of virtual host config at the bottom. -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py
r192944 r203400 30 30 31 31 import errno 32 import json 32 33 import logging 33 34 import socket … … 55 56 self._pid_file = None 56 57 self._port_obj = port_obj 58 self.tests_dir = self._port_obj.layout_tests_dir() 57 59 58 60 # We need a non-checkout-dependent place to put lock files, etc. We … … 154 156 155 157 # Utility routines. 158 159 def aliases(self): 160 json_data = self._filesystem.read_text_file(self._port_obj.path_from_webkit_base("Tools", "Scripts", "webkitpy", "layout_tests", "servers", "aliases.json")) 161 results = [] 162 for item in json.loads(json_data): 163 results.append([item[0], self._port_obj._filesystem.join(self.tests_dir, item[1])]) 164 return results 156 165 157 166 def _remove_pid_file(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py
r192944 r203400 48 48 "/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/lighttpd.conf", "Mock Config\n") 49 49 host.filesystem.write_text_file( 50 "/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json", '[["/js-test-resources", "resources"], ["/media-resources", "media"], ["/test/test.file", "resources/testfile"]]') 51 host.filesystem.write_text_file( 50 52 "/usr/lib/lighttpd/liblightcomp.dylib", "Mock dylib") 51 53 … … 59 61 self.assertEqual(re.findall(r"alias.url.+", config_file), [ 60 62 'alias.url = ( "/js-test-resources" => "/test.checkout/LayoutTests/resources" )', 63 'alias.url += ( "/media-resources" => "/test.checkout/LayoutTests/media" )', 64 'alias.url += ( "/test/test.file" => "/test.checkout/LayoutTests/resources/testfile" )', 61 65 'alias.url += ( "/mock/one-additional-dir" => "/mock-checkout/one-additional-dir" )', 62 66 'alias.url += ( "/mock/another-additional-dir" => "/mock-checkout/one-additional-dir" )', 63 'alias.url += ( "/media-resources" => "/test.checkout/LayoutTests/media" )',64 67 ]) 65 68 … … 71 74 host.filesystem.write_text_file( 72 75 "/usr/lib/lighttpd/liblightcomp.dylib", "Mock dylib") 76 host.filesystem.write_text_file( 77 "/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json", '[["/js-test-resources", "resources"], ["/media-resources", "media"], ["/test/test.file", "resources/testfile"]]') 73 78 74 79 host.platform.is_win = lambda: True
Note: See TracChangeset
for help on using the changeset viewer.