Changeset 127602 in webkit


Ignore:
Timestamp:
Sep 5, 2012 9:33:48 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Christophe Dumez <Christophe Dumez> 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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127596 r127602  
     12012-09-05  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()
     4        https://bugs.webkit.org/show_bug.cgi?id=95842
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Unskip fast/dom/frame-loading-via-document-write.html that
     9        was failing due to incomplete implementation for
     10        TestRunner::pathToLocalResource() in EFL WKTR.
     11
     12        * platform/efl-wk2/TestExpectations:
     13
    1142012-09-05  Mihnea Ovidenie  <mihnea@adobe.com>
    215
  • trunk/LayoutTests/platform/efl-wk2/TestExpectations

    r127582 r127602  
    229229BUGWKEFL : fast/dom/Window/mozilla-focus-blur.html = TEXT
    230230BUGWKEFL : fast/dom/Window/timer-resume-on-navigation-back.html = TEXT
    231 BUGWKEFL : fast/dom/frame-loading-via-document-write.html = TEXT
    232231BUGWKEFL : fast/events/node-event-anchor-lock.html = TEXT
    233232BUGWKEFL : fast/events/pagehide-timeout.html = TEXT
  • trunk/Tools/ChangeLog

    r127595 r127602  
     12012-09-05  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Provide implementation for TestRunner::pathToLocalResource()
     4        https://bugs.webkit.org/show_bug.cgi?id=95842
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Provide proper implementation for TestRunner::pathToLocalResource()
     9        in EFL WKTR, identical to the one for DumpRenderTree.
     10
     11        Map /tmp to ${DUMPRENDERTREE_TEMP} environment variable and
     12        /tmp/LayoutTests to ${LOCAL_RESOURCE_ROOT} so that local resources
     13        are found my WebKitTestRunner.
     14
     15        * WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp:
     16        (WTR::TestRunner::pathToLocalResource):
     17
    1182012-09-05  Brady Eidson  <beidson@apple.com>
    219
  • trunk/Tools/WebKitTestRunner/InjectedBundle/efl/TestRunnerEfl.cpp

    r125732 r127602  
    2323#include "InjectedBundle.h"
    2424#include <Ecore.h>
     25#include <JavaScriptCore/OpaqueJSString.h>
     26#include <wtf/text/CString.h>
     27#include <wtf/text/WTFString.h>
    2528
    2629namespace WTR {
     
    5760JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url)
    5861{
    59     return url;
     62    String requestedUrl(url->characters(), url->length());
     63    String resourceRoot;
     64    String requestedRoot;
     65
     66    if (requestedUrl.find("LayoutTests") != notFound) {
     67        // If the URL contains LayoutTests we need to remap that to
     68        // LOCAL_RESOURCE_ROOT which is the path of the LayoutTests directory
     69        // within the WebKit source tree.
     70        requestedRoot = "/tmp/LayoutTests";
     71        resourceRoot = getenv("LOCAL_RESOURCE_ROOT");
     72    } else if (requestedUrl.find("tmp") != notFound) {
     73        // If the URL is a child of /tmp we need to convert it to be a child
     74        // DUMPRENDERTREE_TEMP replace tmp with DUMPRENDERTREE_TEMP
     75        requestedRoot = "/tmp";
     76        resourceRoot = getenv("DUMPRENDERTREE_TEMP");
     77    }
     78
     79    size_t indexOfRootStart = requestedUrl.reverseFind(requestedRoot);
     80    size_t indexOfSeparatorAfterRoot = indexOfRootStart + requestedRoot.length();
     81    String fullPathToUrl = "file://" + resourceRoot + requestedUrl.substring(indexOfSeparatorAfterRoot);
     82
     83    return JSStringCreateWithUTF8CString(fullPathToUrl.utf8().data());
    6084}
    6185
Note: See TracChangeset for help on using the changeset viewer.