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 61584c722b41e2c4098c458d75e64e951f81adb6..2896d3ab32ad86d73c9edfccee8b3aada83396ab 100644 |
| --- a/net/http/http_server_properties_impl_unittest.cc |
| +++ b/net/http/http_server_properties_impl_unittest.cc |
| @@ -365,6 +365,20 @@ TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) { |
| EXPECT_EQ(1234, impl_.GetAlternativeService(test_host_port_pair).port); |
| } |
| +// A broken alternative service in the mapping carries meaningful information, |
| +// therefore it should not be ignored by SetAlternativeService(). |
| +TEST_F(AlternateProtocolServerPropertiesTest, AddBroken) { |
| + HostPortPair test_host_port_pair("foo", 80); |
| + ASSERT_FALSE(HasAlternativeService(test_host_port_pair)); |
| + |
| + const AlternativeService alternative_service(NPN_SPDY_4, "foo", 443); |
| + impl_.MarkAlternativeServiceBroken(alternative_service); |
| + EXPECT_TRUE(impl_.IsAlternativeServiceBroken(alternative_service)); |
| + |
| + impl_.SetAlternativeService(test_host_port_pair, alternative_service, 1.0); |
| + ASSERT_TRUE(HasAlternativeService(test_host_port_pair)); |
|
Ryan Hamilton
2015/06/24 18:55:21
What will GetAlternateService return? Does this te
Bence
2015/06/24 20:30:46
GetAlternativeService() will return alternative_se
|
| +} |
|
Ryan Hamilton
2015/06/24 18:55:21
Also, your CL comment mentions the interaction wit
Bence
2015/06/24 20:30:46
Good point. I combined the two tests into one, be
|
| + |
| TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) { |
| HostPortPair test_host_port_pair("foo", 80); |
| const AlternativeService alternative_service(NPN_SPDY_4, "foo", 443); |