Bug 188583

Summary: [macOS] [WK2] Add infrastructure to test receiving file promises on drop
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: Tools / TestsAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bdakin, commit-queue, ews-watchlist, lforschler, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
aestes: review+
Archive of layout-test-results from ews206 for win-future
none
Patch for landing none

Description Wenson Hsieh 2018-08-14 15:47:25 PDT
Add infrastructure to test receiving file promises on drop
Comment 1 Wenson Hsieh 2018-08-14 16:43:19 PDT
Created attachment 347129 [details]
Patch
Comment 2 EWS Watchlist 2018-08-16 17:42:42 PDT Comment hidden (obsolete)
Comment 3 EWS Watchlist 2018-08-16 17:42:53 PDT Comment hidden (obsolete)
Comment 4 Andy Estes 2018-08-16 20:30:03 PDT
Comment on attachment 347129 [details]
Patch

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

I'm not sure your unique filename finding logic in copyFile() is correct, but otherwise looks great! r=me

> Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm:48
> +    _promisedTypeIdentifiers = adoptNS(promisedTypeIdentifiers.copy);

I don't think dot syntax makes sense for -copy. It's an operation, not a property.

> Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm:101
> +        NSString *adjustedFileName = suffix ? fileNameWithNumericSuffix(fileName, suffix) : fileName;

Won't this try to copy to the same existing file path twice before appending a numeric suffix?
Comment 5 Wenson Hsieh 2018-08-16 20:33:11 PDT
Comment on attachment 347129 [details]
Patch

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

Thanks for the review!

>> Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm:48
>> +    _promisedTypeIdentifiers = adoptNS(promisedTypeIdentifiers.copy);
> 
> I don't think dot syntax makes sense for -copy. It's an operation, not a property.

Sounds good — changed to [] notation.

>> Tools/TestWebKitAPI/mac/TestFilePromiseReceiver.mm:101
>> +        NSString *adjustedFileName = suffix ? fileNameWithNumericSuffix(fileName, suffix) : fileName;
> 
> Won't this try to copy to the same existing file path twice before appending a numeric suffix?

Ah, good catch! Fixed.
Comment 6 Wenson Hsieh 2018-08-16 21:19:07 PDT
Created attachment 347347 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2018-08-16 21:58:56 PDT
Comment on attachment 347347 [details]
Patch for landing

Clearing flags on attachment: 347347

Committed r234976: <https://trac.webkit.org/changeset/234976>
Comment 8 Radar WebKit Bug Importer 2018-08-17 06:06:26 PDT
<rdar://problem/43421379>