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

Unified Diff: net/http/http_server_properties_manager_unittest.cc

Issue 665083009: ABANDONED Handle multiple AlternateProtocols for each HostPortPair. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 db58c920752d1f853a99d8a6e50172741f18e3ac..fdcb07d9983cff11f95916ff58722e61ea845a3a 100644
--- a/net/http/http_server_properties_manager_unittest.cc
+++ b/net/http/http_server_properties_manager_unittest.cc
@@ -219,15 +219,17 @@ TEST_F(HttpServerPropertiesManagerTest,
net::HostPortPair::FromString("www.google.com:80")));
ASSERT_TRUE(http_server_props_manager_->HasAlternateProtocol(
net::HostPortPair::FromString("mail.google.com:80")));
- net::AlternateProtocolInfo port_alternate_protocol =
+ net::AlternateProtocols port_alternate_protocols =
http_server_props_manager_->GetAlternateProtocol(
net::HostPortPair::FromString("www.google.com:80"));
- EXPECT_EQ(443, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocol.protocol);
- port_alternate_protocol = http_server_props_manager_->GetAlternateProtocol(
+ ASSERT_EQ(1u, port_alternate_protocols.size());
+ EXPECT_EQ(443, port_alternate_protocols[0].port);
+ EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocols[0].protocol);
+ port_alternate_protocols = http_server_props_manager_->GetAlternateProtocol(
net::HostPortPair::FromString("mail.google.com:80"));
- EXPECT_EQ(444, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_3_1, port_alternate_protocol.protocol);
+ ASSERT_EQ(1u, port_alternate_protocols.size());
+ EXPECT_EQ(444, port_alternate_protocols[0].port);
+ EXPECT_EQ(net::NPN_SPDY_3_1, port_alternate_protocols[0].protocol);
// Verify SupportsQuic.
net::SupportsQuic supports_quic2 =
@@ -366,7 +368,7 @@ TEST_F(HttpServerPropertiesManagerTest, HasAlternateProtocol) {
net::HostPortPair spdy_server_mail("mail.google.com", 80);
EXPECT_FALSE(
http_server_props_manager_->HasAlternateProtocol(spdy_server_mail));
- http_server_props_manager_->SetAlternateProtocol(
+ http_server_props_manager_->AddAlternateProtocol(
spdy_server_mail, 443, net::NPN_SPDY_3, 1);
// Run the task.
@@ -375,10 +377,11 @@ TEST_F(HttpServerPropertiesManagerTest, HasAlternateProtocol) {
ASSERT_TRUE(
http_server_props_manager_->HasAlternateProtocol(spdy_server_mail));
- net::AlternateProtocolInfo port_alternate_protocol =
+ net::AlternateProtocols port_alternate_protocols =
http_server_props_manager_->GetAlternateProtocol(spdy_server_mail);
- EXPECT_EQ(443, port_alternate_protocol.port);
- EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocol.protocol);
+ ASSERT_EQ(1u, port_alternate_protocols.size());
+ EXPECT_EQ(443, port_alternate_protocols[0].port);
+ EXPECT_EQ(net::NPN_SPDY_3, port_alternate_protocols[0].protocol);
}
TEST_F(HttpServerPropertiesManagerTest, SupportsQuic) {
@@ -406,7 +409,7 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
net::HostPortPair spdy_server_mail("mail.google.com", 443);
http_server_props_manager_->SetSupportsSpdy(spdy_server_mail, true);
- http_server_props_manager_->SetAlternateProtocol(
+ http_server_props_manager_->AddAlternateProtocol(
spdy_server_mail, 443, net::NPN_SPDY_3, 1);
http_server_props_manager_->SetSupportsQuic(spdy_server_mail, true, "foo");

Powered by Google App Engine
This is Rietveld 408576698