Bug 188583 - [macOS] [WK2] Add infrastructure to test receiving file promises on drop
Summary: [macOS] [WK2] Add infrastructure to test receiving file promises on drop
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-14 15:47 PDT by Wenson Hsieh
Modified: 2018-08-17 06:06 PDT (History)
8 users (show)

See Also:


Attachments
Patch (34.85 KB, patch)
2018-08-14 16:43 PDT, Wenson Hsieh
aestes: review+
Details | Formatted Diff | Diff
Archive of layout-test-results from ews206 for win-future (12.89 MB, application/zip)
2018-08-16 17:42 PDT, EWS Watchlist
no flags Details
Patch for landing (34.74 KB, patch)
2018-08-16 21:19 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>