Title: [119788] trunk
Revision
119788
Author
[email protected]
Date
2012-06-07 19:59:37 -0700 (Thu, 07 Jun 2012)

Log Message

[EFL][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
https://bugs.webkit.org/show_bug.cgi?id=67255

Patch by Joshua Lock <[email protected]> on 2012-06-07
Reviewed by Dirk Pranke.

Tools:

Implement pathToLocalResource to redirect file:///tmp URL's to
DUMPRENDERTREE_TEMP and file:///tmp/LayoutTests to point to the
LayoutTests sub-directory of the WebKit source tree.

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::pathToLocalResource):

LayoutTests:

* platform/efl/TestExpectations: unskip
fast/dom/frame-loading-via-document-write.html now that
LayoutTestController::pathToLocalResource() is implemented for EFL.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119787 => 119788)


--- trunk/LayoutTests/ChangeLog	2012-06-08 02:57:27 UTC (rev 119787)
+++ trunk/LayoutTests/ChangeLog	2012-06-08 02:59:37 UTC (rev 119788)
@@ -1,3 +1,14 @@
+2012-06-07  Joshua Lock  <[email protected]>
+
+        [EFL][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
+        https://bugs.webkit.org/show_bug.cgi?id=67255
+
+        Reviewed by Dirk Pranke.
+
+        * platform/efl/TestExpectations: unskip
+        fast/dom/frame-loading-via-document-write.html now that
+        LayoutTestController::pathToLocalResource() is implemented for EFL.
+
 2012-06-07  Noel Gordon  <[email protected]>
 
         [chromium] Use WEBPImportPictureRGBX|BGRX to import picture data

Modified: trunk/LayoutTests/platform/efl/TestExpectations (119787 => 119788)


--- trunk/LayoutTests/platform/efl/TestExpectations	2012-06-08 02:57:27 UTC (rev 119787)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2012-06-08 02:59:37 UTC (rev 119788)
@@ -224,9 +224,6 @@
 BUGWK84333 : http/tests/local/formdata = TEXT
 BUGWK84333 : http/tests/security/clipboard/clipboard-file-access.html = TEXT
 
-// LayoutTestController.pathToLocalResource needs special handling of file URLs to /tmp.
-BUGWK84336 : fast/dom/frame-loading-via-document-write.html = TIMEOUT TEXT
-
 // Missing execCommand('copy') and execCommand('paste').
 BUGWK84338 : editing/deleting/paste-with-transparent-background-color.html = TEXT
 BUGWK84338 : editing/execCommand/find-after-replace.html = TEXT MISSING

Modified: trunk/Tools/ChangeLog (119787 => 119788)


--- trunk/Tools/ChangeLog	2012-06-08 02:57:27 UTC (rev 119787)
+++ trunk/Tools/ChangeLog	2012-06-08 02:59:37 UTC (rev 119788)
@@ -1,3 +1,17 @@
+2012-06-07  Joshua Lock  <[email protected]>
+
+        [EFL][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
+        https://bugs.webkit.org/show_bug.cgi?id=67255
+
+        Reviewed by Dirk Pranke.
+
+        Implement pathToLocalResource to redirect file:///tmp URL's to
+        DUMPRENDERTREE_TEMP and file:///tmp/LayoutTests to point to the
+        LayoutTests sub-directory of the WebKit source tree.
+
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::pathToLocalResource):
+
 2012-06-07  Tony Payne  <[email protected]>
 
         [chromium] Allow LayoutTests under new git workflow

Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (119787 => 119788)


--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-06-08 02:57:27 UTC (rev 119787)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-06-08 02:59:37 UTC (rev 119788)
@@ -7,6 +7,7 @@
  * Copyright (C) 2010 Joone Hur <[email protected]>
  * Copyright (C) 2011 ProFUSION Embedded Systems
  * Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -177,8 +178,28 @@
 
 JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url)
 {
-    // Function introduced in r28690. This may need special-casing on Windows.
-    return JSStringRetain(url); // Do nothing on Unix.
+    String requestedUrl(url->characters());
+    String resourceRoot;
+    String requestedRoot;
+
+    if (requestedUrl.find("LayoutTests") != notFound) {
+        // If the URL contains LayoutTests we need to remap that to
+        // LOCAL_RESOURCE_ROOT which is the path of the LayoutTests directory
+        // within the WebKit source tree.
+        requestedRoot = "/tmp/LayoutTests";
+        resourceRoot = getenv("LOCAL_RESOURCE_ROOT");
+    } else if (requestedUrl.find("tmp") != notFound) {
+        // If the URL is a child of /tmp we need to convert it to be a child
+        // DUMPRENDERTREE_TEMP replace tmp with DUMPRENDERTREE_TEMP
+        requestedRoot = "/tmp";
+        resourceRoot = getenv("DUMPRENDERTREE_TEMP");
+    }
+
+    size_t indexOfRootStart = requestedUrl.reverseFind(requestedRoot);
+    size_t indexOfSeparatorAfterRoot = indexOfRootStart + requestedRoot.length();
+    String fullPathToUrl = "file://" + resourceRoot + requestedUrl.substring(indexOfSeparatorAfterRoot);
+
+    return JSStringCreateWithUTF8CString(fullPathToUrl.utf8().data());
 }
 
 void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to