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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1017453008: Make GetAlternateProtocol return AlternativeService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. 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 | net/http/http_server_properties.h » ('j') | net/http/http_server_properties.h » ('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 105b30dbcd79229ff0ab06afcb60188cec933ae8..8f89e416d9e47f870f8f6bdda49c4a505a9efa13 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -8734,9 +8734,9 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
HostPortPair http_host_port_pair("www.google.com", 80);
HttpServerProperties& http_server_properties =
*session->http_server_properties();
- AlternateProtocolInfo alternate =
- http_server_properties.GetAlternateProtocol(http_host_port_pair);
- EXPECT_EQ(alternate.protocol, UNINITIALIZED_ALTERNATE_PROTOCOL);
+ AlternativeService alternative_service =
+ http_server_properties.GetAlternativeService(http_host_port_pair);
+ EXPECT_EQ(alternative_service.protocol, UNINITIALIZED_ALTERNATE_PROTOCOL);
EXPECT_EQ(OK, callback.WaitForResult());
@@ -8751,10 +8751,11 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
EXPECT_EQ("hello world", response_data);
- 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);
+ alternative_service =
+ http_server_properties.GetAlternativeService(http_host_port_pair);
+ EXPECT_EQ(443, alternative_service.port);
+ EXPECT_EQ(AlternateProtocolFromNextProto(GetParam()),
+ alternative_service.protocol);
}
TEST_P(HttpNetworkTransactionTest,
@@ -8808,11 +8809,9 @@ TEST_P(HttpNetworkTransactionTest,
ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
EXPECT_EQ("hello world", response_data);
- const AlternateProtocolInfo alternate =
- http_server_properties->GetAlternateProtocol(host_port_pair);
- EXPECT_NE(UNINITIALIZED_ALTERNATE_PROTOCOL, alternate.protocol);
- const AlternativeService alternative_service(
- alternate.protocol, host_port_pair.host(), alternate.port);
+ const AlternativeService alternative_service =
+ http_server_properties->GetAlternativeService(host_port_pair);
+ EXPECT_NE(UNINITIALIZED_ALTERNATE_PROTOCOL, alternative_service.protocol);
EXPECT_TRUE(
http_server_properties->IsAlternativeServiceBroken(alternative_service));
}
« no previous file with comments | « no previous file | net/http/http_server_properties.h » ('j') | net/http/http_server_properties.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698