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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 1572753003: QUIC - Allow cronet apps to specify how many server configs are to be (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments in Patch set 4 Created 4 years, 11 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/http/http_server_properties_manager.cc ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager_unittest.cc
diff --git a/net/http/http_server_properties_manager_unittest.cc b/net/http/http_server_properties_manager_unittest.cc
index 4256ae42b48205c0bc8ed687aa5b7b1b9c23ee66..49d19db177e306d3377d214c93a3cde8ca51ac2b 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -276,7 +276,9 @@ TEST_P(HttpServerPropertiesManagerTest,
http_server_properties_dict->SetWithoutPathExpansion("supports_quic",
supports_quic);
- // Set quic_server_info for www.google.com:80 and mail.google.com:80.
+ // Set quic_server_info for www.google.com:80, mail.google.com:80 and
+ // play.google.com:80 and verify the MRU.
+ http_server_props_manager_->SetMaxServerConfigsStoredInProperties(3);
base::DictionaryValue* quic_servers_dict = new base::DictionaryValue;
base::DictionaryValue* quic_server_pref_dict1 = new base::DictionaryValue;
std::string quic_server_info1("quic_server_info1");
@@ -286,6 +288,10 @@ TEST_P(HttpServerPropertiesManagerTest,
std::string quic_server_info2("quic_server_info2");
quic_server_pref_dict2->SetStringWithoutPathExpansion("server_info",
quic_server_info2);
+ base::DictionaryValue* quic_server_pref_dict3 = new base::DictionaryValue;
+ std::string quic_server_info3("quic_server_info3");
+ quic_server_pref_dict3->SetStringWithoutPathExpansion("server_info",
+ quic_server_info3);
// Set the quic_server_info1 for www.google.com server.
QuicServerId google_quic_server_id("www.google.com", 80);
quic_servers_dict->SetWithoutPathExpansion(google_quic_server_id.ToString(),
@@ -294,6 +300,10 @@ TEST_P(HttpServerPropertiesManagerTest,
QuicServerId mail_quic_server_id("mail.google.com", 80);
quic_servers_dict->SetWithoutPathExpansion(mail_quic_server_id.ToString(),
quic_server_pref_dict2);
+ // Set the quic_server_info3 for play.google.com server.
+ QuicServerId play_quic_server_id("play.google.com", 80);
+ quic_servers_dict->SetWithoutPathExpansion(play_quic_server_id.ToString(),
+ quic_server_pref_dict3);
http_server_properties_dict->SetWithoutPathExpansion("quic_servers",
quic_servers_dict);
@@ -375,6 +385,17 @@ TEST_P(HttpServerPropertiesManagerTest,
google_quic_server_id));
EXPECT_EQ(quic_server_info2, *http_server_props_manager_->GetQuicServerInfo(
mail_quic_server_id));
+ EXPECT_EQ(quic_server_info3, *http_server_props_manager_->GetQuicServerInfo(
+ play_quic_server_id));
+
+ // Verify the MRU order.
+ http_server_props_manager_->SetMaxServerConfigsStoredInProperties(2);
+ EXPECT_EQ(nullptr, http_server_props_manager_->GetQuicServerInfo(
+ google_quic_server_id));
+ EXPECT_EQ(quic_server_info2, *http_server_props_manager_->GetQuicServerInfo(
+ mail_quic_server_id));
+ EXPECT_EQ(quic_server_info3, *http_server_props_manager_->GetQuicServerInfo(
+ play_quic_server_id));
}
TEST_P(HttpServerPropertiesManagerTest, BadCachedHostPortPair) {
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698