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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 339663010: Add a probability to Alternate-Protocol support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eliminate static initializer Created 6 years, 5 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 | « net/http/http_network_transaction.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »
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 ab64040df1ab4b3619e28f2bb584e17c1abd9688..8c078c4c1f158797ad4d8715d780b02e902750ca 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -7536,7 +7536,7 @@ scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests(
session->http_server_properties();
http_server_properties->SetAlternateProtocol(
HostPortPair("host.with.alternate", 80), 443,
- AlternateProtocolFromNextProto(next_proto));
+ AlternateProtocolFromNextProto(next_proto), 1);
return session;
}
@@ -8448,11 +8448,10 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
EXPECT_EQ("hello world", response_data);
ASSERT_TRUE(http_server_properties.HasAlternateProtocol(http_host_port_pair));
- const PortAlternateProtocolPair alternate =
+ const AlternateProtocolInfo alternate =
http_server_properties.GetAlternateProtocol(http_host_port_pair);
- PortAlternateProtocolPair expected_alternate;
- expected_alternate.port = 443;
- expected_alternate.protocol = AlternateProtocolFromNextProto(GetParam());
+ AlternateProtocolInfo expected_alternate(
+ 443, AlternateProtocolFromNextProto(GetParam()), 1);
EXPECT_TRUE(expected_alternate.Equals(alternate));
}
@@ -8488,7 +8487,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(request.url),
666 /* port is ignored by MockConnect anyway */,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8509,7 +8508,7 @@ TEST_P(HttpNetworkTransactionTest,
ASSERT_TRUE(http_server_properties->HasAlternateProtocol(
HostPortPair::FromURL(request.url)));
- const PortAlternateProtocolPair alternate =
+ const AlternateProtocolInfo alternate =
http_server_properties->GetAlternateProtocol(
HostPortPair::FromURL(request.url));
EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol);
@@ -8550,7 +8549,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(restricted_port_request.url),
kUnrestrictedAlternatePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8601,7 +8600,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(restricted_port_request.url),
kUnrestrictedAlternatePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8649,7 +8648,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(restricted_port_request.url),
kRestrictedAlternatePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8698,7 +8697,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(unrestricted_port_request.url),
kRestrictedAlternatePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8746,7 +8745,7 @@ TEST_P(HttpNetworkTransactionTest,
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(unrestricted_port_request.url),
kUnrestrictedAlternatePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -8789,7 +8788,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolUnsafeBlocked) {
http_server_properties->SetAlternateProtocol(
HostPortPair::FromURL(request.url),
kUnsafePort,
- AlternateProtocolFromNextProto(GetParam()));
+ AlternateProtocolFromNextProto(GetParam()), 1);
scoped_ptr<HttpTransaction> trans(
new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698