Chromium Code Reviews| 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 d4fc212f65bd6b6a3554b6fa5ca94a7a6047bc37..a9463b815f6df1b4e57b7b1880e9bd3457280d27 100644 |
| --- a/net/http/http_server_properties_impl_unittest.cc |
| +++ b/net/http/http_server_properties_impl_unittest.cc |
| @@ -445,6 +445,23 @@ TEST_F(AlternateProtocolServerPropertiesTest, Canonical) { |
| impl_.GetCanonicalSuffix(canonical_port_pair.host())); |
| } |
| +TEST_F(AlternateProtocolServerPropertiesTest, CanonicalDefaultHost) { |
| + HostPortPair test_host_port_pair("foo.c.youtube.com", 80); |
| + EXPECT_FALSE(HasAlternativeService(test_host_port_pair)); |
| + |
| + HostPortPair canonical_port_pair("bar.c.youtube.com", 80); |
| + EXPECT_FALSE(HasAlternativeService(canonical_port_pair)); |
| + |
| + AlternativeService canonical_altsvc(QUIC, "", 1234); |
| + impl_.SetAlternativeService(canonical_port_pair, canonical_altsvc, 1.0); |
| + ASSERT_TRUE(HasAlternativeService(test_host_port_pair)); |
| + const AlternativeService alternative_service = |
| + impl_.GetAlternativeService(test_host_port_pair); |
| + EXPECT_EQ(canonical_altsvc.protocol, alternative_service.protocol); |
| + EXPECT_EQ(test_host_port_pair.host(), alternative_service.host); |
|
Ryan Hamilton
2015/03/23 20:48:07
This is great! Nice.
That being said, I'm astound
|
| + EXPECT_EQ(canonical_altsvc.port, alternative_service.port); |
| +} |
| + |
| TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBelowThreshold) { |
| impl_.SetAlternateProtocolProbabilityThreshold(0.02); |