From db2fcd177fd7f3c438d49457c3c194f3354acce1 Mon Sep 17 00:00:00 2001 From: "dpranke@chromium.org" Date: Sat, 29 Jan 2011 01:41:51 +0000 Subject: [PATCH] 2011-01-28 Dirk Pranke Unreviewed, build fix. Take two. The fix in 77023 didn't work, because we were still calling path.abspath_to_uri, which calls _cygpath under the covers, and it appears the cygpath on the bots does something different than it does on my machine. This patch removes the calls to path.abspath_to_uri, so it should be safe. If it doesn't work, I'll roll it out along with r76982 and 77023. https://bugs.webkit.org/show_bug.cgi?id=53126 * Scripts/webkitpy/layout_tests/port/test.py: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77038 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 15 +++++ .../webkitpy/layout_tests/port/test.py | 59 +++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 9c2367077aac..aa93a580a6e4 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,18 @@ +2011-01-28 Dirk Pranke + + Unreviewed, build fix. + + Take two. The fix in 77023 didn't work, because we were + still calling path.abspath_to_uri, which calls _cygpath under + the covers, and it appears the cygpath on the bots does + something different than it does on my machine. This patch + removes the calls to path.abspath_to_uri, so it should be safe. + If it doesn't work, I'll roll it out along with r76982 and 77023. + + https://bugs.webkit.org/show_bug.cgi?id=53126 + + * Scripts/webkitpy/layout_tests/port/test.py: + 2011-01-28 David Kilzer build-webkit gives a bogus warning with newer versions of Xcode diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py index 577fe57dd774..66618a52ba4c 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/test.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py @@ -283,6 +283,65 @@ class TestPort(base.Port): } return name_map[test_platform_name] + # FIXME: These next two routines are copied from base.py with + # the calls to path.abspath_to_uri() removed. We shouldn't have + # to do this. + def filename_to_uri(self, filename): + """Convert a test file (which is an absolute path) to a URI.""" + LAYOUTTEST_HTTP_DIR = "http/tests/" + LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/" + + relative_path = self.relative_test_filename(filename) + port = None + use_ssl = False + + if (relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR) + or relative_path.startswith(LAYOUTTEST_HTTP_DIR)): + relative_path = relative_path[len(LAYOUTTEST_HTTP_DIR):] + port = 8000 + + # Make http/tests/local run as local files. This is to mimic the + # logic in run-webkit-tests. + # + # TODO(dpranke): remove the media reference and the SSL reference? + if (port and not relative_path.startswith("local/") and + not relative_path.startswith("media/")): + if relative_path.startswith("ssl/"): + port += 443 + protocol = "https" + else: + protocol = "http" + return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path) + + return "file://" + self._filesystem.abspath(filename) + + def uri_to_test_name(self, uri): + """Return the base layout test name for a given URI. + + This returns the test name for a given URI, e.g., if you passed in + "file:///src/LayoutTests/fast/html/keygen.html" it would return + "fast/html/keygen.html". + + """ + test = uri + if uri.startswith("file:///"): + prefix = "file://" + self.layout_tests_dir() + "/" + return test[len(prefix):] + + if uri.startswith("http://127.0.0.1:8880/"): + # websocket tests + return test.replace('http://127.0.0.1:8880/', '') + + if uri.startswith("http://"): + # regular HTTP test + return test.replace('http://127.0.0.1:8000/', 'http/tests/') + + if uri.startswith("https://"): + return test.replace('https://127.0.0.1:8443/', 'http/tests/') + + raise NotImplementedError('unknown url type: %s' % uri) + + def version(self): return '' -- 2.36.0