<http://webkit.org/b/151542>
Reviewed by Daniel Bates.
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_url): Use the Port object (already passed in) to give us
the path to the LayoutTests directory, which already checks for a
--layout-tests-directory command-line switch.
(WebPlatformTestServer.__init__): Remove layout_test_results_dir
argument since we can get this from the Port object already
passed in via Port.results_directory(). Also switch to use
Port.layout_tests_dir() to get the LayoutTests directory.
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:
(TestWebPlatformTestServer.test_custom_layout_tests_directory):
Add test case for custom LayoutTests directory.
(TestWebPlatformTestServer.test_previously_spawned_instance):
Update Port object to set mock results directory as if it was
set on the command-line. Remove unneeded argument from
WebPlatformTestServer constructor.
(TestWebPlatformTestServer.test_corrupted_subserver_files): Ditto.
* Scripts/webkitpy/port/base.py:
(Port.to.start_web_platform_test_server): Remove unneeded
argument from WebPlatformTestServer constuctor.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192738
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-11-22 David Kilzer <ddkilzer@apple.com>
+
+ run-webkit-tests: http server for imported W3C tests doesn't work with --layout-tests-directory switch
+ <http://webkit.org/b/151542>
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
+ (base_url): Use the Port object (already passed in) to give us
+ the path to the LayoutTests directory, which already checks for a
+ --layout-tests-directory command-line switch.
+ (WebPlatformTestServer.__init__): Remove layout_test_results_dir
+ argument since we can get this from the Port object already
+ passed in via Port.results_directory(). Also switch to use
+ Port.layout_tests_dir() to get the LayoutTests directory.
+
+ * Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:
+ (TestWebPlatformTestServer.test_custom_layout_tests_directory):
+ Add test case for custom LayoutTests directory.
+ (TestWebPlatformTestServer.test_previously_spawned_instance):
+ Update Port object to set mock results directory as if it was
+ set on the command-line. Remove unneeded argument from
+ WebPlatformTestServer constructor.
+ (TestWebPlatformTestServer.test_corrupted_subserver_files): Ditto.
+
+ * Scripts/webkitpy/port/base.py:
+ (Port.to.start_web_platform_test_server): Remove unneeded
+ argument from WebPlatformTestServer constuctor.
+
2015-11-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Some unit tests fail when using the network process
def base_url(port_obj):
- config_wk_filepath = port_obj.path_from_webkit_base("LayoutTests", "imported", "w3c", "resources", "config.json")
+ config_wk_filepath = port_obj._filesystem.join(port_obj.layout_tests_dir(), "imported", "w3c", "resources", "config.json")
if not port_obj.host.filesystem.isfile(config_wk_filepath):
# This should only be hit by webkitpy unit tests
_log.debug("No WPT config file found")
class WebPlatformTestServer(http_server_base.HttpServerBase):
- def __init__(self, port_obj, name, layout_test_results_dir, pidfile=None):
+ def __init__(self, port_obj, name, pidfile=None):
http_server_base.HttpServerBase.__init__(self, port_obj)
- self._output_dir = layout_test_results_dir
+ self._output_dir = port_obj.results_directory()
self._name = name
self._log_file_name = '%s_process_log.out.txt' % (self._name)
self._stdout_data = None
self._stderr_data = None
self._filesystem = port_obj.host.filesystem
- self._layout_root = port_obj.path_from_webkit_base("LayoutTests")
+ self._layout_root = port_obj.layout_tests_dir()
self._doc_root = self._filesystem.join(self._layout_root, doc_root(port_obj))
self._resources_files_to_copy = ['testharness.css', 'testharnessreport.js']
current_dir_path = self._filesystem.abspath(self._filesystem.split(__file__)[0])
self._start_cmd = ["python", self._filesystem.join(current_dir_path, "web_platform_test_launcher.py"), self._servers_file]
- self._doc_root_path = port_obj.path_from_webkit_base("LayoutTests", self._doc_root)
+ self._doc_root_path = self._filesystem.join(self._layout_root, self._doc_root)
def _install_modules(self):
modules_file_path = self._filesystem.join(self._doc_root_path, "..", "resources", "web-platform-tests-modules.json")
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import imp
+import optparse
import sys
import time
import unittest
class TestWebPlatformTestServer(unittest.TestCase):
def test_previously_spawned_instance(self):
host = MockHost()
- port = Port(host, "test")
- server = WebPlatformTestServer(port, "wpttest", "/mock/output_dir", "/mock/output_dir/pid.txt")
+ options = optparse.Values()
+ options.ensure_value("results_directory", "/mock/output_dir")
+ port = Port(host, "test", options)
+ server = WebPlatformTestServer(port, "wpttest", "/mock/output_dir/pid.txt")
server._check_that_all_ports_are_available = lambda: True
server._is_server_running_on_all_ports = lambda: True
host.filesystem.write_text_file("/mock-checkout/LayoutTests/resources/testharness.js", "0")
server.start()
server.stop()
+ def test_custom_layout_tests_directory(self):
+ host = MockHost()
+ options = optparse.Values()
+ options.ensure_value("layout_tests_dir", "/mock-layout-tests-directory/LayoutTests")
+ options.ensure_value("results_directory", "/mock/output_dir")
+ port = Port(host, "test", options)
+ server = WebPlatformTestServer(port, "wpttest", "/mock/output_dir/pid.txt")
+ server._check_that_all_ports_are_available = lambda: True
+ server._is_server_running_on_all_ports = lambda: True
+ host.filesystem.write_text_file("/mock-layout-tests-directory/LayoutTests/resources/testharness.js", "0")
+ host.filesystem.write_text_file("/mock-layout-tests-directory/LayoutTests/imported/w3c/web-platform-tests/resources/testharness.js", "0")
+
+ host.filesystem.write_text_file("/mock_output_dir/pid.txt", "0")
+ server.start()
+ server.stop()
+
def test_corrupted_subserver_files(self):
host = MockHost()
- port = Port(host, "test")
- server = WebPlatformTestServer(port, "wpttest", "/mock/output_dir", "/mock/output_dir/pid.txt")
+ options = optparse.Values()
+ options.ensure_value("results_directory", "/mock/output_dir")
+ port = Port(host, "test", options)
+ server = WebPlatformTestServer(port, "wpttest", "/mock/output_dir/pid.txt")
server._check_that_all_ports_are_available = lambda: True
server._is_server_running_on_all_ports = lambda: True
host.filesystem.write_text_file("/mock-checkout/LayoutTests/resources/testharness.js", "0")
def start_web_platform_test_server(self, additional_dirs=None, number_of_servers=None):
assert not self._web_platform_test_server, 'Already running a Web Platform Test server.'
- self._web_platform_test_server = web_platform_test_server.WebPlatformTestServer(self, "wptwk", self.results_directory())
+ self._web_platform_test_server = web_platform_test_server.WebPlatformTestServer(self, "wptwk")
self._web_platform_test_server.start()
def web_platform_test_server_doc_root(self):