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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 1006813015: Add unittest for canonical host override. (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
« no previous file with comments | « no previous file | 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 a9463b815f6df1b4e57b7b1880e9bd3457280d27..096be3b80fbbaa120696de18e97f5f03f7c41354 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -506,6 +506,22 @@ TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBroken) {
EXPECT_FALSE(HasAlternativeService(test_host_port_pair));
}
+// Adding an alternative service for a new host overrides canonical host.
+TEST_F(AlternateProtocolServerPropertiesTest, CanonicalOverride) {
+ HostPortPair test_host_port_pair("foo.c.youtube.com", 80);
+ HostPortPair bar_host_port_pair("bar.c.youtube.com", 80);
+ AlternativeService bar_alternative_service(QUIC, "bar.c.youtube.com", 1234);
+ impl_.SetAlternativeService(bar_host_port_pair, bar_alternative_service, 1.0);
+ AlternativeService altsvc = impl_.GetAlternativeService(test_host_port_pair);
+ EXPECT_EQ(1234, altsvc.port);
+
+ HostPortPair qux_host_port_pair("qux.c.youtube.com", 80);
+ AlternativeService qux_alternative_service(QUIC, "qux.c.youtube.com", 443);
+ impl_.SetAlternativeService(qux_host_port_pair, qux_alternative_service, 1.0);
+ altsvc = impl_.GetAlternativeService(test_host_port_pair);
+ EXPECT_EQ(443, altsvc.port);
+}
+
TEST_F(AlternateProtocolServerPropertiesTest, ClearWithCanonical) {
HostPortPair test_host_port_pair("foo.c.youtube.com", 80);
HostPortPair canonical_port_pair("bar.c.youtube.com", 80);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698