Changeset 252259 in webkit
- Timestamp:
- Nov 8, 2019 1:26:15 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252258 r252259 1 2019-11-08 Alex Christensen <achristensen@webkit.org> 2 3 Fix flaky tests in http/tests/cache/disk-cache 4 https://bugs.webkit.org/show_bug.cgi?id=203822 5 6 Reviewed by Youenn Fablet. 7 8 Right now tests that set the cache model do so using a race condition. I think this will fix the flakyness we've observed. 9 10 * NetworkProcess/NetworkProcess.cpp: 11 (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting): 12 * NetworkProcess/NetworkProcess.h: 13 * NetworkProcess/NetworkProcess.messages.in: 14 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: 15 (WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting): 16 * UIProcess/API/C/WKWebsiteDataStoreRef.h: 17 * UIProcess/WebProcessPool.cpp: 18 (WebKit::WebProcessPool::setCacheModelSynchronouslyForTesting): 19 * UIProcess/WebProcessPool.h: 20 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 21 (WebKit::WebsiteDataStore::setCacheModelSynchronouslyForTesting): 22 * UIProcess/WebsiteData/WebsiteDataStore.h: 23 1 24 2019-11-08 Alex Christensen <achristensen@webkit.org> 2 25 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r251831 r252259 1994 1994 } 1995 1995 1996 void NetworkProcess::setCacheModelSynchronouslyForTesting(CacheModel cacheModel, CompletionHandler<void()>&& completionHandler) 1997 { 1998 setCacheModel(cacheModel, { }); 1999 completionHandler(); 2000 } 2001 1996 2002 void NetworkProcess::setCacheModel(CacheModel cacheModel, String cacheStorageDirectory) 1997 2003 { -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r251676 r252259 407 407 408 408 void setCacheModel(CacheModel, String overrideCacheStorageDirectory); 409 void setCacheModelSynchronouslyForTesting(CacheModel, CompletionHandler<void()>&&); 409 410 void allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo&, const String& host); 410 411 void clearCacheForAllOrigins(uint32_t cachesToClear); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r251659 r252259 70 70 71 71 ClearCacheForAllOrigins(uint32_t cachesToClear) 72 SetCacheModel(enum:uint8_t WebKit::CacheModel cacheModel, String overrideCacheStorageDirectory); 72 SetCacheModel(enum:uint8_t WebKit::CacheModel cacheModel, String overrideCacheStorageDirectory) 73 SetCacheModelSynchronouslyForTesting(enum:uint8_t WebKit::CacheModel cacheModel) -> () Synchronous 73 74 74 75 ProcessDidTransitionToBackground() -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r251213 r252259 683 683 } 684 684 685 void WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting(WKWebsiteDataStoreRef dataStoreRef, WKCacheModel cacheModel) 686 { 687 WebKit::toImpl(dataStoreRef)->setCacheModelSynchronouslyForTesting(WebKit::toCacheModel(cacheModel)); 688 } -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h
r251213 r252259 33 33 extern "C" { 34 34 #endif 35 36 typedef uint32_t WKCacheModel; 35 37 36 38 WK_EXPORT WKTypeID WKWebsiteDataStoreGetTypeID(); … … 152 154 WK_EXPORT void WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemovalFunction callback); 153 155 156 WK_EXPORT void WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting(WKWebsiteDataStoreRef dataStoreRef, WKCacheModel cacheModel); 157 154 158 #ifdef __cplusplus 155 159 } -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r252257 r252259 1575 1575 } 1576 1576 1577 void WebProcessPool::setCacheModelSynchronouslyForTesting(CacheModel cacheModel) 1578 { 1579 updateBackForwardCacheCapacity(); 1580 1581 if (m_networkProcess) 1582 m_networkProcess->sendSync(Messages::NetworkProcess::SetCacheModelSynchronouslyForTesting(cacheModel), { }, { }); 1583 } 1584 1577 1585 void WebProcessPool::setDefaultRequestTimeoutInterval(double timeoutInterval) 1578 1586 { -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r252257 r252259 284 284 285 285 void setCacheModel(CacheModel); 286 void setCacheModelSynchronouslyForTesting(CacheModel); 287 286 288 287 289 void setDefaultRequestTimeoutInterval(double); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r252014 r252259 2064 2064 } 2065 2065 2066 void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheModel) 2067 { 2068 for (auto processPool : WebProcessPool::allProcessPools()) 2069 processPool->setCacheModelSynchronouslyForTesting(cacheModel); 2070 } 2071 2066 2072 #if !PLATFORM(COCOA) 2067 2073 WebsiteDataStoreParameters WebsiteDataStore::parameters() -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r251687 r252259 79 79 class WebProcessProxy; 80 80 class WebResourceLoadStatisticsStore; 81 enum class CacheModel : uint8_t; 81 82 enum class WebsiteDataFetchOption; 82 83 enum class WebsiteDataType; … … 139 140 140 141 void getLocalStorageDetails(Function<void(Vector<LocalStorageDatabaseTracker::OriginDetails>&&)>&&); 142 void setCacheModelSynchronouslyForTesting(CacheModel); 141 143 142 144 #if ENABLE(RESOURCE_LOAD_STATISTICS) -
trunk/Tools/ChangeLog
r252249 r252259 1 2019-11-08 Alex Christensen <achristensen@webkit.org> 2 3 Fix flaky tests in http/tests/cache/disk-cache 4 https://bugs.webkit.org/show_bug.cgi?id=203822 5 6 Reviewed by Youenn Fablet. 7 8 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 9 (WTR::InjectedBundle::setCacheModel): 10 * WebKitTestRunner/TestInvocation.cpp: 11 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): 12 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 13 1 14 2019-11-08 Aakash Jain <aakash_jain@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r251950 r252259 926 926 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetCacheModel")); 927 927 WKRetainPtr<WKUInt64Ref> messageBody = adoptWK(WKUInt64Create(model)); 928 WKBundlePagePost Message(page()->page(), messageName.get(), messageBody.get());928 WKBundlePagePostSynchronousMessageForTesting(page()->page(), messageName.get(), messageBody.get(), nullptr); 929 929 } 930 930 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r251213 r252259 547 547 } 548 548 549 if (WKStringIsEqualToUTF8CString(messageName, "SetCacheModel")) {550 ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID());551 uint64_t model = WKUInt64GetValue(static_cast<WKUInt64Ref>(messageBody));552 WKContextSetCacheModel(TestController::singleton().context(), model);553 return;554 }555 556 549 if (WKStringIsEqualToUTF8CString(messageName, "SetCustomPolicyDelegate")) { 557 550 ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); … … 878 871 WKRetainPtr<WKTypeRef> result = adoptWK(WKBooleanCreate(isActive)); 879 872 return result; 873 } 874 875 if (WKStringIsEqualToUTF8CString(messageName, "SetCacheModel")) { 876 ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID()); 877 uint64_t model = WKUInt64GetValue(static_cast<WKUInt64Ref>(messageBody)); 878 WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting(TestController::websiteDataStore(), model); 879 return nullptr; 880 880 } 881 881
Note: See TracChangeset
for help on using the changeset viewer.