From c571b9fb737882e8fc660162a50d48b5d63dc4f6 Mon Sep 17 00:00:00 2001 From: "ricea@chromium.org" Date: Thu, 26 Jun 2014 06:54:54 +0000 Subject: [PATCH] Rename set_client_socket_type to set_default_client_socket_type In MockTransportClientSocketFactory, rename set_client_socket_type() to set_default_client_socket_type() to emphasise that it can be used in combination with set_client_socket_types(). BUG= TEST=net_unittests Review URL: https://codereview.chromium.org/345733010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279939 0039d316-1c4b-4281-b951-d872f2087c98 --- .../transport_client_socket_pool_test_util.h | 2 +- .../transport_client_socket_pool_unittest.cc | 14 +++++++------- ...socket_transport_client_socket_pool_unittest.cc | 22 +++++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/net/socket/transport_client_socket_pool_test_util.h b/net/socket/transport_client_socket_pool_test_util.h index d48193c688e8..40ed1d1c453c 100644 --- a/net/socket/transport_client_socket_pool_test_util.h +++ b/net/socket/transport_client_socket_pool_test_util.h @@ -91,7 +91,7 @@ class MockTransportClientSocketFactory : public ClientSocketFactory { int allocation_count() const { return allocation_count_; } // Set the default ClientSocketType. - void set_client_socket_type(ClientSocketType type) { + void set_default_client_socket_type(ClientSocketType type) { client_socket_type_ = type; } diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc index 146fc490f88e..1d2b99e13f44 100644 --- a/net/socket/transport_client_socket_pool_unittest.cc +++ b/net/socket/transport_client_socket_pool_unittest.cc @@ -210,7 +210,7 @@ TEST_F(TransportClientSocketPoolTest, InitHostResolutionFailure) { } TEST_F(TransportClientSocketPoolTest, InitConnectionFailure) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET); TestCompletionCallback callback; ClientSocketHandle handle; @@ -354,7 +354,7 @@ TEST_F(TransportClientSocketPoolTest, TwoRequestsCancelOne) { } TEST_F(TransportClientSocketPoolTest, ConnectCancelConnect) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET); ClientSocketHandle handle; TestCompletionCallback callback; @@ -514,7 +514,7 @@ TEST_F(TransportClientSocketPoolTest, RequestTwice) { // Make sure that pending requests get serviced after active requests get // cancelled. TEST_F(TransportClientSocketPoolTest, CancelActiveRequestWithPendingRequests) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET); // Queue up all the requests @@ -544,7 +544,7 @@ TEST_F(TransportClientSocketPoolTest, CancelActiveRequestWithPendingRequests) { // Make sure that pending requests get serviced after active requests fail. TEST_F(TransportClientSocketPoolTest, FailingActiveRequestWithPendingRequests) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET); const int kNumRequests = 2 * kMaxSocketsPerGroup + 1; @@ -677,7 +677,7 @@ TEST_F(TransportClientSocketPoolTest, BackupSocketConnect) { // Test the case where a socket took long enough to start the creation // of the backup socket, but then we cancelled the request after that. TEST_F(TransportClientSocketPoolTest, BackupSocketCancel) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_STALLED_CLIENT_SOCKET); enum { CANCEL_BEFORE_WAIT, CANCEL_AFTER_WAIT }; @@ -907,7 +907,7 @@ TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) { &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); // Resolve an AddressList with only IPv6 addresses. @@ -941,7 +941,7 @@ TEST_F(TransportClientSocketPoolTest, IPv4HasNoFallback) { &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); // Resolve an AddressList with only IPv4 addresses. diff --git a/net/socket/websocket_transport_client_socket_pool_unittest.cc b/net/socket/websocket_transport_client_socket_pool_unittest.cc index c122502f1290..a592f5e9237c 100644 --- a/net/socket/websocket_transport_client_socket_pool_unittest.cc +++ b/net/socket/websocket_transport_client_socket_pool_unittest.cc @@ -160,7 +160,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, InitHostResolutionFailure) { } TEST_F(WebSocketTransportClientSocketPoolTest, InitConnectionFailure) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_FAILING_CLIENT_SOCKET); TestCompletionCallback callback; ClientSocketHandle handle; @@ -293,7 +293,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, TwoRequestsCancelOne) { } TEST_F(WebSocketTransportClientSocketPoolTest, ConnectCancelConnect) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET); ClientSocketHandle handle; TestCompletionCallback callback; @@ -441,7 +441,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, RequestTwice) { // cancelled. TEST_F(WebSocketTransportClientSocketPoolTest, CancelActiveRequestWithPendingRequests) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_CLIENT_SOCKET); // Queue up all the requests @@ -472,7 +472,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, // Make sure that pending requests get serviced after active requests fail. TEST_F(WebSocketTransportClientSocketPoolTest, FailingActiveRequestWithPendingRequests) { - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_PENDING_FAILING_CLIENT_SOCKET); const int kNumRequests = 2 * kMaxSocketsPerGroup + 1; @@ -636,7 +636,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); // Resolve an AddressList with only IPv6 addresses. @@ -668,7 +668,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, IPv4HasNoFallback) { &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_CLIENT_SOCKET); // Resolve an AddressList with only IPv4 addresses. @@ -783,7 +783,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, FirstSuccessWins) { &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_TRIGGERABLE_CLIENT_SOCKET); // Resolve an AddressList with an IPv6 addresses and an IPv4 address. @@ -822,7 +822,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, LastFailureWins) { &client_socket_factory_, NULL); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET); base::TimeDelta delay = base::TimeDelta::FromMilliseconds( TransportConnectJobHelper::kIPv6FallbackTimerInMs / 3); @@ -866,7 +866,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, DISABLED_OverallTimeoutApplies) { NULL); const base::TimeDelta connect_job_timeout = pool.ConnectionTimeout(); - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_DELAYED_FAILING_CLIENT_SOCKET); client_socket_factory_.set_delay(base::TimeDelta::FromSeconds(1) + connect_job_timeout / 6); @@ -1005,7 +1005,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, client_socket_factory_.set_client_socket_types(first_type, arraysize(first_type)); // The rest of the sockets will connect synchronously. - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_CLIENT_SOCKET); for (int i = 0; i < kMaxSockets; ++i) { EXPECT_EQ(ERR_IO_PENDING, StartRequest("a", kDefaultPriority)); @@ -1034,7 +1034,7 @@ TEST_F(WebSocketTransportClientSocketPoolTest, client_socket_factory_.set_client_socket_types(&socket_types[0], socket_types.size()); // The rest of the sockets will connect synchronously. - client_socket_factory_.set_client_socket_type( + client_socket_factory_.set_default_client_socket_type( MockTransportClientSocketFactory::MOCK_CLIENT_SOCKET); for (int i = 0; i < kMaxSockets; ++i) { host_resolver_->rules()->ClearRules(); -- 2.11.4.GIT