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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 1029633002: Add test for canonical host alternative service. (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 d4fc212f65bd6b6a3554b6fa5ca94a7a6047bc37..a9463b815f6df1b4e57b7b1880e9bd3457280d27 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -445,6 +445,23 @@ TEST_F(AlternateProtocolServerPropertiesTest, Canonical) {
impl_.GetCanonicalSuffix(canonical_port_pair.host()));
}
+TEST_F(AlternateProtocolServerPropertiesTest, CanonicalDefaultHost) {
+ HostPortPair test_host_port_pair("foo.c.youtube.com", 80);
+ EXPECT_FALSE(HasAlternativeService(test_host_port_pair));
+
+ HostPortPair canonical_port_pair("bar.c.youtube.com", 80);
+ EXPECT_FALSE(HasAlternativeService(canonical_port_pair));
+
+ AlternativeService canonical_altsvc(QUIC, "", 1234);
+ impl_.SetAlternativeService(canonical_port_pair, canonical_altsvc, 1.0);
+ ASSERT_TRUE(HasAlternativeService(test_host_port_pair));
+ const AlternativeService alternative_service =
+ impl_.GetAlternativeService(test_host_port_pair);
+ EXPECT_EQ(canonical_altsvc.protocol, alternative_service.protocol);
+ EXPECT_EQ(test_host_port_pair.host(), alternative_service.host);
Ryan Hamilton 2015/03/23 20:48:07 This is great! Nice. That being said, I'm astound
+ EXPECT_EQ(canonical_altsvc.port, alternative_service.port);
+}
+
TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBelowThreshold) {
impl_.SetAlternateProtocolProbabilityThreshold(0.02);
« 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