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

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: Rebase and nits. 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
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.h » ('j') | 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 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.
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698