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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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/http/http_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 b7b9f4b81506744fc4caff66f339c7c574ff7441..1f999a92b13f9cde54cf637b1b6a364f9f4809e9 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -381,16 +381,16 @@
AlternativeServiceMap::const_iterator map_it = map.begin();
EXPECT_EQ("mail.google.com", map_it->first.host());
ASSERT_EQ(1u, map_it->second.size());
- EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol);
+ EXPECT_EQ(NPN_HTTP_2, map_it->second[0].alternative_service.protocol);
EXPECT_TRUE(map_it->second[0].alternative_service.host.empty());
EXPECT_EQ(444, map_it->second[0].alternative_service.port);
++map_it;
EXPECT_EQ("www.google.com", map_it->first.host());
ASSERT_EQ(2u, map_it->second.size());
- EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol);
+ EXPECT_EQ(NPN_HTTP_2, map_it->second[0].alternative_service.protocol);
EXPECT_TRUE(map_it->second[0].alternative_service.host.empty());
EXPECT_EQ(443, map_it->second[0].alternative_service.port);
- EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service.protocol);
+ EXPECT_EQ(QUIC, map_it->second[1].alternative_service.protocol);
EXPECT_TRUE(map_it->second[1].alternative_service.host.empty());
EXPECT_EQ(1234, map_it->second[1].alternative_service.port);
} else {
@@ -400,16 +400,16 @@
AlternativeServiceMap::const_iterator map_it = map.begin();
EXPECT_EQ("www.google.com", map_it->first.host());
ASSERT_EQ(2u, map_it->second.size());
- EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol);
+ EXPECT_EQ(NPN_HTTP_2, map_it->second[0].alternative_service.protocol);
EXPECT_TRUE(map_it->second[0].alternative_service.host.empty());
EXPECT_EQ(443, map_it->second[0].alternative_service.port);
- EXPECT_EQ(kProtoQUIC, map_it->second[1].alternative_service.protocol);
+ EXPECT_EQ(QUIC, map_it->second[1].alternative_service.protocol);
EXPECT_TRUE(map_it->second[1].alternative_service.host.empty());
EXPECT_EQ(1234, map_it->second[1].alternative_service.port);
++map_it;
EXPECT_EQ("mail.google.com", map_it->first.host());
ASSERT_EQ(1u, map_it->second.size());
- EXPECT_EQ(kProtoHTTP2, map_it->second[0].alternative_service.protocol);
+ EXPECT_EQ(NPN_HTTP_2, map_it->second[0].alternative_service.protocol);
EXPECT_TRUE(map_it->second[0].alternative_service.host.empty());
EXPECT_EQ(444, map_it->second[0].alternative_service.port);
}
@@ -714,7 +714,7 @@
url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
- const AlternativeService alternative_service(kProtoHTTP2, "mail.google.com",
+ const AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com",
443);
http_server_props_manager_->SetAlternativeService(
spdy_server_mail, alternative_service, one_day_from_now_);
@@ -739,12 +739,11 @@
url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
AlternativeServiceInfoVector alternative_service_info_vector;
- const AlternativeService alternative_service1(kProtoHTTP2, "mail.google.com",
+ const AlternativeService alternative_service1(NPN_HTTP_2, "mail.google.com",
443);
alternative_service_info_vector.push_back(
AlternativeServiceInfo(alternative_service1, one_day_from_now_));
- const AlternativeService alternative_service2(kProtoQUIC, "mail.google.com",
- 1234);
+ const AlternativeService alternative_service2(QUIC, "mail.google.com", 1234);
alternative_service_info_vector.push_back(
AlternativeServiceInfo(alternative_service2, one_day_from_now_));
http_server_props_manager_->SetAlternativeServices(
@@ -767,7 +766,7 @@
TEST_P(HttpServerPropertiesManagerTest, SetAlternativeServicesEmpty) {
url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
- const AlternativeService alternative_service(kProtoHTTP2, "mail.google.com",
+ const AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com",
443);
http_server_props_manager_->SetAlternativeServices(
spdy_server_mail, AlternativeServiceInfoVector());
@@ -785,7 +784,7 @@
url::SchemeHostPort spdy_server_mail("http", "mail.google.com", 80);
EXPECT_FALSE(HasAlternativeService(spdy_server_mail));
- AlternativeService alternative_service(kProtoHTTP2, "mail.google.com", 443);
+ AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 443);
ExpectScheduleUpdatePrefsOnNetworkThread();
http_server_props_manager_->SetAlternativeService(
@@ -897,7 +896,7 @@
url::SchemeHostPort spdy_server("https", "mail.google.com", 443);
http_server_props_manager_->SetSupportsSpdy(spdy_server, true);
- AlternativeService alternative_service(kProtoHTTP2, "mail.google.com", 1234);
+ AlternativeService alternative_service(NPN_HTTP_2, "mail.google.com", 1234);
http_server_props_manager_->SetAlternativeService(
spdy_server, alternative_service, one_day_from_now_);
IPAddress actual_address(127, 0, 0, 1);
@@ -1051,7 +1050,7 @@
AlternativeServiceVector alternative_service_vector =
http_server_props_manager_->GetAlternativeServices(server);
ASSERT_EQ(1u, alternative_service_vector.size());
- EXPECT_EQ(kProtoQUIC, alternative_service_vector[0].protocol);
+ EXPECT_EQ(QUIC, alternative_service_vector[0].protocol);
EXPECT_EQ(i, alternative_service_vector[0].port);
}
@@ -1069,12 +1068,12 @@
// Set alternate protocol.
AlternativeServiceInfoVector alternative_service_info_vector;
- AlternativeService www_alternative_service1(kProtoHTTP2, "", 443);
+ AlternativeService www_alternative_service1(NPN_HTTP_2, "", 443);
base::Time expiration1;
ASSERT_TRUE(base::Time::FromUTCString("2036-12-01 10:00:00", &expiration1));
alternative_service_info_vector.push_back(
AlternativeServiceInfo(www_alternative_service1, expiration1));
- AlternativeService www_alternative_service2(kProtoHTTP2, "www.google.com",
+ AlternativeService www_alternative_service2(NPN_HTTP_2, "www.google.com",
1234);
base::Time expiration2;
ASSERT_TRUE(base::Time::FromUTCString("2036-12-31 10:00:00", &expiration2));
@@ -1083,7 +1082,7 @@
http_server_props_manager_->SetAlternativeServices(
server_www, alternative_service_info_vector);
- AlternativeService mail_alternative_service(kProtoHTTP2, "foo.google.com",
+ AlternativeService mail_alternative_service(NPN_HTTP_2, "foo.google.com",
444);
base::Time expiration3 = base::Time::Max();
http_server_props_manager_->SetAlternativeService(
@@ -1157,7 +1156,7 @@
AlternativeServiceInfoVector alternative_service_info_vector = it->second;
ASSERT_EQ(3u, alternative_service_info_vector.size());
- EXPECT_EQ(kProtoHTTP2,
+ EXPECT_EQ(NPN_HTTP_2,
alternative_service_info_vector[0].alternative_service.protocol);
EXPECT_EQ("", alternative_service_info_vector[0].alternative_service.host);
EXPECT_EQ(443, alternative_service_info_vector[0].alternative_service.port);
@@ -1167,14 +1166,14 @@
EXPECT_LE(now + base::TimeDelta::FromHours(23), expiration);
EXPECT_GE(now + base::TimeDelta::FromDays(1), expiration);
- EXPECT_EQ(kProtoQUIC,
+ EXPECT_EQ(QUIC,
alternative_service_info_vector[1].alternative_service.protocol);
EXPECT_EQ("", alternative_service_info_vector[1].alternative_service.host);
EXPECT_EQ(123, alternative_service_info_vector[1].alternative_service.port);
// numeric_limits<int64_t>::max() represents base::Time::Max().
EXPECT_EQ(base::Time::Max(), alternative_service_info_vector[1].expiration);
- EXPECT_EQ(kProtoHTTP2,
+ EXPECT_EQ(NPN_HTTP_2,
alternative_service_info_vector[2].alternative_service.protocol);
EXPECT_EQ("example.org",
alternative_service_info_vector[2].alternative_service.host);
@@ -1211,7 +1210,7 @@
AlternativeServiceInfoVector alternative_service_info_vector;
const AlternativeService broken_alternative_service(
- kProtoHTTP2, "broken.example.com", 443);
+ NPN_HTTP_2, "broken.example.com", 443);
const base::Time time_one_day_later =
base::Time::Now() + base::TimeDelta::FromDays(1);
alternative_service_info_vector.push_back(
@@ -1220,13 +1219,13 @@
broken_alternative_service);
const AlternativeService expired_alternative_service(
- kProtoHTTP2, "expired.example.com", 443);
+ NPN_HTTP_2, "expired.example.com", 443);
const base::Time time_one_day_ago =
base::Time::Now() - base::TimeDelta::FromDays(1);
alternative_service_info_vector.push_back(
AlternativeServiceInfo(expired_alternative_service, time_one_day_ago));
- const AlternativeService valid_alternative_service(kProtoHTTP2,
+ const AlternativeService valid_alternative_service(NPN_HTTP_2,
"valid.example.com", 443);
alternative_service_info_vector.push_back(
AlternativeServiceInfo(valid_alternative_service, time_one_day_later));
@@ -1305,7 +1304,7 @@
AlternativeServiceInfoVector alternative_service_info_vector = it->second;
ASSERT_EQ(1u, alternative_service_info_vector.size());
- EXPECT_EQ(kProtoHTTP2,
+ EXPECT_EQ(NPN_HTTP_2,
alternative_service_info_vector[0].alternative_service.protocol);
EXPECT_EQ("valid.example.com",
alternative_service_info_vector[0].alternative_service.host);
« no previous file with comments | « net/http/http_server_properties_manager.cc ('k') | net/http/http_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698