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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 892203004: Make HttpServerProperties::GetSupportsQuic not host-specific. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: net/http/http_server_properties_impl_unittest.cc
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index be5e6b9af1f5e6264505d867e9d0f31d13be6d24..7ac8bb62375aa51d96c9e93a0f6c588e9ece4b5a 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -695,37 +695,37 @@ typedef HttpServerPropertiesImplTest SupportsQuicServerPropertiesTest;
TEST_F(SupportsQuicServerPropertiesTest, Initialize) {
HostPortPair quic_server_google("www.google.com", 443);
- // Check by initializing empty SupportsQuic.
- SupportsQuicMap supports_quic_map;
- impl_.InitializeSupportsQuic(&supports_quic_map);
- SupportsQuic supports_quic = impl_.GetSupportsQuic(quic_server_google);
- EXPECT_FALSE(supports_quic.used_quic);
- EXPECT_EQ("", supports_quic.address);
+ // Check by initializing empty address.
+ IPAddressNumber initial_address;
+ impl_.InitializeSupportsQuic(&initial_address);
- // Check by initializing with www.google.com:443.
- SupportsQuic supports_quic1(true, "foo");
- supports_quic_map.insert(std::make_pair(quic_server_google, supports_quic1));
- impl_.InitializeSupportsQuic(&supports_quic_map);
+ IPAddressNumber address;
+ EXPECT_FALSE(impl_.GetSupportsQuic(&address));
+ EXPECT_TRUE(address.empty());
+
+ // Check by initializing with a valid address.
+ CHECK(ParseIPLiteralToNumber("127.0.0.1", &initial_address));
+ impl_.InitializeSupportsQuic(&initial_address);
- SupportsQuic supports_quic2 = impl_.GetSupportsQuic(quic_server_google);
- EXPECT_TRUE(supports_quic2.used_quic);
- EXPECT_EQ("foo", supports_quic2.address);
+ EXPECT_TRUE(impl_.GetSupportsQuic(&address));
+ EXPECT_EQ(initial_address, address);
}
TEST_F(SupportsQuicServerPropertiesTest, SetSupportsQuic) {
- HostPortPair test_host_port_pair("foo", 80);
- SupportsQuic supports_quic = impl_.GetSupportsQuic(test_host_port_pair);
- EXPECT_FALSE(supports_quic.used_quic);
- EXPECT_EQ("", supports_quic.address);
- impl_.SetSupportsQuic(test_host_port_pair, true, "foo");
- SupportsQuic supports_quic1 = impl_.GetSupportsQuic(test_host_port_pair);
- EXPECT_TRUE(supports_quic1.used_quic);
- EXPECT_EQ("foo", supports_quic1.address);
+ IPAddressNumber address;
+ EXPECT_FALSE(impl_.GetSupportsQuic(&address));
+ EXPECT_TRUE(address.empty());
+
+ IPAddressNumber actual_address;
+ CHECK(ParseIPLiteralToNumber("127.0.0.1", &actual_address));
+ impl_.SetSupportsQuic(true, actual_address);
+
+ EXPECT_TRUE(impl_.GetSupportsQuic(&address));
+ EXPECT_EQ(actual_address, address);
impl_.Clear();
- SupportsQuic supports_quic2 = impl_.GetSupportsQuic(test_host_port_pair);
- EXPECT_FALSE(supports_quic2.used_quic);
- EXPECT_EQ("", supports_quic2.address);
+
+ EXPECT_FALSE(impl_.GetSupportsQuic(&address));
}
typedef HttpServerPropertiesImplTest ServerNetworkStatsServerPropertiesTest;

Powered by Google App Engine
This is Rietveld 408576698