Changeset 216777 in webkit
- Timestamp:
- May 12, 2017 1:09:25 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r216776 r216777 1 2017-05-12 Brady Eidson <beidson@apple.com> 2 3 REGRESSION (r216711): API test WKWebView.ClearAppCache is failing. 4 https://bugs.webkit.org/show_bug.cgi?id=172030 5 6 Unreviewed - Test gardening, in effect... 7 8 This failure is only being seen by the bots. 9 10 I believe this test is utterly broken in the first place; when it checks the .wal file's 11 size that is not actually an indicator that the records were deleted. 12 13 But that isn't what's coming up as failure on the bots. 14 15 This patch is an attempt to: 16 1 - More forcefully clear the Website data directory of leftovers before the test starts. 17 2 - Give an earlier indication of the failure that the bots are seeing, to possibly reveal more. 18 19 * TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm: 20 (defaultWebsiteDataDirectory): 21 (defaultApplicationCacheDirectory): 22 (TEST): 23 1 24 2017-05-12 Jonathan Bedard <jbedard@apple.com> 2 25 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm
r210093 r216777 108 108 } 109 109 110 NSString *defaultWebsiteDataDirectory() 111 { 112 #if PLATFORM(IOS) 113 return nil; 114 #else 115 return @"~/Library/Caches/TestWebKitAPI/WebKit"; 116 #endif 117 } 118 110 119 NSString *defaultApplicationCacheDirectory() 111 120 { … … 114 123 return [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/com.apple.WebAppCache"]; 115 124 #else 116 return @"~/Library/Caches/TestWebKitAPI/WebKit/OfflineWebApplicationCache";125 return [defaultWebsiteDataDirectory() stringByAppendingString:@"/OfflineWebApplicationCache"]; 117 126 #endif 118 127 } … … 127 136 NSURL *shmResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-shm" subdirectory:@"TestWebKitAPI.resources"]; 128 137 NSURL *walResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-wal" subdirectory:@"TestWebKitAPI.resources"]; 129 138 139 // Clean up any website data files left from any previous test run. 140 if (auto *websiteDataDirectory = defaultWebsiteDataDirectory()) { 141 NSURL *websiteDataURL = [NSURL fileURLWithPath:[websiteDataDirectory stringByExpandingTildeInPath]]; 142 [[NSFileManager defaultManager] removeItemAtURL:websiteDataURL error:nil]; 143 } 144 130 145 NSURL *targetURL = [NSURL fileURLWithPath:[defaultApplicationCacheDirectory() stringByExpandingTildeInPath]]; 131 146 [[NSFileManager defaultManager] createDirectoryAtURL:targetURL withIntermediateDirectories:YES attributes:nil error:nil]; 132 147 133 148 NSURL *dbTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db"]; 134 149 NSURL *walTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db-wal"]; 135 150 NSURL *shmTargetURL = [targetURL URLByAppendingPathComponent:@"ApplicationCache.db-shm"]; 136 151 137 // Clean up any files that may have been left from this test failing before.138 [[NSFileManager defaultManager] removeItemAtURL:dbTargetURL error:nil];139 [[NSFileManager defaultManager] removeItemAtURL:walTargetURL error:nil];140 [[NSFileManager defaultManager] removeItemAtURL:shmTargetURL error:nil];141 152 EXPECT_EQ(fileSize(dbTargetURL), -1); 142 153 EXPECT_EQ(fileSize(walTargetURL), -1); 143 154 EXPECT_EQ(fileSize(shmTargetURL), -1); 144 155 145 156 // Copy the resources from the bundle to ~/Library/... 146 157 [[NSFileManager defaultManager] copyItemAtURL:dbResourceURL toURL:dbTargetURL error:nil]; … … 157 168 [[WKWebsiteDataStore defaultDataStore] fetchDataRecordsOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] completionHandler:^(NSArray<WKWebsiteDataRecord *> *websiteDataRecords) 158 169 { 159 EXPECT_ GT(websiteDataRecords.count, 0ul);170 EXPECT_EQ(websiteDataRecords.count, 1ul); 160 171 originalWebsiteDataRecordCount = websiteDataRecords.count; 161 172 readyToContinue = true;
Note: See TracChangeset
for help on using the changeset viewer.