Changeset 228380 in webkit


Ignore:
Timestamp:
Feb 12, 2018 10:32:28 AM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r227910. rdar://problem/37460507

Location:
branches/safari-605-branch/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/Tools/ChangeLog

    r228360 r228380  
     12018-02-12  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r227910. rdar://problem/37460507
     4
     5    2018-01-31  Wenson Hsieh  <wenson_hsieh@apple.com>
     6
     7            [iOS WK2] API test DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntry is failing after an SDK update
     8            https://bugs.webkit.org/show_bug.cgi?id=182339
     9            <rdar://problem/36041396>
     10
     11            Reviewed by Andy Estes.
     12
     13            This API test wasn't meant to be dependent on the size of an image generated using UIImagePNGRepresentation().
     14            To make this test robust against changes to image encoding, write the raw data to the test folder instead and
     15            check against the length of the data written.
     16
     17            * TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
     18            (testIconImageData):
     19            (runTestWithTemporaryFolder):
     20            (TestWebKitAPI::TEST):
     21
    1222018-02-09  Jason Marcell  <jmarcell@apple.com>
    223
  • branches/safari-605-branch/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm

    r228360 r228380  
    185185}
    186186
     187static NSData *testIconImageData()
     188{
     189    return [NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"icon" withExtension:@"png" subdirectory:@"TestWebKitAPI.resources"]];
     190}
     191
    187192static void runTestWithTemporaryTextFile(void(^runTest)(NSURL *fileURL))
    188193{
     
    213218    NSFileManager *defaultManager = [NSFileManager defaultManager];
    214219    [defaultManager createDirectoryAtURL:temporaryFolder.get() withIntermediateDirectories:NO attributes:nil error:&error];
    215     [UIImagePNGRepresentation(testIconImage()) writeToURL:[temporaryFolder.get() URLByAppendingPathComponent:@"icon.png" isDirectory:NO] atomically:YES];
     220    [testIconImageData() writeToURL:[temporaryFolder.get() URLByAppendingPathComponent:@"icon.png" isDirectory:NO] atomically:YES];
    216221    [testZIPArchive() writeToURL:[temporaryFolder.get() URLByAppendingPathComponent:@"archive.zip" isDirectory:NO] atomically:YES];
    217222
     
    10171022        @"DIR: /somedirectory/subdirectory1",
    10181023        @"DIR: /somedirectory/subdirectory2",
    1019         @"FILE: /somedirectory/archive.zip ('application/zip', 988 bytes)",
    1020         @"FILE: /somedirectory/icon.png ('image/png', 42130 bytes)",
     1024        [NSString stringWithFormat:@"FILE: /somedirectory/archive.zip ('application/zip', %tu bytes)", testZIPArchive().length],
     1025        [NSString stringWithFormat:@"FILE: /somedirectory/icon.png ('image/png', %tu bytes)", testIconImageData().length],
    10211026        @"FILE: /somedirectory/subdirectory1/text-file-1.txt ('text/plain', 43 bytes)",
    10221027        @"FILE: /somedirectory/subdirectory2/text-file-2.txt ('text/plain', 44 bytes)"
Note: See TracChangeset for help on using the changeset viewer.