Changeset 150386 in webkit


Ignore:
Timestamp:
May 20, 2013 4:28:07 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

WTR::pathSuitableForTestResult should behave the same as _drt_descriptionSuitableForTestResult so we can unskip tests.
https://bugs.webkit.org/show_bug.cgi?id=116125

Patch by Alex Christensen <achristensen@apple.com> on 2013-05-20
Reviewed by Tim Horton.

Tools:

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::pathSuitableForTestResult):
Changed string operations to match _drt_descriptionSuitableForTestResult.
(WTR::dumpRequestDescriptionSuitableForTestResult):
(WTR::dumpResponseDescriptionSuitableForTestResult):
(WTR::InjectedBundlePage::willPerformClientRedirectForFrame):
(WTR::InjectedBundlePage::didInitiateLoadForResource):
(WTR::InjectedBundlePage::willSendRequestForFrame):
(WTR::InjectedBundlePage::didReceiveResponseForResource):
Pass the main frame's URL to pathSuitableForTestResult.

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:

Added WKBundlePageRef to willPerformClientRedirectForFrame.

LayoutTests:

  • platform/wk2/TestExpectations:

Unskipped working tests.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150385 r150386  
     12013-05-20  Alex Christensen  <achristensen@apple.com>
     2
     3        WTR::pathSuitableForTestResult should behave the same as _drt_descriptionSuitableForTestResult so we can unskip tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=116125
     5
     6        Reviewed by Tim Horton.
     7
     8        * platform/wk2/TestExpectations:
     9        Unskipped working tests.
     10
    1112013-05-20  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r150058 r150386  
    465465# Unexpected redirection happens.
    466466http/tests/loading/redirect-methods.html
    467 
    468 # Should pass now but need to be checked first.
    469 platform/mac/fast/loader/file-url-mimetypes-2.html
    470 platform/mac/fast/loader/file-url-mimetypes-3.html
    471 platform/mac/fast/loader/file-url-mimetypes.html
    472 webarchive/loading/cache-expired-subresource.html
    473 webarchive/loading/test-loading-archive.html
    474 webarchive/loading/test-loading-archive-subresource-null-mimetype.html
    475467
    476468# Should pass now on ports other than EFL and GTK.
  • trunk/Tools/ChangeLog

    r150380 r150386  
     12013-05-20  Alex Christensen  <achristensen@apple.com>
     2
     3        WTR::pathSuitableForTestResult should behave the same as _drt_descriptionSuitableForTestResult so we can unskip tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=116125
     5
     6        Reviewed by Tim Horton.
     7
     8        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     9        (WTR::pathSuitableForTestResult):
     10        Changed string operations to match _drt_descriptionSuitableForTestResult.
     11        (WTR::dumpRequestDescriptionSuitableForTestResult):
     12        (WTR::dumpResponseDescriptionSuitableForTestResult):
     13        (WTR::InjectedBundlePage::willPerformClientRedirectForFrame):
     14        (WTR::InjectedBundlePage::didInitiateLoadForResource):
     15        (WTR::InjectedBundlePage::willSendRequestForFrame):
     16        (WTR::InjectedBundlePage::didReceiveResponseForResource):
     17        Pass the main frame's URL to pathSuitableForTestResult.
     18        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
     19        Added WKBundlePageRef to willPerformClientRedirectForFrame.
     20
    1212013-05-20  Dirk Pranke  <dpranke@chromium.org>
    222
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r150242 r150386  
    236236static const char divider = '/';
    237237
    238 static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl)
     238static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl, WKURLRef mainFrameURL)
    239239{
    240240    if (!fileUrl)
     
    246246
    247247    String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl)));
    248     StringBuilder stringBuilder;
    249 
    250     // Remove the leading path from file urls.
    251     const size_t indexBaseName = pathString.reverseFind(divider);
    252     if (indexBaseName != notFound) {
    253         const size_t indexDirName = pathString.reverseFind(divider, indexBaseName - 1);
    254         if (indexDirName != notFound)
    255             stringBuilder.append(pathString.substring(indexDirName + 1, indexBaseName - indexDirName - 1));
    256         stringBuilder.append(divider);
    257         stringBuilder.append(pathString.substring(indexBaseName + 1)); // Filename.
    258     } else {
    259         stringBuilder.append(divider);
    260         stringBuilder.append(pathString); // Return "/pathString".
    261     }
    262 
    263     return stringBuilder.toString();
     248    String mainFrameURLPathString = toWTFString(adoptWK(WKURLCopyPath(mainFrameURL)));
     249    String basePath = mainFrameURLPathString.substring(0, mainFrameURLPathString.reverseFind(divider)+1);
     250   
     251    if (pathString.startsWith(basePath))
     252        return pathString.substring(basePath.length());
     253    return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
    264254}
    265255
     
    494484}
    495485
    496 static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request, StringBuilder& stringBuilder)
     486static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request, StringBuilder& stringBuilder, WKURLRef mainFrameURL)
    497487{
    498488    WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
     
    501491
    502492    stringBuilder.appendLiteral("<NSURLRequest URL ");
    503     stringBuilder.append(pathSuitableForTestResult(url.get()));
     493    stringBuilder.append(pathSuitableForTestResult(url.get(), mainFrameURL));
    504494    stringBuilder.appendLiteral(", main document URL ");
    505495    stringBuilder.append(urlSuitableForTestResult(firstParty.get()));
     
    514504}
    515505
    516 static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response, StringBuilder& stringBuilder)
     506static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response, StringBuilder& stringBuilder, WKURLRef mainFrameURL)
    517507{
    518508    WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response));
     
    522512    }
    523513    stringBuilder.appendLiteral("<NSURLResponse ");
    524     stringBuilder.append(pathSuitableForTestResult(url.get()));
     514    stringBuilder.append(pathSuitableForTestResult(url.get(), mainFrameURL));
    525515    stringBuilder.appendLiteral(", http status code ");
    526516    stringBuilder.appendNumber(WKURLResponseHTTPStatusCode(response));
     
    615605void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date, const void* clientInfo)
    616606{
    617     static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willPerformClientRedirectForFrame(frame, url, delay, date);
     607    static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willPerformClientRedirectForFrame(page, frame, url, delay, date);
    618608}
    619609
     
    1000990}
    1001991
    1002 void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef frame, WKURLRef url, double delay, double date)
     992void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date)
    1003993{
    1004994    if (!InjectedBundle::shared().isTestRunning())
     
    1009999
    10101000    StringBuilder stringBuilder;
     1001    WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
    10111002    dumpFrameDescriptionSuitableForTestResult(frame, stringBuilder);
    10121003    stringBuilder.appendLiteral(" - willPerformClientRedirectToURL: ");
    1013     stringBuilder.append(pathSuitableForTestResult(url));
     1004    stringBuilder.append(pathSuitableForTestResult(url, mainFrameURL.get()));
    10141005    stringBuilder.appendLiteral(" \n");
    10151006    InjectedBundle::shared().outputText(stringBuilder.toString());
     
    10661057}
    10671058
    1068 void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool)
     1059void InjectedBundlePage::didInitiateLoadForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLRequestRef request, bool)
    10691060{
    10701061    if (!InjectedBundle::shared().isTestRunning())
     
    10751066
    10761067    WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
    1077     assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get()));
     1068    WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
     1069    assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get(), mainFrameURL.get()));
    10781070}
    10791071
     
    10901082}
    10911083
    1092 WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response)
     1084WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef page, WKBundleFrameRef frame, uint64_t identifier, WKURLRequestRef request, WKURLResponseRef response)
    10931085{
    10941086    if (InjectedBundle::shared().isTestRunning()
     
    10971089        dumpResourceURL(identifier, stringBuilder);
    10981090        stringBuilder.appendLiteral(" - willSendRequest ");
    1099         dumpRequestDescriptionSuitableForTestResult(request, stringBuilder);
     1091        WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
     1092        dumpRequestDescriptionSuitableForTestResult(request, stringBuilder, mainFrameURL.get());
    11001093        stringBuilder.appendLiteral(" redirectResponse ");
    1101         dumpResponseDescriptionSuitableForTestResult(response, stringBuilder);
     1094        dumpResponseDescriptionSuitableForTestResult(response, stringBuilder, mainFrameURL.get());
    11021095        stringBuilder.append('\n');
    11031096        InjectedBundle::shared().outputText(stringBuilder.toString());
     
    11461139}
    11471140
    1148 void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response)
     1141void InjectedBundlePage::didReceiveResponseForResource(WKBundlePageRef page, WKBundleFrameRef, uint64_t identifier, WKURLResponseRef response)
    11491142{
    11501143    if (!InjectedBundle::shared().isTestRunning())
     
    11551148        dumpResourceURL(identifier, stringBuilder);
    11561149        stringBuilder.appendLiteral(" - didReceiveResponse ");
    1157         dumpResponseDescriptionSuitableForTestResult(response, stringBuilder);
     1150        WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
     1151        dumpResponseDescriptionSuitableForTestResult(response, stringBuilder, mainFrameURL.get());
    11581152        stringBuilder.append('\n');
    11591153        InjectedBundle::shared().outputText(stringBuilder.toString());
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h

    r149692 r150386  
    8787    void didClearWindowForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
    8888    void didCancelClientRedirectForFrame(WKBundleFrameRef);
    89     void willPerformClientRedirectForFrame(WKBundleFrameRef, WKURLRef url, double delay, double date);
     89    void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef, double delay, double date);
    9090    void didSameDocumentNavigationForFrame(WKBundleFrameRef, WKSameDocumentNavigationType);
    9191    void didFinishDocumentLoadForFrame(WKBundleFrameRef);
Note: See TracChangeset for help on using the changeset viewer.