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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 1878273004: SHP 3: Change ServerNetworkStatsMap to use SchemeHostPort as the key. No change to Pref data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 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/http/http_server_properties_manager.cc ('k') | net/quic/quic_stream_factory.cc » ('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 2f6b34d91003c5573f8c6acd9f0f5e8439ebc7bd..7d50be24225287960c7530509aca57f9ed6fec5e 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -411,10 +411,11 @@ TEST_P(HttpServerPropertiesManagerTest,
// Verify ServerNetworkStats.
const ServerNetworkStats* stats2 =
- http_server_props_manager_->GetServerNetworkStats(google_server);
+ http_server_props_manager_->GetServerNetworkStats(
+ google_scheme_host_port);
EXPECT_EQ(10, stats2->srtt.ToInternalValue());
const ServerNetworkStats* stats3 =
- http_server_props_manager_->GetServerNetworkStats(mail_server);
+ http_server_props_manager_->GetServerNetworkStats(mail_scheme_host_port);
EXPECT_EQ(20, stats3->srtt.ToInternalValue());
// Verify QuicServerInfo.
@@ -507,7 +508,7 @@ TEST_P(HttpServerPropertiesManagerTest, BadCachedHostPortPair) {
HasAlternativeService(HostPortPair::FromString("www.google.com:65536")));
const ServerNetworkStats* stats1 =
http_server_props_manager_->GetServerNetworkStats(
- HostPortPair::FromString("www.google.com:65536"));
+ google_scheme_host_port);
EXPECT_EQ(nullptr, stats1);
EXPECT_EQ(0u, http_server_props_manager_->quic_server_info_map().size());
}
@@ -850,7 +851,7 @@ TEST_P(HttpServerPropertiesManagerTest, ServerNetworkStats) {
ExpectPrefsUpdate();
ExpectScheduleUpdatePrefsOnNetworkThread();
- HostPortPair mail_server("mail.google.com", 80);
+ url::SchemeHostPort mail_server("http", "mail.google.com", 80);
const ServerNetworkStats* stats =
http_server_props_manager_->GetServerNetworkStats(mail_server);
EXPECT_EQ(nullptr, stats);
@@ -905,7 +906,7 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
http_server_props_manager_->SetSupportsQuic(true, actual_address);
ServerNetworkStats stats;
stats.srtt = base::TimeDelta::FromMicroseconds(10);
- http_server_props_manager_->SetServerNetworkStats(spdy_server_mail, stats);
+ http_server_props_manager_->SetServerNetworkStats(spdy_server, stats);
QuicServerId mail_quic_server_id("mail.google.com", 80);
std::string quic_server_info1("quic_server_info1");
@@ -926,7 +927,7 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
EXPECT_TRUE(http_server_props_manager_->GetSupportsQuic(&address));
EXPECT_EQ(actual_address, address);
const ServerNetworkStats* stats1 =
- http_server_props_manager_->GetServerNetworkStats(spdy_server_mail);
+ http_server_props_manager_->GetServerNetworkStats(spdy_server);
EXPECT_EQ(10, stats1->srtt.ToInternalValue());
EXPECT_EQ(quic_server_info1, *http_server_props_manager_->GetQuicServerInfo(
mail_quic_server_id));
@@ -954,7 +955,7 @@ TEST_P(HttpServerPropertiesManagerTest, Clear) {
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
EXPECT_FALSE(http_server_props_manager_->GetSupportsQuic(&address));
const ServerNetworkStats* stats2 =
- http_server_props_manager_->GetServerNetworkStats(spdy_server_mail);
+ http_server_props_manager_->GetServerNetworkStats(spdy_server);
EXPECT_EQ(nullptr, stats2);
EXPECT_EQ(nullptr,
http_server_props_manager_->GetQuicServerInfo(mail_quic_server_id));
@@ -1052,7 +1053,7 @@ TEST_P(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
ExpectScheduleUpdatePrefsOnNetworkThreadRepeatedly();
const HostPortPair server_www("www.google.com", 80);
- const HostPortPair server_mail("mail.google.com", 80);
+ const url::SchemeHostPort server_mail("http", "mail.google.com", 80);
// Set alternate protocol.
AlternativeServiceInfoVector alternative_service_info_vector;
@@ -1074,7 +1075,8 @@ TEST_P(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
444);
base::Time expiration3 = base::Time::Max();
http_server_props_manager_->SetAlternativeService(
- server_mail, mail_alternative_service, expiration3);
+ HostPortPair(server_mail.host(), server_mail.port()),
+ mail_alternative_service, expiration3);
// Set ServerNetworkStats.
ServerNetworkStats stats;
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698