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

Unified Diff: net/base/sdch_manager_unittest.cc

Issue 1051933002: Split SdchManager::Dictionary out into separate class/file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated comments. Created 5 years, 8 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
« no previous file with comments | « net/base/sdch_manager.cc ('k') | net/filter/sdch_filter.h » ('j') | 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 2a08d468a077bdcd62f44d26af1532fddc90b7cd..e42a4d2bb8ef38ba6f0f76e6f49380ae2b5a0fc5 100644
--- a/net/base/sdch_manager_unittest.cc
+++ b/net/base/sdch_manager_unittest.cc
@@ -419,46 +419,6 @@ TEST_F(SdchManagerTest, CanStillSetExactMatchDictionary) {
GURL("http://" + dictionary_domain)));
}
-TEST_F(SdchManagerTest, PathMatch) {
- bool (*PathMatch)(const std::string& path, const std::string& restriction) =
- SdchManager::Dictionary::PathMatch;
- // Perfect match is supported.
- EXPECT_TRUE(PathMatch("/search", "/search"));
- EXPECT_TRUE(PathMatch("/search/", "/search/"));
-
- // Prefix only works if last character of restriction is a slash, or first
- // character in path after a match is a slash. Validate each case separately.
-
- // Rely on the slash in the path (not at the end of the restriction).
- EXPECT_TRUE(PathMatch("/search/something", "/search"));
- EXPECT_TRUE(PathMatch("/search/s", "/search"));
- EXPECT_TRUE(PathMatch("/search/other", "/search"));
- EXPECT_TRUE(PathMatch("/search/something", "/search"));
-
- // Rely on the slash at the end of the restriction.
- EXPECT_TRUE(PathMatch("/search/something", "/search/"));
- EXPECT_TRUE(PathMatch("/search/s", "/search/"));
- EXPECT_TRUE(PathMatch("/search/other", "/search/"));
- EXPECT_TRUE(PathMatch("/search/something", "/search/"));
-
- // Make sure less that sufficient prefix match is false.
- EXPECT_FALSE(PathMatch("/sear", "/search"));
- EXPECT_FALSE(PathMatch("/", "/search"));
- EXPECT_FALSE(PathMatch(std::string(), "/search"));
-
- // Add examples with several levels of direcories in the restriction.
- EXPECT_FALSE(PathMatch("/search/something", "search/s"));
- EXPECT_FALSE(PathMatch("/search/", "/search/s"));
-
- // Make sure adding characters to path will also fail.
- EXPECT_FALSE(PathMatch("/searching", "/search/"));
- EXPECT_FALSE(PathMatch("/searching", "/search"));
-
- // Make sure we're case sensitive.
- EXPECT_FALSE(PathMatch("/ABC", "/abc"));
- EXPECT_FALSE(PathMatch("/abc", "/ABC"));
-}
-
// The following are only applicable while we have a latency test in the code,
// and can be removed when that functionality is stripped.
TEST_F(SdchManagerTest, LatencyTestControls) {
@@ -636,9 +596,8 @@ TEST_F(SdchManagerTest, ExpirationCheckedProperly) {
target_gurl, server_hash, &problem_code).Pass());
ASSERT_TRUE(hash_set);
ASSERT_EQ(SDCH_OK, problem_code);
- const_cast<SdchManager::Dictionary*>(
- hash_set->GetDictionary(server_hash))->SetClockForTesting(
- clock.Pass());
+ const_cast<SdchDictionary*>(hash_set->GetDictionary(server_hash))
+ ->SetClockForTesting(clock.Pass());
// Make sure it's not visible for advertisement, but is visible
// if looked up by hash.
« no previous file with comments | « net/base/sdch_manager.cc ('k') | net/filter/sdch_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698