Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: net/base/sdch_manager_unittest.cc

Issue 321283002: Clear SDCH information on "Clear browsing data" path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/base/sdch_manager.cc ('K') | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_manager_unittest.cc
diff --git a/net/base/sdch_manager_unittest.cc b/net/base/sdch_manager_unittest.cc
index 6684e4aa6637a5b94ebfc894831c4c69aadf5ab8..e89988b9c1d646f3b978bb2c993fc29cce60ef3d 100644
--- a/net/base/sdch_manager_unittest.cc
+++ b/net/base/sdch_manager_unittest.cc
@@ -441,5 +441,38 @@ TEST_F(SdchManagerTest, HttpsCorrectlySupported) {
EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(secure_url));
}
+TEST_F(SdchManagerTest, ClearDictionaryData) {
+ std::string dictionary_domain("x.y.z.google.com");
+ GURL blacklist_url("http://bad.chromium.org");
+
+ std::string dictionary_text(NewSdchDictionary(dictionary_domain));
+ std::string tmp_hash;
+ std::string server_hash;
+
+ SdchManager::GenerateHash(dictionary_text, &tmp_hash, &server_hash);
+
+ EXPECT_TRUE(sdch_manager()->AddSdchDictionary(
+ dictionary_text, GURL("http://" + dictionary_domain)));
+ SdchManager::Dictionary* dictionary = NULL;
+ sdch_manager()->GetVcdiffDictionary(
+ server_hash,
+ GURL("http://" + dictionary_domain + "/random_url"),
+ &dictionary);
+ EXPECT_TRUE(dictionary);
+
+ sdch_manager()->BlacklistDomain(GURL(blacklist_url));
+ EXPECT_FALSE(sdch_manager()->IsInSupportedDomain(blacklist_url));
+
+ sdch_manager()->ClearData();
jar (doing other things) 2014/06/17 05:48:55 This is probably the line of code that was critica
Randy Smith (Not in Mondays) 2014/06/17 18:33:11 Done.
+
+ dictionary = NULL;
+ sdch_manager()->GetVcdiffDictionary(
+ server_hash,
+ GURL("http://" + dictionary_domain + "/random_url"),
+ &dictionary);
+ EXPECT_FALSE(dictionary);
+ EXPECT_TRUE(sdch_manager()->IsInSupportedDomain(blacklist_url));
+}
+
} // namespace net
« net/base/sdch_manager.cc ('K') | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698