Changeset 216805 in webkit
- Timestamp:
- May 12, 2017 5:31:47 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r216802 r216805 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 7 8 Try to resolve this once and for all by using the WebsiteDataStore API to nuke everything 9 before the test starts. 10 11 * TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm: 12 (defaultWebsiteCacheDirectory): 13 (defaultApplicationCacheDirectory): 14 (TEST): 15 (defaultWebsiteDataDirectory): Deleted. 16 1 17 2017-05-12 David Quesada <david_quesada@apple.com> 2 18 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm
r216800 r216805 108 108 } 109 109 110 NSString *defaultWebsite DataDirectory()110 NSString *defaultWebsiteCacheDirectory() 111 111 { 112 112 #if PLATFORM(IOS) … … 123 123 return [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/com.apple.WebAppCache"]; 124 124 #else 125 return [defaultWebsite DataDirectory() stringByAppendingString:@"/OfflineWebApplicationCache"];125 return [defaultWebsiteCacheDirectory() stringByAppendingString:@"/OfflineWebApplicationCache"]; 126 126 #endif 127 127 } … … 133 133 TestWebKitAPI::InstanceMethodSwizzler swizzle([NSBundle class], @selector(bundleIdentifier), reinterpret_cast<IMP>(swizzledBundleIdentifierWebBookmarksD)); 134 134 #endif 135 136 // Start with a clean slate of WebsiteData. 137 readyToContinue = false; 138 [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() 139 { 140 readyToContinue = true; 141 }]; 142 TestWebKitAPI::Util::run(&readyToContinue); 143 144 // Start with a clean slate of Website caches. 145 if (auto *websiteCacheDirectory = defaultWebsiteCacheDirectory()) { 146 NSURL *websiteCacheURL = [NSURL fileURLWithPath:[websiteCacheDirectory stringByExpandingTildeInPath]]; 147 [[NSFileManager defaultManager] removeItemAtURL:websiteCacheURL error:nil]; 148 } 149 135 150 NSURL *dbResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db" subdirectory:@"TestWebKitAPI.resources"]; 136 151 NSURL *shmResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-shm" subdirectory:@"TestWebKitAPI.resources"]; 137 152 NSURL *walResourceURL = [[NSBundle mainBundle] URLForResource:@"ApplicationCache" withExtension:@"db-wal" subdirectory:@"TestWebKitAPI.resources"]; 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 153 145 154 NSURL *targetURL = [NSURL fileURLWithPath:[defaultApplicationCacheDirectory() stringByExpandingTildeInPath]];
Note: See TracChangeset
for help on using the changeset viewer.