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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 989273005: Add MarkAlternativeServiceRecentlyBroken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 ae6302b52c32ab3b6a7d62594b9b319e27cda1fc..cb414a586ff2f4cb930122bade432f580f89fc97 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -349,6 +349,23 @@ TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) {
EXPECT_FALSE(impl_.IsAlternativeServiceBroken(alternative_service));
}
+TEST_F(AlternateProtocolServerPropertiesTest, MarkRecentlyBroken) {
+ HostPortPair host_port_pair("foo", 80);
+ impl_.SetAlternateProtocol(host_port_pair, 443, NPN_SPDY_4, 1.0);
+
+ const AlternativeService alternative_service(NPN_SPDY_4, "foo", 443);
+ EXPECT_FALSE(impl_.IsAlternativeServiceBroken(alternative_service));
+ EXPECT_FALSE(impl_.WasAlternateProtocolRecentlyBroken(host_port_pair));
+
+ impl_.MarkAlternativeServiceRecentlyBroken(alternative_service);
+ EXPECT_FALSE(impl_.IsAlternativeServiceBroken(alternative_service));
+ EXPECT_TRUE(impl_.WasAlternateProtocolRecentlyBroken(host_port_pair));
+
+ impl_.ConfirmAlternateProtocol(host_port_pair);
+ EXPECT_FALSE(impl_.IsAlternativeServiceBroken(alternative_service));
+ EXPECT_FALSE(impl_.WasAlternateProtocolRecentlyBroken(host_port_pair));
+}
+
TEST_F(AlternateProtocolServerPropertiesTest, Forced) {
// Test forced alternate protocols.

Powered by Google App Engine
This is Rietveld 408576698