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 |