Changeset 287365 in webkit


Ignore:
Timestamp:
Dec 22, 2021, 10:52:52 AM (4 years ago)
Author:
achristensen@apple.com
Message:

Re-enable WebpagePreferences.WebsitePoliciesDuringRedirect API test on Monterey
https://bugs.webkit.org/show_bug.cgi?id=234607

Reviewed by Brady Eidson.

This is the same as r285057 where we were responding with one byte short of the ranges requested,
which used to give a playing event but since Monterey it doesn't. The fix is to respond with all
the bytes requested. If the request is for bytes 0-1, we need to respond with two bytes, for example.

  • TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:

(-[TestSchemeHandler webView:startURLSchemeTask:]):
(TEST):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r287360 r287365  
     12021-12-22  Alex Christensen  <achristensen@webkit.org>
     2
     3        Re-enable WebpagePreferences.WebsitePoliciesDuringRedirect API test on Monterey
     4        https://bugs.webkit.org/show_bug.cgi?id=234607
     5
     6        Reviewed by Brady Eidson.
     7
     8        This is the same as r285057 where we were responding with one byte short of the ranges requested,
     9        which used to give a playing event but since Monterey it doesn't.  The fix is to respond with all
     10        the bytes requested.  If the request is for bytes 0-1, we need to respond with two bytes, for example.
     11
     12        * TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
     13        (-[TestSchemeHandler webView:startURLSchemeTask:]):
     14        (TEST):
     15
    1162021-12-22  J Pascoe  <j_pascoe@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm

    r287298 r287365  
    696696    auto& range = *parsedRange.range;
    697697   
    698     NSDictionary *headerFields = @{ @"Content-Length": [@(range.second - range.first) stringValue], @"Content-Range": [NSString stringWithFormat:@"bytes %lu-%lu/%lu", range.first, range.second, [videoData length]] };
     698    NSDictionary *headerFields = @{ @"Content-Length": [@(range.second - range.first + 1) stringValue], @"Content-Range": [NSString stringWithFormat:@"bytes %lu-%lu/%lu", range.first, range.second, [videoData length]] };
    699699    auto response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:task.request.URL statusCode:200 HTTPVersion:(NSString *)kCFHTTPVersion1_1 headerFields:headerFields]);
    700700    [task didReceiveResponse:response.get()];
    701     [task didReceiveData:[videoData subdataWithRange:NSMakeRange(range.first, range.second - range.first)]];
     701    [task didReceiveData:[videoData subdataWithRange:NSMakeRange(range.first, range.second - range.first + 1)]];
    702702    [task didFinish];
    703703   
     
    710710@end
    711711
    712 // FIXME: Re-enable this test for Monterey+ once rdar://80476146 is resolved.
    713 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
    714 TEST(WebpagePreferences, DISABLED_WebsitePoliciesDuringRedirect)
    715 #else
    716712TEST(WebpagePreferences, WebsitePoliciesDuringRedirect)
    717 #endif
    718713{
    719714    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
Note: See TracChangeset for help on using the changeset viewer.