Bug 223657 - [Cocoa] Revise loadSimulatedRequest API with final review comments
Summary: [Cocoa] Revise loadSimulatedRequest API with final review comments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-23 14:27 PDT by Brent Fulgham
Modified: 2021-03-24 10:03 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.78 KB, patch)
2021-03-23 16:16 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2021-03-23 14:27:49 PDT
We've received final internal review on the proposed Cocoa API for loadSimulatedRequest, which suggested two small changes. This patch exposes the final API, and marks the prior version as deprecated.

1. Revise 'with' label to just be 'response'.

- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request withResponse:(NSURLResponse *)response responseData:(NSData *)data;

Becomes

- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request response:(NSURLResponse *)response responseData:(NSData *)data;


2. Revise 'withResponseHTML' to 'responseHTML'

- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request withResponseHTMLString:(NSString *)string;

Becomes

- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request responseHTMLString:(NSString *)string;
Comment 1 Radar WebKit Bug Importer 2021-03-23 15:18:07 PDT
<rdar://problem/75757727>
Comment 2 Brent Fulgham 2021-03-23 16:16:10 PDT
Created attachment 424076 [details]
Patch
Comment 3 Alex Christensen 2021-03-23 16:55:12 PDT
Comment on attachment 424076 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424076&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.h:492
> +- (WKNavigation *)loadSimulatedRequest:(NSURLRequest *)request response:(NSURLResponse *)response responseData:(NSData *)data WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

Nobody suggested responseBody instead of responseData?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewLoadAPIs.mm:54
> +    [delegate waitForDidFinishNavigation];

This should do more than just wait until navigation finishes.  It should verify that the data did load how we think it should.
Comment 4 EWS 2021-03-24 10:03:14 PDT
Committed r274944: <https://commits.webkit.org/r274944>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424076 [details].