Changeset 250156 in webkit
- Timestamp:
- Sep 20, 2019 2:45:53 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r250138 r250156 1 2019-09-20 Alex Christensen <achristensen@webkit.org> 2 3 Begin moving WebsiteDataStore setters to WebsiteDataStoreConfiguration 4 https://bugs.webkit.org/show_bug.cgi?id=202025 5 6 Reviewed by Chris Dumez. 7 8 One expected change in behavior is that the resource load statistics directory is not created on startup with an ephemeral session any more 9 because we call the constructor of WebsiteDataStoreConfiguration inside _WKWebsiteDataStoreConfiguration and set the default directory like we do the other directories. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm: 12 * WebKitTestRunner/TestController.cpp: 13 (WTR::TestController::websiteDataStore): 14 (WTR::TestController::generatePageConfiguration): 15 1 16 2019-09-20 Keith Rollin <krollin@apple.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/StorageQuota.mm
r245698 r250156 226 226 { 227 227 done = false; 228 [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 228 _WKWebsiteDataStoreConfiguration *storeConfiguration = [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease]; 229 storeConfiguration.perOriginStorageQuota = 1024 * 400; 230 WKWebsiteDataStore *dataStore = [[[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration] autorelease]; 231 [dataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 229 232 done = true; 230 233 }]; … … 232 235 233 236 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 234 235 [[configuration websiteDataStore] _setPerOriginStorageQuota: 1024 * 400]; 236 237 [configuration setWebsiteDataStore:dataStore]; 238 237 239 auto messageHandler = adoptNS([[QuotaMessageHandler alloc] init]); 238 240 [[configuration userContentController] addScriptMessageHandler:messageHandler.get() name:@"qt"]; … … 287 289 { 288 290 done = false; 289 [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 291 _WKWebsiteDataStoreConfiguration *storeConfiguration = [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease]; 292 storeConfiguration.perOriginStorageQuota = 1024 * 400; 293 WKWebsiteDataStore *dataStore = [[[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration] autorelease]; 294 [dataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 290 295 done = true; 291 296 }]; … … 293 298 294 299 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 295 296 [[configuration websiteDataStore] _setPerOriginStorageQuota: 1024 * 400]; 300 [configuration setWebsiteDataStore:dataStore]; 297 301 298 302 auto messageHandler = adoptNS([[QuotaMessageHandler alloc] init]); … … 333 337 { 334 338 done = false; 335 [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 339 _WKWebsiteDataStoreConfiguration *storeConfiguration = [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease]; 340 storeConfiguration.perOriginStorageQuota = 1024 * 400; 341 WKWebsiteDataStore *dataStore = [[[WKWebsiteDataStore alloc] _initWithConfiguration:storeConfiguration] autorelease]; 342 [dataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { 336 343 done = true; 337 344 }]; … … 339 346 340 347 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 341 342 [[configuration websiteDataStore] _setPerOriginStorageQuota: 1024 * 400]; 348 [configuration setWebsiteDataStore:dataStore]; 343 349 344 350 auto messageHandler = adoptNS([[QuotaMessageHandler alloc] init]); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm
r249808 r250156 407 407 [configuration.get().websiteDataStore _setResourceLoadStatisticsEnabled:YES]; 408 408 409 // We expect the directory to be created by starting up the data store machinery, but not the data file. 410 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:defaultResourceLoadStatisticsPath.path]); 409 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:defaultResourceLoadStatisticsPath.path]); 411 410 412 411 NSURL *defaultResourceLoadStatisticsFilePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/WebsiteData/ResourceLoadStatistics/full_browsing_session_resourceLog.plist" stringByExpandingTildeInPath] isDirectory:NO]; … … 451 450 [configuration.get().websiteDataStore _setResourceLoadStatisticsEnabled:YES]; 452 451 453 // We expect the directory to be created by starting up the data store machinery, but not the data file. 454 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:defaultResourceLoadStatisticsPath.path]); 452 EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:defaultResourceLoadStatisticsPath.path]); 455 453 456 454 NSURL *defaultResourceLoadStatisticsFilePath = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/WebsiteData/ResourceLoadStatistics/full_browsing_session_resourceLog.plist" stringByExpandingTildeInPath] isDirectory:NO]; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r249808 r250156 524 524 WKWebsiteDataStoreConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + pathSeparator + "MediaKeys").get()); 525 525 WKWebsiteDataStoreConfigurationSetResourceLoadStatisticsDirectory(configuration.get(), toWK(temporaryFolder + pathSeparator + "ResourceLoadStatistics").get()); 526 WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota(configuration.get(), 400 * 1024); 526 527 } 527 528 dataStore = WKWebsiteDataStoreCreateWithConfiguration(configuration.get()); … … 551 552 WKContextUseTestingNetworkSession(m_context.get()); 552 553 WKContextSetCacheModel(m_context.get(), kWKCacheModelDocumentBrowser); 553 554 WKWebsiteDataStoreSetPerOriginStorageQuota(TestController::websiteDataStore(), 400 * 1024);555 554 556 555 platformInitializeContext();
Note: See TracChangeset
for help on using the changeset viewer.