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

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: Better plumbing Created 6 years, 6 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
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 01756a196547574976bdbc50bf10eb4a0318a3dd..472d951786d3e52501c4977eabfdf75c7482fbe9 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -7517,7 +7517,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;
}
@@ -8429,11 +8429,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));
}
@@ -8469,7 +8468,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()));
@@ -8490,7 +8489,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);
@@ -8531,7 +8530,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()));
@@ -8582,7 +8581,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()));
@@ -8630,7 +8629,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()));
@@ -8679,7 +8678,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()));
@@ -8727,7 +8726,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()));
@@ -8770,7 +8769,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()));

Powered by Google App Engine
This is Rietveld 408576698