X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnet%2Fhttp%2Fhttp_server_properties_impl_unittest.cc;h=fab73705e505386fc08221e9acb8b51efac40806;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=cf3a4643f9dc5b9d89bf7553165c8b263f806267;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/net/http/http_server_properties_impl_unittest.cc b/src/net/http/http_server_properties_impl_unittest.cc index cf3a464..fab7370 100644 --- a/src/net/http/http_server_properties_impl_unittest.cc +++ b/src/net/http/http_server_properties_impl_unittest.cc @@ -273,6 +273,28 @@ TEST_F(AlternateProtocolServerPropertiesTest, Forced) { EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair2)); } +TEST_F(AlternateProtocolServerPropertiesTest, Canonical) { + HostPortPair test_host_port_pair("foo.c.youtube.com", 80); + EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair)); + + HostPortPair canonical_port_pair("bar.c.youtube.com", 80); + EXPECT_FALSE(impl_.HasAlternateProtocol(canonical_port_pair)); + + PortAlternateProtocolPair canonical_protocol; + canonical_protocol.port = 1234; + canonical_protocol.protocol = QUIC; + + impl_.SetAlternateProtocol(canonical_port_pair, + canonical_protocol.port, + canonical_protocol.protocol); + // Verify the forced protocol. + ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair)); + PortAlternateProtocolPair alternate = + impl_.GetAlternateProtocol(test_host_port_pair); + EXPECT_EQ(canonical_protocol.port, alternate.port); + EXPECT_EQ(canonical_protocol.protocol, alternate.protocol); +} + typedef HttpServerPropertiesImplTest SpdySettingsServerPropertiesTest; TEST_F(SpdySettingsServerPropertiesTest, Initialize) {