Title: [240775] trunk/Tools
Revision
240775
Author
[email protected]
Date
2019-01-31 02:27:20 -0800 (Thu, 31 Jan 2019)

Log Message

Fix WebKitTestRunner's testPath with Windows full paths
https://bugs.webkit.org/show_bug.cgi?id=194012

Reviewed by Alex Christensen.

updateTestOptionsFromTestHeader failed to open test files because
testPath returned wrong file paths. It returned a path "/C:/..."
if a URL "file:///C:/..." was given.

* WebKitTestRunner/TestController.cpp:
(WTR::testPath): Removed the first '/' if the path starts with something like "/C:/".

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (240774 => 240775)


--- trunk/Tools/ChangeLog	2019-01-31 10:11:46 UTC (rev 240774)
+++ trunk/Tools/ChangeLog	2019-01-31 10:27:20 UTC (rev 240775)
@@ -1,3 +1,17 @@
+2019-01-31  Fujii Hironori  <[email protected]>
+
+        Fix WebKitTestRunner's testPath with Windows full paths
+        https://bugs.webkit.org/show_bug.cgi?id=194012
+
+        Reviewed by Alex Christensen.
+
+        updateTestOptionsFromTestHeader failed to open test files because
+        testPath returned wrong file paths. It returned a path "/C:/..."
+        if a URL "file:///C:/..." was given.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::testPath): Removed the first '/' if the path starts with something like "/C:/".
+
 2019-01-31  Carlos Garcia Campos  <[email protected]>
 
         [WPE] Bump font related dependencies to match the GTK+ port

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (240774 => 240775)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2019-01-31 10:11:46 UTC (rev 240774)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2019-01-31 10:27:20 UTC (rev 240775)
@@ -1093,6 +1093,11 @@
         auto path = adoptWK(WKURLCopyPath(url));
         auto buffer = std::vector<char>(WKStringGetMaximumUTF8CStringSize(path.get()));
         auto length = WKStringGetUTF8CString(path.get(), buffer.data(), buffer.size());
+#if OS(WINDOWS)
+        // Remove the first '/' if it starts with something like "/C:/".
+        if (length >= 4 && buffer[0] == '/' && buffer[2] == ':' && buffer[3] == '/')
+            return std::string(buffer.data() + 1, length - 1);
+#endif
         return std::string(buffer.data(), length);
     }
     return std::string();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to