WebKit Bugzilla
Attachment 373307 Details for
Bug 199385
: Only allow fetching and removing session credentials from WebsiteDataStore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199385-20190702000451.patch (text/plain), 24.75 KB, created by
Sihui Liu
on 2019-07-02 00:04:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2019-07-02 00:04:52 PDT
Size:
24.75 KB
patch
obsolete
>Subversion Revision: 246947 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5e5bacdb18fb9788f8cfb0c2a6a97f5efd1a8c54..df52f811f6ca83e6322c870e27d1068078eb970c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-07-02 Sihui Liu <sihui_liu@apple.com> >+ >+ Only allow fetching and removing session credentials from WebsiteDataStore >+ https://bugs.webkit.org/show_bug.cgi?id=199385 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Modified existing API tests: WKWebsiteDataStore.FetchPersistentCredentials >+ >+ * platform/network/CredentialStorage.cpp: >+ (WebCore::CredentialStorage::originsWithCredentials const): >+ (WebCore::CredentialStorage::originsWithSessionCredentials): >+ (WebCore::CredentialStorage::removeSessionCredentialsWithOrigins): >+ (WebCore::CredentialStorage::clearSessionCredentials): >+ * platform/network/CredentialStorage.h: >+ * platform/network/mac/CredentialStorageMac.mm: >+ (WebCore::CredentialStorage::originsWithSessionCredentials): >+ (WebCore::CredentialStorage::removeSessionCredentialsWithOrigins): >+ (WebCore::CredentialStorage::clearSessionCredentials): >+ (WebCore::CredentialStorage::originsWithPersistentCredentials): Deleted. >+ > 2019-06-28 Zalan Bujtas <zalan@apple.com> > > [Text autosizing][iPadOS] bing.com is hard to read even with boosted text because of the line height >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8ead54ff6f4abefb58a286e19b91931d0abf45a2..365122dead5aa8696c378b03cdd563cdcda4aa37 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,29 @@ >+2019-07-02 Sihui Liu <sihui_liu@apple.com> >+ >+ Only allow fetching and removing session credentials from WebsiteDataStore >+ https://bugs.webkit.org/show_bug.cgi?id=199385 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Stop sending an extra message to network process for fetching or removing persistent credentials. >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::fetchWebsiteData): >+ (WebKit::NetworkProcess::deleteWebsiteData): >+ (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): >+ (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): >+ (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted. >+ (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted. >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcess.messages.in: >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::NetworkProcess::originsWithPersistentCredentials): Deleted. >+ (WebKit::NetworkProcess::removeCredentialsWithOrigins): Deleted. >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::fetchDataAndApply): >+ (WebKit::computeWebProcessAccessTypeForDataRemoval): >+ (WebKit::WebsiteDataStore::removeData): >+ > 2019-06-28 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed build fix attempt after r246928. >diff --git a/Source/WebCore/platform/network/CredentialStorage.cpp b/Source/WebCore/platform/network/CredentialStorage.cpp >index 98e9426fc27adbb2bb60bed46dd5667faf7c3962..b2d90fbcdc9edd483fc7d2e0a06af286b596a33f 100644 >--- a/Source/WebCore/platform/network/CredentialStorage.cpp >+++ b/Source/WebCore/platform/network/CredentialStorage.cpp >@@ -102,9 +102,9 @@ void CredentialStorage::removeCredentialsWithOrigin(const SecurityOriginData& or > remove(key.first, key.second); > } > >-Vector<SecurityOriginData> CredentialStorage::originsWithCredentials() const >+HashSet<SecurityOriginData> CredentialStorage::originsWithCredentials() const > { >- Vector<SecurityOriginData> origins; >+ HashSet<SecurityOriginData> origins; > for (auto& keyValuePair : m_protectionSpaceToCredentialMap) { > auto& protectionSpace = keyValuePair.key.second; > if (protectionSpace.isProxy()) >@@ -129,7 +129,7 @@ Vector<SecurityOriginData> CredentialStorage::originsWithCredentials() const > } > > SecurityOriginData origin { protocol, protectionSpace.host(), static_cast<uint16_t>(protectionSpace.port())}; >- origins.append(WTFMove(origin)); >+ origins.add(WTFMove(origin)); > } > return origins; > } >@@ -187,4 +187,21 @@ void CredentialStorage::clearCredentials() > m_pathToDefaultProtectionSpaceMap.clear(); > } > >+#if !PLATFORM(COCOA) >+Vector<SecurityOriginData> CredentialStorage::originsWithSessionCredentials() >+{ >+ return { }; >+} >+ >+void CredentialStorage::removeSessionCredentialsWithOrigins(const Vector<SecurityOriginData>&) >+{ >+ return; >+} >+ >+void CredentialStorage::clearSessionCredentials() >+{ >+ return; >+} >+#endif >+ > } // namespace WebCore >diff --git a/Source/WebCore/platform/network/CredentialStorage.h b/Source/WebCore/platform/network/CredentialStorage.h >index f8c75ae929ab2d5425a24a6267cd42738d75c0d7..d0e16f7bb52593c7992fac9dd2cfb9579f858d3b 100644 >--- a/Source/WebCore/platform/network/CredentialStorage.h >+++ b/Source/WebCore/platform/network/CredentialStorage.h >@@ -45,9 +45,11 @@ public: > WEBCORE_EXPORT void remove(const String&, const ProtectionSpace&); > WEBCORE_EXPORT void removeCredentialsWithOrigin(const SecurityOriginData&); > >- // OS persistent storage. >+ // OS credential storage. > WEBCORE_EXPORT static Credential getFromPersistentStorage(const ProtectionSpace&); >- WEBCORE_EXPORT static Vector<SecurityOriginData> originsWithPersistentCredentials(); >+ WEBCORE_EXPORT static HashSet<SecurityOriginData> originsWithSessionCredentials(); >+ WEBCORE_EXPORT static void removeSessionCredentialsWithOrigins(const Vector<SecurityOriginData>& origins); >+ WEBCORE_EXPORT static void clearSessionCredentials(); > > WEBCORE_EXPORT void clearCredentials(); > >@@ -56,7 +58,7 @@ public: > WEBCORE_EXPORT bool set(const String&, const Credential&, const URL&); // Returns true if the URL corresponds to a known protection space, so credentials could be updated. > WEBCORE_EXPORT Credential get(const String&, const URL&); > >- WEBCORE_EXPORT Vector<SecurityOriginData> originsWithCredentials() const; >+ WEBCORE_EXPORT HashSet<SecurityOriginData> originsWithCredentials() const; > > private: > HashMap<std::pair<String /* partitionName */, ProtectionSpace>, Credential> m_protectionSpaceToCredentialMap; >diff --git a/Source/WebCore/platform/network/mac/CredentialStorageMac.mm b/Source/WebCore/platform/network/mac/CredentialStorageMac.mm >index 65b51511f9a9b2b8b12f63edae36fef35e76d39c..a1c508aec72e3486b2c07da384c96bda306c0733 100644 >--- a/Source/WebCore/platform/network/mac/CredentialStorageMac.mm >+++ b/Source/WebCore/platform/network/mac/CredentialStorageMac.mm >@@ -38,13 +38,57 @@ Credential CredentialStorage::getFromPersistentStorage(const ProtectionSpace& pr > return credential ? Credential(credential) : Credential(); > } > >-Vector<WebCore::SecurityOriginData> CredentialStorage::originsWithPersistentCredentials() >+HashSet<SecurityOriginData> CredentialStorage::originsWithSessionCredentials() > { >- Vector<WebCore::SecurityOriginData> origins; >+ HashSet<SecurityOriginData> origins; > auto allCredentials = [[NSURLCredentialStorage sharedCredentialStorage] allCredentials]; >- for (NSURLProtectionSpace* key in allCredentials.keyEnumerator) >- origins.append(WebCore::SecurityOriginData { String(key.protocol), String(key.host), key.port }); >+ for (NSURLProtectionSpace* key in allCredentials.keyEnumerator) { >+ for (NSURLProtectionSpace* space in allCredentials) { >+ auto credentials = allCredentials[space]; >+ for (NSString* user in credentials) { >+ if (credentials[user].persistence == NSURLCredentialPersistenceForSession) { >+ origins.add(WebCore::SecurityOriginData { String(key.protocol), String(key.host), key.port }); >+ break; >+ } >+ } >+ } >+ } > return origins; > } > >+void CredentialStorage::removeSessionCredentialsWithOrigins(const Vector<SecurityOriginData>& origins) >+{ >+ auto sharedStorage = [NSURLCredentialStorage sharedCredentialStorage]; >+ auto allCredentials = [sharedStorage allCredentials]; >+ for (auto& origin : origins) { >+ for (NSURLProtectionSpace* space in allCredentials) { >+ if (origin.protocol == String(space.protocol) >+ && origin.host == String(space.host) >+ && origin.port >+ && *origin.port == space.port) { >+ auto credentials = allCredentials[space]; >+ for (NSString* user in credentials) { >+ auto credential = credentials[user]; >+ if (credential.persistence == NSURLCredentialPersistenceForSession) >+ [sharedStorage removeCredential:credential forProtectionSpace:space]; >+ } >+ } >+ } >+ } >+} >+ >+void CredentialStorage::clearSessionCredentials() >+{ >+ auto sharedStorage = [NSURLCredentialStorage sharedCredentialStorage]; >+ auto allCredentials = [sharedStorage allCredentials]; >+ for (NSURLProtectionSpace* space in allCredentials.keyEnumerator) { >+ auto credentials = allCredentials[space]; >+ for (NSString* user in credentials) { >+ auto credential = credentials[user]; >+ if (credential.persistence == NSURLCredentialPersistenceForSession) >+ [sharedStorage removeCredential:credential forProtectionSpace:space]; >+ } >+ } >+} >+ > } // namespace WebCore >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 3ae2c9ea9dc42eae36bd23ccd07c147afe0e2e2e..be3862386ffde95a9213ad098cf6cfe0a72fbdc5 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -1290,6 +1290,9 @@ void NetworkProcess::fetchWebsiteData(PAL::SessionID sessionID, OptionSet<Websit > for (auto& securityOrigin : securityOrigins) > callbackAggregator->m_websiteData.entries.append({ securityOrigin, WebsiteDataType::Credentials, 0 }); > } >+ auto securityOrigins = WebCore::CredentialStorage::originsWithSessionCredentials(); >+ for (auto& securityOrigin : securityOrigins) >+ callbackAggregator->m_websiteData.entries.append({ securityOrigin, WebsiteDataType::Credentials, 0 }); > } > > if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) { >@@ -1371,6 +1374,7 @@ void NetworkProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<Websi > if (websiteDataTypes.contains(WebsiteDataType::Credentials)) { > if (auto* session = storageSession(sessionID)) > session->credentialStorage().clearCredentials(); >+ WebCore::CredentialStorage::clearSessionCredentials(); > } > > auto clearTasksHandler = WTF::CallbackAggregator::create([this, callbackID] { >@@ -1508,6 +1512,7 @@ void NetworkProcess::deleteWebsiteDataForOrigins(PAL::SessionID sessionID, Optio > for (auto& originData : originDatas) > session->credentialStorage().removeCredentialsWithOrigin(originData); > } >+ WebCore::CredentialStorage::removeSessionCredentialsWithOrigins(originDatas); > } > > // FIXME: Implement storage quota clearing for these origins. >@@ -1652,14 +1657,18 @@ void NetworkProcess::deleteWebsiteDataForRegistrableDomains(PAL::SessionID sessi > } > #endif > >- /* >- // FIXME: No API to delete credentials by origin >- HashSet<String> originsWithCredentials; > if (websiteDataTypes.contains(WebsiteDataType::Credentials)) { >- if (storageSession(sessionID)) >- originsWithCredentials = storageSession(sessionID)->credentialStorage().originsWithCredentials(); >+ if (auto* session = storageSession(sessionID)) { >+ auto origins = session->credentialStorage().originsWithCredentials(); >+ auto originsToDelete = filterForRegistrableDomains(origins, domainsToDeleteAllButCookiesFor, callbackAggregator->m_domains); >+ for (auto& origin : originsToDelete) >+ session->credentialStorage().removeCredentialsWithOrigin(origin); >+ } >+ >+ auto origins = WebCore::CredentialStorage::originsWithSessionCredentials(); >+ auto originsToDelete = filterForRegistrableDomains(origins, domainsToDeleteAllButCookiesFor, callbackAggregator->m_domains); >+ WebCore::CredentialStorage::removeSessionCredentialsWithOrigins(originsToDelete); > } >- */ > > if (websiteDataTypes.contains(WebsiteDataType::DOMCache)) { > CacheStorage::Engine::fetchEntries(*this, sessionID, fetchOptions.contains(WebsiteDataFetchOption::ComputeSizes), [this, domainsToDeleteAllButCookiesFor, sessionID, callbackAggregator = callbackAggregator.copyRef()](auto entries) mutable { >@@ -2565,16 +2574,6 @@ StorageQuotaManager& NetworkProcess::storageQuotaManager(PAL::SessionID sessionI > } > > #if !PLATFORM(COCOA) >-void NetworkProcess::originsWithPersistentCredentials(CompletionHandler<void(Vector<WebCore::SecurityOriginData>)>&& completionHandler) >-{ >- completionHandler(Vector<WebCore::SecurityOriginData>()); >-} >- >-void NetworkProcess::removeCredentialsWithOrigins(const Vector<WebCore::SecurityOriginData>&, CompletionHandler<void()>&& completionHandler) >-{ >- completionHandler(); >-} >- > void NetworkProcess::initializeProcess(const AuxiliaryProcessInitializationParameters&) > { > } >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.h b/Source/WebKit/NetworkProcess/NetworkProcess.h >index 4f09984fe4bff176f99fc7d0169380244af9c7d7..698b9253e94f0b5bc89bfbb2466b54502790b89e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.h >@@ -436,9 +436,6 @@ private: > #endif > > void platformSyncAllCookies(CompletionHandler<void()>&&); >- >- void originsWithPersistentCredentials(CompletionHandler<void(Vector<WebCore::SecurityOriginData>)>&&); >- void removeCredentialsWithOrigins(const Vector<WebCore::SecurityOriginData>& origins, CompletionHandler<void()>&&); > > void registerURLSchemeAsSecure(const String&) const; > void registerURLSchemeAsBypassingContentSecurityPolicy(const String&) const; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >index 6d0624083f75f332726ab3fb21dc1d2cff90c21c..91fe69d57a2a36de246c42ab7d778f2bda3d978f 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.messages.in >@@ -168,7 +168,5 @@ messages -> NetworkProcess LegacyReceiver { > SetAdClickAttributionOverrideTimerForTesting(PAL::SessionID sessionID, bool value) -> () Async > SetAdClickAttributionConversionURLForTesting(PAL::SessionID sessionID, URL url) -> () Async > MarkAdClickAttributionsAsExpiredForTesting(PAL::SessionID sessionID) -> () Async >- OriginsWithPersistentCredentials() -> (Vector<WebCore::SecurityOriginData> origins) Async >- RemoveCredentialsWithOrigins(Vector<WebCore::SecurityOriginData> origins) -> () Async > GetLocalStorageOriginDetails(PAL::SessionID sessionID) -> (Vector<WebKit::LocalStorageDatabaseTracker::OriginDetails> details) Async > } >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >index bdefe9e4fa59006d5eb597bb7c05d361dd7918a6..5b52cabc0d997ec589a37a5089c9145b28aead3a 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >@@ -212,31 +212,6 @@ void NetworkProcess::clearDiskCache(WallTime modifiedSince, CompletionHandler<vo > }).get()); > } > >-void NetworkProcess::originsWithPersistentCredentials(CompletionHandler<void(Vector<WebCore::SecurityOriginData>)>&& completionHandler) >-{ >- completionHandler(WebCore::CredentialStorage::originsWithPersistentCredentials()); >-} >- >-void NetworkProcess::removeCredentialsWithOrigins(const Vector<WebCore::SecurityOriginData>& origins, CompletionHandler<void()>&& completionHandler) >-{ >- for (auto& origin : origins) { >- auto allCredentials = [[NSURLCredentialStorage sharedCredentialStorage] allCredentials]; >- for (NSURLProtectionSpace* space in allCredentials) { >- if (origin.protocol == String(space.protocol) >- && origin.host == String(space.host) >- && origin.port >- && *origin.port == space.port) { >- auto credentials = allCredentials[space]; >- for (NSString* user in credentials) { >- auto credential = credentials[user]; >- [[NSURLCredentialStorage sharedCredentialStorage] removeCredential:credential forProtectionSpace:space]; >- } >- } >- } >- } >- completionHandler(); >-} >- > #if PLATFORM(MAC) > void NetworkProcess::setSharedHTTPCookieStorage(const Vector<uint8_t>& identifier) > { >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index eabeaba3a4c52be9b0b2089b89f45bf92c8ed137..4c637e5abdcec9132934596b8046a2ba51f54a50 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -516,24 +516,6 @@ void WebsiteDataStore::fetchDataAndApply(OptionSet<WebsiteDataType> dataTypes, O > }); > } > >-#if PLATFORM(COCOA) >- if (dataTypes.contains(WebsiteDataType::Credentials) && isPersistent()) { >- for (auto& processPool : processPools()) { >- if (!processPool->networkProcess()) >- continue; >- >- callbackAggregator->addPendingCallback(); >- WTF::CompletionHandler<void(Vector<WebCore::SecurityOriginData>&&)> completionHandler = [callbackAggregator](Vector<WebCore::SecurityOriginData>&& origins) mutable { >- WebsiteData websiteData; >- for (auto& origin : origins) >- websiteData.entries.append(WebsiteData::Entry { origin, WebsiteDataType::Credentials, 0 }); >- callbackAggregator->removePendingCallback(WTFMove(websiteData)); >- }; >- processPool->networkProcess()->sendWithAsyncReply(Messages::NetworkProcess::OriginsWithPersistentCredentials(), WTFMove(completionHandler)); >- } >- } >-#endif >- > #if ENABLE(NETSCAPE_PLUGIN_API) > if (dataTypes.contains(WebsiteDataType::PlugInData) && isPersistent()) { > class State { >@@ -640,9 +622,6 @@ static ProcessAccessType computeWebProcessAccessTypeForDataRemoval(OptionSet<Web > if (dataTypes.contains(WebsiteDataType::MemoryCache)) > processAccessType = std::max(processAccessType, ProcessAccessType::OnlyIfLaunched); > >- if (dataTypes.contains(WebsiteDataType::Credentials)) >- processAccessType = std::max(processAccessType, ProcessAccessType::OnlyIfLaunched); >- > return processAccessType; > } > >@@ -1089,19 +1068,6 @@ void WebsiteDataStore::removeData(OptionSet<WebsiteDataType> dataTypes, const Ve > }); > } > >- if (dataTypes.contains(WebsiteDataType::Credentials) && isPersistent()) { >- for (auto& processPool : processPools()) { >- if (!processPool->networkProcess()) >- continue; >- >- callbackAggregator->addPendingCallback(); >- WTF::CompletionHandler<void()> completionHandler = [callbackAggregator]() mutable { >- callbackAggregator->removePendingCallback(); >- }; >- processPool->networkProcess()->sendWithAsyncReply(Messages::NetworkProcess::RemoveCredentialsWithOrigins(origins), WTFMove(completionHandler)); >- } >- } >- > #if ENABLE(NETSCAPE_PLUGIN_API) > if (dataTypes.contains(WebsiteDataType::PlugInData) && isPersistent()) { > Vector<String> hostNames; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 64bc1d5516c8e81d6359f6c795769a9827974335..55f2ce3cf4748c634de0aa303e5926ec62be0592 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2019-07-02 Sihui Liu <sihui_liu@apple.com> >+ >+ Only allow fetching and removing session credentials from WebsiteDataStore >+ https://bugs.webkit.org/show_bug.cgi?id=199385 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm: >+ (TestWebKitAPI::TEST): >+ > 2019-06-28 Robin Morisset <rmorisset@apple.com> > > Adding myself as a reviewer to contributors.json. >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm >index fae0a34bb33158767af536fa1377cfabdc471fe4..0e689aa9206db7028f485c6377e3d74312fe5999 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm >@@ -92,7 +92,7 @@ TEST(WKWebsiteDataStore, RemoveAndFetchData) > > readyToContinue = false; > [[WKWebsiteDataStore defaultDataStore] fetchDataRecordsOfTypes:[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate] completionHandler:^(NSArray<WKWebsiteDataRecord *> *dataRecords) { >- ASSERT_EQ(0u, dataRecords.count); >+ EXPECT_EQ(0u, dataRecords.count); > readyToContinue = true; > }]; > TestWebKitAPI::Util::run(&readyToContinue); >@@ -137,44 +137,6 @@ TEST(WKWebsiteDataStore, FetchNonPersistentCredentials) > } > > TEST(WKWebsiteDataStore, FetchPersistentCredentials) >-{ >- TCPServer server(TCPServer::respondWithChallengeThenOK); >- >- usePersistentCredentialStorage = true; >- auto websiteDataStore = [WKWebsiteDataStore defaultDataStore]; >- auto navigationDelegate = adoptNS([[NavigationTestDelegate alloc] init]); >- auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); >- [webView setNavigationDelegate:navigationDelegate.get()]; >- [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://127.0.0.1:%d/", server.port()]]]]; >- [navigationDelegate waitForDidFinishNavigation]; >- >- __block bool done = false; >- [websiteDataStore fetchDataRecordsOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] completionHandler:^(NSArray<WKWebsiteDataRecord *> *dataRecords) { >- int credentialCount = dataRecords.count; >- ASSERT_GT(credentialCount, 0); >- bool foundExpectedRecord = false; >- for (WKWebsiteDataRecord *record in dataRecords) { >- auto name = [record displayName]; >- if ([name isEqualToString:@"127.0.0.1"]) { >- foundExpectedRecord = true; >- break; >- } >- } >- EXPECT_TRUE(foundExpectedRecord); >- done = true; >- }]; >- TestWebKitAPI::Util::run(&done); >- >- __block bool removedCredential = false; >- [websiteDataStore fetchDataRecordsOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] completionHandler:^(NSArray<WKWebsiteDataRecord *> *dataRecords) { >- [websiteDataStore removeDataOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] forDataRecords:dataRecords completionHandler:^(void) { >- removedCredential = true; >- }]; >- }]; >- TestWebKitAPI::Util::run(&removedCredential); >-} >- >-TEST(WKWebsiteDataStore, RemovePersistentCredentials) > { > TCPServer server(TCPServer::respondWithChallengeThenOK); > >@@ -187,39 +149,9 @@ TEST(WKWebsiteDataStore, RemovePersistentCredentials) > [navigationDelegate waitForDidFinishNavigation]; > > __block bool done = false; >- __block RetainPtr<WKWebsiteDataRecord> expectedRecord; > [websiteDataStore fetchDataRecordsOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] completionHandler:^(NSArray<WKWebsiteDataRecord *> *dataRecords) { > int credentialCount = dataRecords.count; >- ASSERT_GT(credentialCount, 0); >- for (WKWebsiteDataRecord *record in dataRecords) { >- auto name = [record displayName]; >- if ([name isEqualToString:@"127.0.0.1"]) { >- expectedRecord = record; >- break; >- } >- } >- EXPECT_TRUE(expectedRecord); >- done = true; >- }]; >- TestWebKitAPI::Util::run(&done); >- >- done = false; >- [websiteDataStore removeDataOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] forDataRecords:[NSArray arrayWithObject:expectedRecord.get()] completionHandler:^(void) { >- done = true; >- }]; >- TestWebKitAPI::Util::run(&done); >- >- done = false; >- [websiteDataStore fetchDataRecordsOfTypes:[NSSet setWithObject:_WKWebsiteDataTypeCredentials] completionHandler:^(NSArray<WKWebsiteDataRecord *> *dataRecords) { >- bool foundLocalHostRecord = false; >- for (WKWebsiteDataRecord *record in dataRecords) { >- auto name = [record displayName]; >- if ([name isEqualToString:@"127.0.0.1"]) { >- foundLocalHostRecord = true; >- break; >- } >- } >- EXPECT_FALSE(foundLocalHostRecord); >+ EXPECT_EQ(credentialCount, 0); > done = true; > }]; > TestWebKitAPI::Util::run(&done);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199385
:
373275
|
373281
|
373307
|
373310
|
373328
|
373436
|
373591
|
373722