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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 874603004: Remove HasAlternateProtocol(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor. Created 5 years, 11 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 | net/http/http_server_properties.h » ('j') | net/http/http_server_properties_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 1c7039315e4d1b4e5bb3fb408defbbdd4bc307ec..c3eab76249d5843bb394a81b8e4cbe5c299befad 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -8508,8 +8508,9 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
HostPortPair http_host_port_pair("www.google.com", 80);
HttpServerProperties& http_server_properties =
*session->http_server_properties();
- EXPECT_FALSE(
- http_server_properties.HasAlternateProtocol(http_host_port_pair));
+ AlternateProtocolInfo alternate =
+ http_server_properties.GetAlternateProtocol(http_host_port_pair);
+ EXPECT_EQ(alternate.protocol, UNINITIALIZED_ALTERNATE_PROTOCOL);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -8524,12 +8525,10 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
EXPECT_EQ("hello world", response_data);
- ASSERT_TRUE(http_server_properties.HasAlternateProtocol(http_host_port_pair));
- const AlternateProtocolInfo alternate =
- http_server_properties.GetAlternateProtocol(http_host_port_pair);
- AlternateProtocolInfo expected_alternate(
- 443, AlternateProtocolFromNextProto(GetParam()), 1);
- EXPECT_TRUE(expected_alternate.Equals(alternate));
+ alternate = http_server_properties.GetAlternateProtocol(http_host_port_pair);
+ EXPECT_EQ(443, alternate.port);
+ EXPECT_EQ(AlternateProtocolFromNextProto(GetParam()), alternate.protocol);
+ EXPECT_EQ(1.0, alternate.probability);
}
TEST_P(HttpNetworkTransactionTest,
@@ -8583,11 +8582,10 @@ TEST_P(HttpNetworkTransactionTest,
ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
EXPECT_EQ("hello world", response_data);
- ASSERT_TRUE(http_server_properties->HasAlternateProtocol(
- HostPortPair::FromURL(request.url)));
const AlternateProtocolInfo alternate =
http_server_properties->GetAlternateProtocol(
HostPortPair::FromURL(request.url));
+ EXPECT_NE(UNINITIALIZED_ALTERNATE_PROTOCOL, alternate.protocol);
EXPECT_TRUE(alternate.is_broken);
}
« no previous file with comments | « no previous file | net/http/http_server_properties.h » ('j') | net/http/http_server_properties_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698