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

Unified Diff: net/filter/sdch_filter_unittest.cc

Issue 342523002: First pass at mobile (and other) SDCH limit revisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests to run correctly with single dictionary limit. 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
« no previous file with comments | « 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/filter/sdch_filter_unittest.cc
diff --git a/net/filter/sdch_filter_unittest.cc b/net/filter/sdch_filter_unittest.cc
index 16012c3edcc13b71da2ebbc5b066159da95f9b5f..28da615c2e90bedd4b5c01dadf6ade807f8576f6 100644
--- a/net/filter/sdch_filter_unittest.cc
+++ b/net/filter/sdch_filter_unittest.cc
@@ -394,12 +394,15 @@ TEST_F(SdchFilterTest, DictionaryAddOnce) {
const std::string kSampleDomain2 = "sdchtest2.com";
- // Construct a second SDCH dictionary from a VCDIFF dictionary.
- std::string dictionary2(NewSdchDictionary(kSampleDomain2));
-
- std::string url_string2 = "http://" + kSampleDomain2;
- GURL url2(url_string2);
- EXPECT_TRUE(sdch_manager_->AddSdchDictionary(dictionary2, url2));
+ // Don't test adding a second dictionary if our limits are tight.
+ if (SdchManager::kMaxDictionaryCount > 1) {
+ // Construct a second SDCH dictionary from a VCDIFF dictionary.
+ std::string dictionary2(NewSdchDictionary(kSampleDomain2));
+
+ std::string url_string2 = "http://" + kSampleDomain2;
+ GURL url2(url_string2);
+ EXPECT_TRUE(sdch_manager_->AddSdchDictionary(dictionary2, url2));
+ }
}
TEST_F(SdchFilterTest, BasicDictionary) {
@@ -634,6 +637,11 @@ TEST_F(SdchFilterTest, CrossDomainDictionaryUse) {
}
TEST_F(SdchFilterTest, DictionaryPathValidation) {
+ // Can't test path distinction between dictionaries if we aren't allowed
+ // more than one dictionary.
+ if (SdchManager::kMaxDictionaryCount <= 1)
+ return;
+
// Construct a valid SDCH dictionary from a VCDIFF dictionary.
const std::string kSampleDomain = "sdchtest.com";
std::string dictionary(NewSdchDictionary(kSampleDomain));
@@ -683,6 +691,11 @@ TEST_F(SdchFilterTest, DictionaryPathValidation) {
}
TEST_F(SdchFilterTest, DictionaryPortValidation) {
+ // Can't test port distinction between dictionaries if we aren't allowed
+ // more than one dictionary.
+ if (SdchManager::kMaxDictionaryCount <= 1)
+ return;
+
// Construct a valid SDCH dictionary from a VCDIFF dictionary.
const std::string kSampleDomain = "sdchtest.com";
std::string dictionary(NewSdchDictionary(kSampleDomain));
« no previous file with comments | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698