Title: [127602] trunk
Revision
127602
Author
commit-qu...@webkit.org
Date
2012-09-05 09:33:48 -0700 (Wed, 05 Sep 2012)

Log Message

[EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()
https://bugs.webkit.org/show_bug.cgi?id=95842

Patch by Christophe Dumez <christophe.du...@intel.com> on 2012-09-05
Reviewed by Kenneth Rohde Christiansen.

Tools:

Provide proper implementation for TestRunner::pathToLocalResource()
in EFL WKTR, identical to the one for DumpRenderTree.

Map /tmp to ${DUMPRENDERTREE_TEMP} environment variable and
/tmp/LayoutTests to ${LOCAL_RESOURCE_ROOT} so that local resources
are found my WebKitTestRunner.

* WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp:
(WTR::TestRunner::pathToLocalResource):

LayoutTests:

Unskip fast/dom/frame-loading-via-document-write.html that
was failing due to incomplete implementation for
TestRunner::pathToLocalResource() in EFL WKTR.

* platform/efl-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (127601 => 127602)


--- trunk/LayoutTests/ChangeLog	2012-09-05 16:33:01 UTC (rev 127601)
+++ trunk/LayoutTests/ChangeLog	2012-09-05 16:33:48 UTC (rev 127602)
@@ -1,3 +1,16 @@
+2012-09-05  Christophe Dumez  <christophe.du...@intel.com>
+
+        [EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()
+        https://bugs.webkit.org/show_bug.cgi?id=95842
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Unskip fast/dom/frame-loading-via-document-write.html that
+        was failing due to incomplete implementation for
+        TestRunner::pathToLocalResource() in EFL WKTR.
+
+        * platform/efl-wk2/TestExpectations:
+
 2012-09-05  Mihnea Ovidenie  <mih...@adobe.com>
 
         [CSS Regions] Auto width is not working for Regions

Modified: trunk/LayoutTests/platform/efl-wk2/TestExpectations (127601 => 127602)


--- trunk/LayoutTests/platform/efl-wk2/TestExpectations	2012-09-05 16:33:01 UTC (rev 127601)
+++ trunk/LayoutTests/platform/efl-wk2/TestExpectations	2012-09-05 16:33:48 UTC (rev 127602)
@@ -228,7 +228,6 @@
 BUGWKEFL : fast/css/relative-positioned-block-crash.html = TEXT
 BUGWKEFL : fast/dom/Window/mozilla-focus-blur.html = TEXT
 BUGWKEFL : fast/dom/Window/timer-resume-on-navigation-back.html = TEXT
-BUGWKEFL : fast/dom/frame-loading-via-document-write.html = TEXT
 BUGWKEFL : fast/events/node-event-anchor-lock.html = TEXT
 BUGWKEFL : fast/events/pagehide-timeout.html = TEXT
 BUGWKEFL : fast/events/pagehide-xhr-open.html = TEXT

Modified: trunk/Tools/ChangeLog (127601 => 127602)


--- trunk/Tools/ChangeLog	2012-09-05 16:33:01 UTC (rev 127601)
+++ trunk/Tools/ChangeLog	2012-09-05 16:33:48 UTC (rev 127602)
@@ -1,3 +1,20 @@
+2012-09-05  Christophe Dumez  <christophe.du...@intel.com>
+
+        [EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()
+        https://bugs.webkit.org/show_bug.cgi?id=95842
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Provide proper implementation for TestRunner::pathToLocalResource()
+        in EFL WKTR, identical to the one for DumpRenderTree.
+
+        Map /tmp to ${DUMPRENDERTREE_TEMP} environment variable and
+        /tmp/LayoutTests to ${LOCAL_RESOURCE_ROOT} so that local resources
+        are found my WebKitTestRunner.
+
+        * WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp:
+        (WTR::TestRunner::pathToLocalResource):
+
 2012-09-05  Brady Eidson  <beid...@apple.com>
 
         Frequent crashes in PluginView::scriptObject under runtimeObjectCustomGetOwnPropertySlot

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp (127601 => 127602)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp	2012-09-05 16:33:01 UTC (rev 127601)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp	2012-09-05 16:33:48 UTC (rev 127602)
@@ -22,6 +22,9 @@
 
 #include "InjectedBundle.h"
 #include <Ecore.h>
+#include <_javascript_Core/OpaqueJSString.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
 
 namespace WTR {
 
@@ -56,7 +59,28 @@
 
 JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
 {
-    return url;
+    String requestedUrl(url->characters(), url->length());
+    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());
 }
 
 JSRetainPtr<JSStringRef> TestRunner::platformName()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to