<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203400] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203400">203400</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-07-19 00:38:55 -0700 (Tue, 19 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add new aliases to http test server
https://bugs.webkit.org/show_bug.cgi?id=159878

Patch by Youenn Fablet &lt;youenn@apple.com&gt; on 2016-07-19
Reviewed by Darin Adler.

Tools:

Adding testharness.css, testharness.js and testharnessreport.js new aliases to http test servers.
Adding explicitly these links to perl script.
Extracting default alias in an aliases.json file.
Reading that file from python scripts to initialize aliases from that file.

Python script changes covered by unit tests and changed layout test.

* Scripts/webkitperl/httpd.pm:
(getDefaultConfigForTestDirectory): Adding 3 new aliases
* Scripts/webkitpy/layout_tests/servers/aliases.json: Added.
* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
Adding -c directives for each alias.
* Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py:
(TestLayoutTestApacheHttpd.test_start_cmd): Adding aliases.json mock-up file.
* Scripts/webkitpy/layout_tests/servers/http_server.py:
(Lighttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
Adding alias directive for each alias.
(Lighttpd._prepare_config):
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
(HttpServerBase.__init__): Adding tests_dir member with a default value being layout tests directory.
(HttpServerBase.aliases): Computing of alias from the json file, paths to the real files being relative to
layout tests directory.
* Scripts/webkitpy/layout_tests/servers/http_server_unittest.py:
(TestHttpServer.test_start_cmd): Adding aliases.json mock-up file and updating test expectation.
(TestHttpServer.test_win32_start_and_stop): Adding aliases.json mock-up file.

LayoutTests:

* http/tests/xmlhttprequest/set-bad-headervalue.html: Updating testharness.js and testharnessreport.js links to
ensure these new links are working on test servers.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestsxmlhttprequestsetbadheadervaluehtml">trunk/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitperlhttpdpm">trunk/Tools/Scripts/webkitperl/httpd.pm</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsserversapache_http_serverpy">trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsserversapache_http_server_unittestpy">trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsservershttp_serverpy">trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsservershttp_server_basepy">trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsservershttp_server_unittestpy">trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsScriptswebkitpylayout_testsserversaliasesjson">trunk/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/LayoutTests/ChangeLog        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-07-19  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Add new aliases to http test server
+        https://bugs.webkit.org/show_bug.cgi?id=159878
+
+        Reviewed by Darin Adler.
+
+        * http/tests/xmlhttprequest/set-bad-headervalue.html: Updating testharness.js and testharnessreport.js links to
+        ensure these new links are working on test servers.
+
</ins><span class="cx"> 2016-07-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         input.formEnctype / formMethod and button.formEnctype / formMethod / type should treat null as &quot;null&quot;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsxmlhttprequestsetbadheadervaluehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -3,8 +3,8 @@
</span><span class="cx">   &lt;head&gt;
</span><span class="cx">     &lt;meta charset=&quot;utf-8&quot;&gt;
</span><span class="cx">     &lt;title&gt;XMLHttpRequest: setRequestHeader() value argument checks&lt;/title&gt;
</span><del>-    &lt;script src=&quot;/js-test-resources/testharness.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;/js-test-resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
</del><ins>+    &lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;!-- 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 --&gt;
</span><span class="cx">   &lt;/head&gt;
</span><span class="cx">   &lt;body&gt;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/ChangeLog        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-07-19  Youenn Fablet  &lt;youenn@apple.com&gt;
+
+        Add new aliases to http test server
+        https://bugs.webkit.org/show_bug.cgi?id=159878
+
+        Reviewed by Darin Adler.
+
+        Adding testharness.css, testharness.js and testharnessreport.js new aliases to http test servers.
+        Adding explicitly these links to perl script.
+        Extracting default alias in an aliases.json file.
+        Reading that file from python scripts to initialize aliases from that file.
+
+        Python script changes covered by unit tests and changed layout test.
+
+        * Scripts/webkitperl/httpd.pm:
+        (getDefaultConfigForTestDirectory): Adding 3 new aliases
+        * Scripts/webkitpy/layout_tests/servers/aliases.json: Added.
+        * Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
+        (LayoutTestApacheHttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
+        Adding -c directives for each alias.
+        * Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py:
+        (TestLayoutTestApacheHttpd.test_start_cmd): Adding aliases.json mock-up file.
+        * Scripts/webkitpy/layout_tests/servers/http_server.py:
+        (Lighttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
+        Adding alias directive for each alias.
+        (Lighttpd._prepare_config):
+        * Scripts/webkitpy/layout_tests/servers/http_server_base.py:
+        (HttpServerBase.__init__): Adding tests_dir member with a default value being layout tests directory.
+        (HttpServerBase.aliases): Computing of alias from the json file, paths to the real files being relative to
+        layout tests directory.
+        * Scripts/webkitpy/layout_tests/servers/http_server_unittest.py:
+        (TestHttpServer.test_start_cmd): Adding aliases.json mock-up file and updating test expectation.
+        (TestHttpServer.test_win32_start_and_stop): Adding aliases.json mock-up file.
+
</ins><span class="cx"> 2016-07-18  Aakash Jain  &lt;aakash_jain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         EWS console logs doesn't go to log file
</span></span></pre></div>
<a id="trunkToolsScriptswebkitperlhttpdpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitperl/httpd.pm (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitperl/httpd.pm        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitperl/httpd.pm        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -112,8 +112,14 @@
</span><span class="cx"> 
</span><span class="cx">     my $httpdConfig = getHTTPDConfigPathForTestDirectory($testDirectory);
</span><span class="cx">     my $documentRoot = File::Spec-&gt;catfile($testDirectory, &quot;http&quot;, &quot;tests&quot;);
</span><ins>+
+    # Aliases should be kept synchronized with Tools/Scripts/webkitpy/layout_tests/servers/aliases.json.
</ins><span class="cx">     my $jsTestResourcesDirectory = File::Spec-&gt;catfile($testDirectory, &quot;resources&quot;);
</span><span class="cx">     my $mediaResourcesDirectory = File::Spec-&gt;catfile($testDirectory, &quot;media&quot;);
</span><ins>+    my $testharnesscssDirectory = File::Spec-&gt;catfile($testDirectory, &quot;resources&quot;, &quot;testharness.css&quot;);
+    my $testharnessjsDirectory = File::Spec-&gt;catfile($testDirectory, &quot;resources&quot;, &quot;testharness.js&quot;);
+    my $testharnessreportjsDirectory = File::Spec-&gt;catfile($testDirectory, &quot;resources&quot;, &quot;testharnessreport.js&quot;);
+
</ins><span class="cx">     my $typesConfig = File::Spec-&gt;catfile($testDirectory, &quot;http&quot;, &quot;conf&quot;, &quot;mime.types&quot;);
</span><span class="cx">     my $httpdLockFile = File::Spec-&gt;catfile($httpdPidDir, &quot;httpd.lock&quot;);
</span><span class="cx">     my $httpdScoreBoardFile = File::Spec-&gt;catfile($httpdPidDir, &quot;httpd.scoreboard&quot;);
</span><span class="lines">@@ -124,6 +130,9 @@
</span><span class="cx">         # Setup a link to where the js test templates are stored, use -c so that mod_alias will already be loaded.
</span><span class="cx">         &quot;-c&quot;, &quot;Alias /js-test-resources \&quot;$jsTestResourcesDirectory\&quot;&quot;,
</span><span class="cx">         &quot;-c&quot;, &quot;Alias /media-resources \&quot;$mediaResourcesDirectory\&quot;&quot;,
</span><ins>+        &quot;-c&quot;, &quot;Alias /testharness.css \&quot;$testharnesscssDirectory\&quot;&quot;,
+        &quot;-c&quot;, &quot;Alias /testharness.js \&quot;$testharnessjsDirectory\&quot;&quot;,
+        &quot;-c&quot;, &quot;Alias /testharnessreport.js \&quot;$testharnessreportjsDirectory\&quot;&quot;,
</ins><span class="cx">         &quot;-c&quot;, &quot;TypesConfig \&quot;$typesConfig\&quot;&quot;,
</span><span class="cx">         # Apache wouldn't run CGIs with permissions==700 otherwise
</span><span class="cx">         &quot;-c&quot;, &quot;PidFile \&quot;$httpdPidFile\&quot;&quot;,
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsserversaliasesjson"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json (0 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json                                (rev 0)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+[
+    [&quot;/js-test-resources&quot;, &quot;resources&quot;],
+    [&quot;/media-resources&quot;, &quot;media&quot;],
+    [&quot;/resources/testharness.css&quot;, &quot;resources/testharness.css&quot;],
+    [&quot;/resources/testharness.js&quot;, &quot;resources/testharness.js&quot;],
+    [&quot;/resources/testharnessreport.js&quot;, &quot;resources/testharnessreport.js&quot;]
+]
</ins></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsserversapache_http_serverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> import os
</span><span class="cx"> import re
</span><span class="cx"> import socket
</span><del>-import sys
</del><span class="cx"> 
</span><span class="cx"> from webkitpy.layout_tests.servers import http_server_base
</span><span class="cx"> 
</span><span class="lines">@@ -65,8 +64,6 @@
</span><span class="cx"> 
</span><span class="cx">         self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name)
</span><span class="cx"> 
</span><del>-        test_dir = self._port_obj.layout_tests_dir()
-
</del><span class="cx">         if port_obj.host.platform.is_win():
</span><span class="cx">             # Convert to MSDOS file naming:
</span><span class="cx">             precompiledBuildbot = re.compile('^/home/buildbot')
</span><span class="lines">@@ -73,17 +70,15 @@
</span><span class="cx">             precompiledDrive = re.compile('^/cygdrive/[cC]')
</span><span class="cx">             output_dir = precompiledBuildbot.sub(&quot;C:/cygwin/home/buildbot&quot;, output_dir)
</span><span class="cx">             output_dir = precompiledDrive.sub(&quot;C:&quot;, output_dir)
</span><del>-            test_dir = precompiledBuildbot.sub(&quot;C:/cygwin/home/buildbot&quot;, test_dir)
-            test_dir = precompiledDrive.sub(&quot;C:&quot;, test_dir)
</del><ins>+            self.tests_dir = precompiledBuildbot.sub(&quot;C:/cygwin/home/buildbot&quot;, self.tests_dir)
+            self.tests_dir = precompiledDrive.sub(&quot;C:&quot;, self.tests_dir)
</ins><span class="cx">             self._pid_file = self._filesystem.join(&quot;C:/xampp/apache/logs&quot;, '%s.pid' % self._name)
</span><span class="cx"> 
</span><del>-        js_test_resources_dir = self._filesystem.join(test_dir, &quot;resources&quot;)
-        media_resources_dir = self._filesystem.join(test_dir, &quot;media&quot;)
-        mime_types_path = self._filesystem.join(test_dir, &quot;http&quot;, &quot;conf&quot;, &quot;mime.types&quot;)
-        cert_file = self._filesystem.join(test_dir, &quot;http&quot;, &quot;conf&quot;, &quot;webkit-httpd.pem&quot;)
</del><ins>+        mime_types_path = self._filesystem.join(self.tests_dir, &quot;http&quot;, &quot;conf&quot;, &quot;mime.types&quot;)
+        cert_file = self._filesystem.join(self.tests_dir, &quot;http&quot;, &quot;conf&quot;, &quot;webkit-httpd.pem&quot;)
</ins><span class="cx">         access_log = self._filesystem.join(output_dir, &quot;access_log.txt&quot;)
</span><span class="cx">         error_log = self._filesystem.join(output_dir, &quot;error_log.txt&quot;)
</span><del>-        document_root = self._filesystem.join(test_dir, &quot;http&quot;, &quot;tests&quot;)
</del><ins>+        document_root = self._filesystem.join(self.tests_dir, &quot;http&quot;, &quot;tests&quot;)
</ins><span class="cx"> 
</span><span class="cx">         if port_obj.get_option('http_access_log'):
</span><span class="cx">             access_log = port_obj.get_option('http_access_log')
</span><span class="lines">@@ -95,10 +90,8 @@
</span><span class="cx">         executable = self._port_obj._path_to_apache()
</span><span class="cx"> 
</span><span class="cx">         start_cmd = [executable,
</span><del>-            '-f', &quot;\&quot;%s\&quot;&quot; % self._get_apache_config_file_path(test_dir, output_dir),
</del><ins>+            '-f', &quot;\&quot;%s\&quot;&quot; % self._get_apache_config_file_path(self.tests_dir, output_dir),
</ins><span class="cx">             '-C', &quot;\'DocumentRoot \&quot;%s\&quot;\'&quot; % document_root,
</span><del>-            '-c', &quot;\'Alias /js-test-resources \&quot;%s\&quot;'&quot; % js_test_resources_dir,
-            '-c', &quot;\'Alias /media-resources \&quot;%s\&quot;'&quot; % media_resources_dir,
</del><span class="cx">             '-c', &quot;\'TypesConfig \&quot;%s\&quot;\'&quot; % mime_types_path,
</span><span class="cx">             '-c', &quot;\'CustomLog \&quot;%s\&quot; common\'&quot; % access_log,
</span><span class="cx">             '-c', &quot;\'ErrorLog \&quot;%s\&quot;\'&quot; % error_log,
</span><span class="lines">@@ -105,6 +98,9 @@
</span><span class="cx">             '-c', &quot;\'PidFile %s'&quot; % self._pid_file,
</span><span class="cx">             '-k', &quot;start&quot;]
</span><span class="cx"> 
</span><ins>+        for alias in self.aliases():
+            start_cmd.extend(['-c', &quot;\'Alias %s \&quot;%s\&quot;'&quot; % (alias[0], alias[1])])
+
</ins><span class="cx">         if not port_obj.host.platform.is_win():
</span><span class="cx">             start_cmd.extend(['-C', &quot;\'User \&quot;%s\&quot;\'&quot; % os.environ.get(&quot;USERNAME&quot;, os.environ.get(&quot;USER&quot;, &quot;&quot;))])
</span><span class="cx"> 
</span><span class="lines">@@ -143,7 +139,7 @@
</span><span class="cx">                         '-c', &quot;\'&lt;/Location&gt;\'&quot;]
</span><span class="cx"> 
</span><span class="cx">         stop_cmd = [executable,
</span><del>-            '-f', &quot;\&quot;%s\&quot;&quot; % self._get_apache_config_file_path(test_dir, output_dir),
</del><ins>+            '-f', &quot;\&quot;%s\&quot;&quot; % self._get_apache_config_file_path(self.tests_dir, output_dir),
</ins><span class="cx">             '-c', &quot;\'PidFile %s'&quot; % self._pid_file,
</span><span class="cx">             '-k', &quot;stop&quot;]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsserversapache_http_server_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><del>-import re
</del><span class="cx"> import sys
</span><span class="cx"> import unittest
</span><span class="cx"> 
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> from webkitpy.common.host_mock import MockHost
</span><span class="cx"> from webkitpy.port import test
</span><span class="cx"> from webkitpy.layout_tests.servers.apache_http_server import LayoutTestApacheHttpd
</span><del>-from webkitpy.layout_tests.servers.http_server_base import ServerError
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class TestLayoutTestApacheHttpd(unittest.TestCase):
</span><span class="lines">@@ -52,6 +50,8 @@
</span><span class="cx">         host.executive = MockExecutive(should_log=True)
</span><span class="cx">         test_port = test.TestPort(host)
</span><span class="cx">         host.filesystem.write_text_file(test_port._path_to_apache_config_file(), '')
</span><ins>+        host.filesystem.write_text_file(
+            &quot;/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json&quot;, '[[&quot;/js-test-resources&quot;, &quot;resources&quot;], [&quot;/media-resources&quot;, &quot;media&quot;], [&quot;/test/test.file&quot;, &quot;resources/testfile&quot;]]')
</ins><span class="cx"> 
</span><span class="cx">         server = LayoutTestApacheHttpd(test_port, &quot;/mock/output_dir&quot;)
</span><span class="cx">         server._check_that_all_ports_are_available = lambda: True
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsservershttp_serverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server.py        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -54,7 +54,8 @@
</span><span class="cx">         self._root = root
</span><span class="cx">         self._run_background = run_background
</span><span class="cx">         self._additional_dirs = additional_dirs
</span><del>-        self._layout_tests_dir = layout_tests_dir
</del><ins>+        if layout_tests_dir:
+            self.tests_dir = layout_tests_dir
</ins><span class="cx"> 
</span><span class="cx">         self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name)
</span><span class="cx"> 
</span><span class="lines">@@ -61,13 +62,8 @@
</span><span class="cx">         if self._port:
</span><span class="cx">             self._port = int(self._port)
</span><span class="cx"> 
</span><del>-        if not self._layout_tests_dir:
-            self._layout_tests_dir = self._port_obj.layout_tests_dir()
</del><ins>+        self._webkit_tests = os.path.join(self.tests_dir, 'http', 'tests')
</ins><span class="cx"> 
</span><del>-        self._webkit_tests = os.path.join(self._layout_tests_dir, 'http', 'tests')
-        self._js_test_resource = os.path.join(self._layout_tests_dir, 'resources')
-        self._media_resource = os.path.join(self._layout_tests_dir, 'media')
-
</del><span class="cx">         # Self generated certificate for SSL server (for client cert get
</span><span class="cx">         # &lt;base-path&gt;\chrome\test\data\ssl\certs\root_ca_cert.crt)
</span><span class="cx">         self._pem_file = os.path.join(
</span><span class="lines">@@ -126,18 +122,16 @@
</span><span class="cx">         # does POST.
</span><span class="cx">         f.write(('server.upload-dirs = ( &quot;%s&quot; )\n\n') % (self._output_dir))
</span><span class="cx"> 
</span><del>-        # Setup a link to where the js test templates are stored
-        f.write(('alias.url = ( &quot;/js-test-resources&quot; =&gt; &quot;%s&quot; )\n\n') %
-                    (self._js_test_resource))
</del><ins>+        # Setup a link to where the js test templates and media resources are stored.
+        operator = &quot;=&quot;
+        for alias in self.aliases():
+            f.write(('alias.url %s ( &quot;%s&quot; =&gt; &quot;%s&quot; )\n\n') % (operator, alias[0], alias[1]))
+            operator = &quot;+=&quot;
</ins><span class="cx"> 
</span><span class="cx">         if self._additional_dirs:
</span><span class="cx">             for alias, path in self._additional_dirs.iteritems():
</span><span class="cx">                 f.write(('alias.url += ( &quot;%s&quot; =&gt; &quot;%s&quot; )\n\n') % (alias, path))
</span><span class="cx"> 
</span><del>-        # Setup a link to where the media resources are stored.
-        f.write(('alias.url += ( &quot;/media-resources&quot; =&gt; &quot;%s&quot; )\n\n') %
-                    (self._media_resource))
-
</del><span class="cx">         # dump out of virtual host config at the bottom.
</span><span class="cx">         if self._root:
</span><span class="cx">             if self._port:
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsservershttp_server_basepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> &quot;&quot;&quot;Base class with common routines between the Apache, Lighttpd, and websocket servers.&quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> import errno
</span><ins>+import json
</ins><span class="cx"> import logging
</span><span class="cx"> import socket
</span><span class="cx"> import sys
</span><span class="lines">@@ -54,6 +55,7 @@
</span><span class="cx">         self._pid = None
</span><span class="cx">         self._pid_file = None
</span><span class="cx">         self._port_obj = port_obj
</span><ins>+        self.tests_dir = self._port_obj.layout_tests_dir()
</ins><span class="cx"> 
</span><span class="cx">         # We need a non-checkout-dependent place to put lock files, etc. We
</span><span class="cx">         # don't use the Python default on the Mac because it defaults to a
</span><span class="lines">@@ -154,6 +156,13 @@
</span><span class="cx"> 
</span><span class="cx">     # Utility routines.
</span><span class="cx"> 
</span><ins>+    def aliases(self):
+        json_data = self._filesystem.read_text_file(self._port_obj.path_from_webkit_base(&quot;Tools&quot;, &quot;Scripts&quot;, &quot;webkitpy&quot;, &quot;layout_tests&quot;, &quot;servers&quot;, &quot;aliases.json&quot;))
+        results = []
+        for item in json.loads(json_data):
+            results.append([item[0], self._port_obj._filesystem.join(self.tests_dir, item[1])])
+        return results
+
</ins><span class="cx">     def _remove_pid_file(self):
</span><span class="cx">         if self._filesystem.exists(self._pid_file):
</span><span class="cx">             self._filesystem.remove(self._pid_file)
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsservershttp_server_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py (203399 => 203400)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py        2016-07-19 06:50:49 UTC (rev 203399)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_unittest.py        2016-07-19 07:38:55 UTC (rev 203400)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx">         host.filesystem.write_text_file(
</span><span class="cx">             &quot;/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/lighttpd.conf&quot;, &quot;Mock Config\n&quot;)
</span><span class="cx">         host.filesystem.write_text_file(
</span><ins>+            &quot;/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json&quot;, '[[&quot;/js-test-resources&quot;, &quot;resources&quot;], [&quot;/media-resources&quot;, &quot;media&quot;], [&quot;/test/test.file&quot;, &quot;resources/testfile&quot;]]')
+        host.filesystem.write_text_file(
</ins><span class="cx">             &quot;/usr/lib/lighttpd/liblightcomp.dylib&quot;, &quot;Mock dylib&quot;)
</span><span class="cx"> 
</span><span class="cx">         server = Lighttpd(test_port, &quot;/mock/output_dir&quot;,
</span><span class="lines">@@ -58,9 +60,10 @@
</span><span class="cx">         config_file = host.filesystem.read_text_file(&quot;/mock/output_dir/lighttpd.conf&quot;)
</span><span class="cx">         self.assertEqual(re.findall(r&quot;alias.url.+&quot;, config_file), [
</span><span class="cx">             'alias.url = ( &quot;/js-test-resources&quot; =&gt; &quot;/test.checkout/LayoutTests/resources&quot; )',
</span><ins>+            'alias.url += ( &quot;/media-resources&quot; =&gt; &quot;/test.checkout/LayoutTests/media&quot; )',
+            'alias.url += ( &quot;/test/test.file&quot; =&gt; &quot;/test.checkout/LayoutTests/resources/testfile&quot; )',
</ins><span class="cx">             'alias.url += ( &quot;/mock/one-additional-dir&quot; =&gt; &quot;/mock-checkout/one-additional-dir&quot; )',
</span><span class="cx">             'alias.url += ( &quot;/mock/another-additional-dir&quot; =&gt; &quot;/mock-checkout/one-additional-dir&quot; )',
</span><del>-            'alias.url += ( &quot;/media-resources&quot; =&gt; &quot;/test.checkout/LayoutTests/media&quot; )',
</del><span class="cx">         ])
</span><span class="cx"> 
</span><span class="cx">     def test_win32_start_and_stop(self):
</span><span class="lines">@@ -70,6 +73,8 @@
</span><span class="cx">             &quot;/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/lighttpd.conf&quot;, &quot;Mock Config\n&quot;)
</span><span class="cx">         host.filesystem.write_text_file(
</span><span class="cx">             &quot;/usr/lib/lighttpd/liblightcomp.dylib&quot;, &quot;Mock dylib&quot;)
</span><ins>+        host.filesystem.write_text_file(
+            &quot;/mock-checkout/Tools/Scripts/webkitpy/layout_tests/servers/aliases.json&quot;, '[[&quot;/js-test-resources&quot;, &quot;resources&quot;], [&quot;/media-resources&quot;, &quot;media&quot;], [&quot;/test/test.file&quot;, &quot;resources/testfile&quot;]]')
</ins><span class="cx"> 
</span><span class="cx">         host.platform.is_win = lambda: True
</span><span class="cx">         host.platform.is_cygwin = lambda: False
</span></span></pre>
</div>
</div>

</body>
</html>