| 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 3812c60c058e4441b0a38e3dec2dc527545948a1..8bd90213b4c98fcd1f7e64b9b3dead70103150c2 100644
|
| --- a/net/http/http_network_transaction_unittest.cc
|
| +++ b/net/http/http_network_transaction_unittest.cc
|
| @@ -7614,9 +7614,9 @@ scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests(
|
|
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair("host.with.alternate", 80), 443,
|
| - AlternateProtocolFromNextProto(next_proto), 1);
|
| + AlternateProtocolFromNextProto(next_proto), 1.0);
|
|
|
| return session;
|
| }
|
| @@ -8525,11 +8525,12 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) {
|
| 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);
|
| + const AlternateProtocols alternate_protocols =
|
| + http_server_properties.GetAlternateProtocols(http_host_port_pair);
|
| + ASSERT_EQ(1u, alternate_protocols.size());
|
| AlternateProtocolInfo expected_alternate(
|
| - 443, AlternateProtocolFromNextProto(GetParam()), 1);
|
| - EXPECT_TRUE(expected_alternate.Equals(alternate));
|
| + 443, AlternateProtocolFromNextProto(GetParam()), 1.0);
|
| + EXPECT_TRUE(expected_alternate.Equals(alternate_protocols[0]));
|
| }
|
|
|
| TEST_P(HttpNetworkTransactionTest,
|
| @@ -8561,10 +8562,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| session->http_server_properties();
|
| // Port must be < 1024, or the header will be ignored (since initial port was
|
| // port 80 (another restricted port).
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(request.url),
|
| 666 /* port is ignored by MockConnect anyway */,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + AlternateProtocolFromNextProto(GetParam()), 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8585,9 +8586,11 @@ TEST_P(HttpNetworkTransactionTest,
|
|
|
| ASSERT_TRUE(http_server_properties->HasAlternateProtocol(
|
| HostPortPair::FromURL(request.url)));
|
| - const AlternateProtocolInfo alternate =
|
| - http_server_properties->GetAlternateProtocol(
|
| + const AlternateProtocols alternate_protocols =
|
| + http_server_properties->GetAlternateProtocols(
|
| HostPortPair::FromURL(request.url));
|
| + ASSERT_EQ(1u, alternate_protocols.size());
|
| + const AlternateProtocolInfo alternate = alternate_protocols[0];
|
| EXPECT_TRUE(alternate.is_broken);
|
| }
|
|
|
| @@ -8623,10 +8626,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kUnrestrictedAlternatePort = 1024;
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(restricted_port_request.url),
|
| - kUnrestrictedAlternatePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + kUnrestrictedAlternatePort, AlternateProtocolFromNextProto(GetParam()),
|
| + 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8674,10 +8677,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kUnrestrictedAlternatePort = 1024;
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(restricted_port_request.url),
|
| - kUnrestrictedAlternatePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + kUnrestrictedAlternatePort, AlternateProtocolFromNextProto(GetParam()),
|
| + 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8722,10 +8725,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kRestrictedAlternatePort = 80;
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(restricted_port_request.url),
|
| - kRestrictedAlternatePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + kRestrictedAlternatePort, AlternateProtocolFromNextProto(GetParam()),
|
| + 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8771,10 +8774,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kRestrictedAlternatePort = 80;
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(unrestricted_port_request.url),
|
| - kRestrictedAlternatePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + kRestrictedAlternatePort, AlternateProtocolFromNextProto(GetParam()),
|
| + 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8819,10 +8822,10 @@ TEST_P(HttpNetworkTransactionTest,
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kUnrestrictedAlternatePort = 1024;
|
| - http_server_properties->SetAlternateProtocol(
|
| + http_server_properties->AddAlternateProtocol(
|
| HostPortPair::FromURL(unrestricted_port_request.url),
|
| - kUnrestrictedAlternatePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + kUnrestrictedAlternatePort, AlternateProtocolFromNextProto(GetParam()),
|
| + 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
| @@ -8862,10 +8865,9 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolUnsafeBlocked) {
|
| base::WeakPtr<HttpServerProperties> http_server_properties =
|
| session->http_server_properties();
|
| const int kUnsafePort = 7;
|
| - http_server_properties->SetAlternateProtocol(
|
| - HostPortPair::FromURL(request.url),
|
| - kUnsafePort,
|
| - AlternateProtocolFromNextProto(GetParam()), 1);
|
| + http_server_properties->AddAlternateProtocol(
|
| + HostPortPair::FromURL(request.url), kUnsafePort,
|
| + AlternateProtocolFromNextProto(GetParam()), 1.0);
|
|
|
| scoped_ptr<HttpTransaction> trans(
|
| new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
|
|
|