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

Unified Diff: net/http/http_server_properties_impl_unittest.cc

Issue 701163002: Introduce AlternateProtocolInfo.is_broken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lint. Created 6 years, 1 month 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 a23ebbed89b2aa5f084914cd449d7f29cad78432..3f364d392bdf7402a2c85fe0e742c9de1796d0e8 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -292,13 +292,11 @@ TEST_F(AlternateProtocolServerPropertiesTest, Initialize) {
AlternateProtocolMap alternate_protocol_map(
AlternateProtocolMap::NO_AUTO_EVICT);
- AlternateProtocolInfo port_alternate_protocol_pair(123, NPN_SPDY_3, 1);
- alternate_protocol_map.Put(test_host_port_pair2,
- port_alternate_protocol_pair);
+ AlternateProtocolInfo alternate(123, NPN_SPDY_3, 1);
+ alternate_protocol_map.Put(test_host_port_pair2, alternate);
HostPortPair test_host_port_pair3("foo3", 80);
- port_alternate_protocol_pair.port = 1234;
- alternate_protocol_map.Put(test_host_port_pair3,
- port_alternate_protocol_pair);
+ alternate.port = 1234;
+ alternate_protocol_map.Put(test_host_port_pair3, alternate);
impl_.InitializeAlternateProtocolServers(&alternate_protocol_map);
// Verify test_host_port_pair3 is the MRU server.
@@ -311,13 +309,11 @@ TEST_F(AlternateProtocolServerPropertiesTest, Initialize) {
ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair1));
ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair2));
- port_alternate_protocol_pair =
- impl_.GetAlternateProtocol(test_host_port_pair1);
- EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, port_alternate_protocol_pair.protocol);
- port_alternate_protocol_pair =
- impl_.GetAlternateProtocol(test_host_port_pair2);
- EXPECT_EQ(123, port_alternate_protocol_pair.port);
- EXPECT_EQ(NPN_SPDY_3, port_alternate_protocol_pair.protocol);
+ alternate = impl_.GetAlternateProtocol(test_host_port_pair1);
+ EXPECT_TRUE(alternate.is_broken);
+ alternate = impl_.GetAlternateProtocol(test_host_port_pair2);
+ EXPECT_EQ(123, alternate.port);
+ EXPECT_EQ(NPN_SPDY_3, alternate.protocol);
}
TEST_F(AlternateProtocolServerPropertiesTest, MRUOfHasAlternateProtocol) {
@@ -369,7 +365,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) {
ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair));
AlternateProtocolInfo alternate =
impl_.GetAlternateProtocol(test_host_port_pair);
- EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol);
+ EXPECT_TRUE(alternate.is_broken);
impl_.SetAlternateProtocol(
test_host_port_pair,
@@ -377,7 +373,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, SetBroken) {
NPN_SPDY_3,
1);
alternate = impl_.GetAlternateProtocol(test_host_port_pair);
- EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol)
+ EXPECT_TRUE(alternate.is_broken)
<< "Second attempt should be ignored.";
Ryan Hamilton 2014/11/05 17:05:20 nit: can this fit on one line?
Bence 2014/11/06 00:26:00 Sorry, git cl format is broken on my machine. Don
}
@@ -387,7 +383,7 @@ TEST_F(AlternateProtocolServerPropertiesTest, ClearBroken) {
ASSERT_TRUE(impl_.HasAlternateProtocol(test_host_port_pair));
AlternateProtocolInfo alternate =
impl_.GetAlternateProtocol(test_host_port_pair);
- EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol);
+ EXPECT_TRUE(alternate.is_broken);
impl_.ClearAlternateProtocol(test_host_port_pair);
EXPECT_FALSE(impl_.HasAlternateProtocol(test_host_port_pair));
}

Powered by Google App Engine
This is Rietveld 408576698