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

Unified Diff: net/quic/quic_network_transaction_unittest.cc

Issue 1130783008: Simplify test http_server_properties member access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_network_transaction_unittest.cc
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index ed0d7409e05fa8dd4fe3b79f57b27f6b9e498575..7a55c667e1be811a331fc35f492d2e47036cf971 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -242,7 +242,7 @@ class QuicNetworkTransactionTest
params_.proxy_service = proxy_service_.get();
params_.ssl_config_service = ssl_config_service_.get();
params_.http_auth_handler_factory = auth_handler_factory_.get();
- params_.http_server_properties = http_server_properties.GetWeakPtr();
+ params_.http_server_properties = http_server_properties_.GetWeakPtr();
params_.quic_supported_versions = SupportedVersions(GetParam());
if (use_next_protos) {
@@ -325,22 +325,22 @@ class QuicNetworkTransactionTest
crypto_client_stream_factory_.set_handshake_mode(handshake_mode);
HostPortPair host_port_pair = HostPortPair::FromURL(request_.url);
AlternativeService alternative_service(QUIC, host_port_pair.host(), 80);
- session_->http_server_properties()->SetAlternativeService(
- host_port_pair, alternative_service, 1.0);
+ http_server_properties_.SetAlternativeService(host_port_pair,
+ alternative_service, 1.0);
}
void ExpectBrokenAlternateProtocolMapping() {
const HostPortPair origin = HostPortPair::FromURL(request_.url);
const AlternativeService alternative_service =
- session_->http_server_properties()->GetAlternativeService(origin);
+ http_server_properties_.GetAlternativeService(origin);
EXPECT_NE(UNINITIALIZED_ALTERNATE_PROTOCOL, alternative_service.protocol);
- EXPECT_TRUE(session_->http_server_properties()->IsAlternativeServiceBroken(
+ EXPECT_TRUE(http_server_properties_.IsAlternativeServiceBroken(
alternative_service));
}
void ExpectQuicAlternateProtocolMapping() {
const AlternativeService alternative_service =
- session_->http_server_properties()->GetAlternativeService(
+ http_server_properties_.GetAlternativeService(
HostPortPair::FromURL(request_.url));
EXPECT_EQ(QUIC, alternative_service.protocol);
}
@@ -363,7 +363,7 @@ class QuicNetworkTransactionTest
scoped_ptr<ProxyService> proxy_service_;
scoped_ptr<HttpAuthHandlerFactory> auth_handler_factory_;
MockRandom random_generator_;
- HttpServerPropertiesImpl http_server_properties;
+ HttpServerPropertiesImpl http_server_properties_;
HttpNetworkSession::Params params_;
HttpRequestInfo request_;
BoundTestNetLog net_log_;
@@ -623,18 +623,16 @@ TEST_P(QuicNetworkTransactionTest, ConfirmAlternativeService) {
AlternativeService alternative_service(QUIC,
HostPortPair::FromURL(request_.url));
- session_->http_server_properties()->MarkAlternativeServiceRecentlyBroken(
+ http_server_properties_.MarkAlternativeServiceRecentlyBroken(
alternative_service);
- EXPECT_TRUE(
- session_->http_server_properties()->WasAlternativeServiceRecentlyBroken(
- alternative_service));
+ EXPECT_TRUE(http_server_properties_.WasAlternativeServiceRecentlyBroken(
+ alternative_service));
SendRequestAndExpectHttpResponse("hello world");
SendRequestAndExpectQuicResponse("hello!");
- EXPECT_FALSE(
- session_->http_server_properties()->WasAlternativeServiceRecentlyBroken(
- alternative_service));
+ EXPECT_FALSE(http_server_properties_.WasAlternativeServiceRecentlyBroken(
+ alternative_service));
}
TEST_P(QuicNetworkTransactionTest, UseAlternateProtocolProbabilityForQuic) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698