[EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()

https://bugs.webkit.org/show_bug.cgi?id=95842

Patch by Christophe Dumez <christophe.dumez@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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c453bb35
2012-09-05 Christophe Dumez <christophe.dumez@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 <mihnea@adobe.com>
[CSS Regions] Auto width is not working for Regions
......@@ -228,7 +228,6 @@ BUGWKEFL : fast/css/bidi-override-in-anonymous-block.html = TEXT
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
......
2012-09-05 Christophe Dumez <christophe.dumez@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 <beidson@apple.com>
Frequent crashes in PluginView::scriptObject under runtimeObjectCustomGetOwnPropertySlot
......
......@@ -22,6 +22,9 @@
#include "InjectedBundle.h"
#include <Ecore.h>
#include <JavaScriptCore/OpaqueJSString.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
namespace WTR {
......@@ -56,7 +59,28 @@ void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded()
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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment