Changeset 153852 in webkit


Ignore:
Timestamp:
Aug 8, 2013 3:38:04 PM (11 years ago)
Author:
ap@apple.com
Message:

[WK2] loader/go-back-cached-main-resource.html fails
https://bugs.webkit.org/show_bug.cgi?id=116491

Reviewed by Tim Horton.

  • DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
  • DumpRenderTree/gtk/DumpRenderTree.cpp:
  • DumpRenderTree/qt/DumpRenderTreeQt.cpp:
  • DumpRenderTree/win/DumpRenderTree.cpp: Added FIXMEs about making path printing normalization more compatible.
  • DumpRenderTree/mac/ResourceLoadDelegate.mm: (-[NSURL _drt_descriptionSuitableForTestResult]): Return last path component in cases where we used to return a full path, which is never desirable. Added a null check to basePath to prevent potentially getting an Objective C exception.
  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::pathSuitableForTestResult): Changed to use path for main test window, not for a currently loading one (which is different for tests that use multiple windows). Changed to return "(null)" for empty URLs to match WK1 output. Changed to return last path component as last fallback. (WTR::dumpRequestDescriptionSuitableForTestResult): We no longer need to pass main frame URL here, and it was potentially a wrong frame. (WTR::dumpResponseDescriptionSuitableForTestResult): Ditto. (WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Ditto. (WTR::InjectedBundlePage::didInitiateLoadForResource): Ditto. (WTR::InjectedBundlePage::willSendRequestForFrame): Ditto. (WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto.
Location:
trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r153851 r153852  
     12013-08-08  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [WK2] loader/go-back-cached-main-resource.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=116491
     5
     6        Reviewed by Tim Horton.
     7
     8        * platform/wk2/TestExpectations:
     9        * webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt:
     10        Updated to not have file:// in results. This may not be desirable for a webarchive
     11        test, but shouldn't be too bad either.
     12        * platform/mac-wk2/loader/go-back-cached-main-resource-expected.txt: Deleted.
     13        Cross-platform results now work.
     14
    1152013-08-08  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r153830 r153852  
    271271
    272272webkit.org/b/105952 fast/loader/submit-form-while-parsing-2.html [ Pass Failure ]
    273 
    274 webkit.org/b/116491 loader/go-back-cached-main-resource.html [ Failure ]
    275273
    276274### END OF (1) Classified failures with bug reports
  • trunk/LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt

    r100311 r153852  
    77resources/subresource-null-mimetype.webarchive - didReceiveResponse <NSURLResponse resources/subresource-null-mimetype.webarchive, http status code 0>
    88frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    9 file:///test.png - willSendRequest <NSURLRequest URL file:///test.png, main document URL test-loading-archive-subresource-null-mimetype.html, http method GET> redirectResponse (null)
     9test.png - willSendRequest <NSURLRequest URL test.png, main document URL test-loading-archive-subresource-null-mimetype.html, http method GET> redirectResponse (null)
    1010frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    1111resources/subresource-null-mimetype.webarchive - didFinishLoading
    12 file:///test.png - didReceiveResponse <NSURLResponse file:///Users/pecoraro/Desktop/test.png, http status code 0>
    13 file:///test.png - didFinishLoading
     12test.png - didReceiveResponse <NSURLResponse test.png, http status code 0>
     13test.png - didFinishLoading
    1414frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1515main frame - didHandleOnloadEventsForFrame
  • trunk/Tools/ChangeLog

    r153830 r153852  
     12013-08-08  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [WK2] loader/go-back-cached-main-resource.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=116491
     5
     6        Reviewed by Tim Horton.
     7
     8        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
     9        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     10        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     11        * DumpRenderTree/win/DumpRenderTree.cpp:
     12        Added FIXMEs about making path printing normalization more compatible.
     13
     14        * DumpRenderTree/mac/ResourceLoadDelegate.mm: (-[NSURL _drt_descriptionSuitableForTestResult]):
     15        Return last path component in cases where we used to return a full path, which is
     16        never desirable. Added a null check to basePath to prevent potentially getting
     17        an Objective C exception.
     18
     19        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     20        (WTR::pathSuitableForTestResult): Changed to use path for main test window, not
     21        for a currently loading one (which is different for tests that use multiple windows).
     22        Changed to return "(null)" for empty URLs to match WK1 output. Changed to return
     23        last path component as last fallback.
     24        (WTR::dumpRequestDescriptionSuitableForTestResult): We no longer need to pass main
     25        frame URL here, and it was potentially a wrong frame.
     26        (WTR::dumpResponseDescriptionSuitableForTestResult): Ditto.
     27        (WTR::InjectedBundlePage::willPerformClientRedirectForFrame): Ditto.
     28        (WTR::InjectedBundlePage::didInitiateLoadForResource): Ditto.
     29        (WTR::InjectedBundlePage::willSendRequestForFrame): Ditto.
     30        (WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto.
     31
    1322013-08-08  Alex Christensen  <achristensen@apple.com>
    233
  • trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp

    r151832 r153852  
    337337}
    338338
     339// FIXME (119585): Make this match other platforms better.
    339340static CString pathSuitableForTestResult(const char* uriString)
    340341{
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r152897 r153852  
    11411141}
    11421142
    1143 
     1143// FIXME (119584): Make this match other platforms better.
    11441144static CString pathFromSoupURI(SoupURI* uri)
    11451145{
  • trunk/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm

    r125516 r153852  
    8585    basePath = [basePath stringByAppendingString:@"/"];
    8686
    87     if ([[self path] hasPrefix:basePath])
     87    if (basePath && [[self path] hasPrefix:basePath])
    8888        return [[self path] substringFromIndex:[basePath length]];
    89     return [self absoluteString];
     89    return [self lastPathComponent]; // We lose some information here, but it's better than exposing a full path, which is always machine specific.
    9090}
    9191
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r149087 r153852  
    276276}
    277277
     278// FIXME (119591): Make this match other platforms better.
    278279static QString urlSuitableForTestResult(const QString& url)
    279280{
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r152205 r153852  
    142142}
    143143
     144// FIXME (119583): Make this match other platforms better.
    144145wstring urlSuitableForTestResult(const wstring& urlString)
    145146{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r153830 r153852  
    236236static const char divider = '/';
    237237
    238 static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl, WKURLRef mainFrameURL)
     238static inline WTF::String pathSuitableForTestResult(WKURLRef fileUrl)
    239239{
    240240    if (!fileUrl)
    241         return String();
     241        return "(null)";
    242242
    243243    WKRetainPtr<WKStringRef> schemeString = adoptWK(WKURLCopyScheme(fileUrl));
     
    245245        return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
    246246
     247    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
     248    WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(mainFrame));
     249    if (!mainFrameURL)
     250        mainFrameURL = adoptWK(WKBundleFrameCopyProvisionalURL(mainFrame));
     251
    247252    String pathString = toWTFString(adoptWK(WKURLCopyPath(fileUrl)));
    248     String mainFrameURLPathString = toWTFString(adoptWK(WKURLCopyPath(mainFrameURL)));
     253    String mainFrameURLPathString = toWTFString(adoptWK(WKURLCopyPath(mainFrameURL.get())));
    249254    String basePath = mainFrameURLPathString.substring(0, mainFrameURLPathString.reverseFind(divider) + 1);
    250255   
    251     if (pathString.startsWith(basePath))
     256    if (!basePath.isEmpty() && pathString.startsWith(basePath))
    252257        return pathString.substring(basePath.length());
    253     return toWTFString(adoptWK(WKURLCopyString(fileUrl)));
     258    return toWTFString(adoptWK(WKURLCopyLastPathComponent(fileUrl))); // We lose some information here, but it's better than exposing a full path, which is always machine specific.
    254259}
    255260
     
    469474}
    470475
    471 static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request, StringBuilder& stringBuilder, WKURLRef mainFrameURL)
     476static inline void dumpRequestDescriptionSuitableForTestResult(WKURLRequestRef request, StringBuilder& stringBuilder)
    472477{
    473478    WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
     
    476481
    477482    stringBuilder.appendLiteral("<NSURLRequest URL ");
    478     stringBuilder.append(pathSuitableForTestResult(url.get(), mainFrameURL));
     483    stringBuilder.append(pathSuitableForTestResult(url.get()));
    479484    stringBuilder.appendLiteral(", main document URL ");
    480     stringBuilder.append(pathSuitableForTestResult(firstParty.get(), mainFrameURL));
     485    stringBuilder.append(pathSuitableForTestResult(firstParty.get()));
    481486    stringBuilder.appendLiteral(", http method ");
    482487
     
    489494}
    490495
    491 static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response, StringBuilder& stringBuilder, WKURLRef mainFrameURL)
     496static inline void dumpResponseDescriptionSuitableForTestResult(WKURLResponseRef response, StringBuilder& stringBuilder)
    492497{
    493498    WKRetainPtr<WKURLRef> url = adoptWK(WKURLResponseCopyURL(response));
     
    497502    }
    498503    stringBuilder.appendLiteral("<NSURLResponse ");
    499     stringBuilder.append(pathSuitableForTestResult(url.get(), mainFrameURL));
     504    stringBuilder.append(pathSuitableForTestResult(url.get()));
    500505    stringBuilder.appendLiteral(", http status code ");
    501506    stringBuilder.appendNumber(WKURLResponseHTTPStatusCode(response));
     
    975980}
    976981
    977 void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date)
     982void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef frame, WKURLRef url, double delay, double date)
    978983{
    979984    if (!InjectedBundle::shared().isTestRunning())
     
    984989
    985990    StringBuilder stringBuilder;
    986     WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
    987991    dumpFrameDescriptionSuitableForTestResult(frame, stringBuilder);
    988992    stringBuilder.appendLiteral(" - willPerformClientRedirectToURL: ");
    989     stringBuilder.append(pathSuitableForTestResult(url, mainFrameURL.get()));
     993    stringBuilder.append(pathSuitableForTestResult(url));
    990994    stringBuilder.appendLiteral(" \n");
    991995    InjectedBundle::shared().outputText(stringBuilder.toString());
     
    10511055
    10521056    WKRetainPtr<WKURLRef> url = adoptWK(WKURLRequestCopyURL(request));
    1053     WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
    1054     assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get(), mainFrameURL.get()));
     1057    assignedUrlsCache.add(identifier, pathSuitableForTestResult(url.get()));
    10551058}
    10561059
     
    10741077        dumpResourceURL(identifier, stringBuilder);
    10751078        stringBuilder.appendLiteral(" - willSendRequest ");
    1076         WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
    1077         dumpRequestDescriptionSuitableForTestResult(request, stringBuilder, mainFrameURL.get());
     1079        dumpRequestDescriptionSuitableForTestResult(request, stringBuilder);
    10781080        stringBuilder.appendLiteral(" redirectResponse ");
    1079         dumpResponseDescriptionSuitableForTestResult(response, stringBuilder, mainFrameURL.get());
     1081        dumpResponseDescriptionSuitableForTestResult(response, stringBuilder);
    10801082        stringBuilder.append('\n');
    10811083        InjectedBundle::shared().outputText(stringBuilder.toString());
     
    11331135        dumpResourceURL(identifier, stringBuilder);
    11341136        stringBuilder.appendLiteral(" - didReceiveResponse ");
    1135         WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page)));
    1136         dumpResponseDescriptionSuitableForTestResult(response, stringBuilder, mainFrameURL.get());
     1137        dumpResponseDescriptionSuitableForTestResult(response, stringBuilder);
    11371138        stringBuilder.append('\n');
    11381139        InjectedBundle::shared().outputText(stringBuilder.toString());
Note: See TracChangeset for help on using the changeset viewer.