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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 1205633002: Set alternative service even if it is broken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-add Patch Set 1. See tests passing in trybot output. Created 5 years, 6 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
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698