| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/transport_client_socket_pool.h" | 5 #include "net/socket/transport_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool ReleaseOneConnection(ClientSocketPoolTest::KeepAlive keep_alive) { | 80 bool ReleaseOneConnection(ClientSocketPoolTest::KeepAlive keep_alive) { |
| 81 return test_base_.ReleaseOneConnection(keep_alive); | 81 return test_base_.ReleaseOneConnection(keep_alive); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) { | 84 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) { |
| 85 test_base_.ReleaseAllConnections(keep_alive); | 85 test_base_.ReleaseAllConnections(keep_alive); |
| 86 } | 86 } |
| 87 | 87 |
| 88 std::vector<scoped_ptr<TestSocketRequest>>* requests() { | 88 std::vector<std::unique_ptr<TestSocketRequest>>* requests() { |
| 89 return test_base_.requests(); | 89 return test_base_.requests(); |
| 90 } | 90 } |
| 91 size_t completion_count() const { return test_base_.completion_count(); } | 91 size_t completion_count() const { return test_base_.completion_count(); } |
| 92 | 92 |
| 93 bool connect_backup_jobs_enabled_; | 93 bool connect_backup_jobs_enabled_; |
| 94 TestNetLog net_log_; | 94 TestNetLog net_log_; |
| 95 scoped_refptr<TransportSocketParams> params_; | 95 scoped_refptr<TransportSocketParams> params_; |
| 96 scoped_ptr<MockHostResolver> host_resolver_; | 96 std::unique_ptr<MockHostResolver> host_resolver_; |
| 97 MockTransportClientSocketFactory client_socket_factory_; | 97 MockTransportClientSocketFactory client_socket_factory_; |
| 98 TransportClientSocketPool pool_; | 98 TransportClientSocketPool pool_; |
| 99 ClientSocketPoolTest test_base_; | 99 ClientSocketPoolTest test_base_; |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPoolTest); | 102 DISALLOW_COPY_AND_ASSIGN(TransportClientSocketPoolTest); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 TEST(TransportConnectJobTest, MakeAddrListStartWithIPv4) { | 105 TEST(TransportConnectJobTest, MakeAddrListStartWithIPv4) { |
| 106 IPEndPoint addrlist_v4_1(IPAddress(192, 168, 1, 1), 80); | 106 IPEndPoint addrlist_v4_1(IPAddress(192, 168, 1, 1), 80); |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 handle.socket()->GetPeerAddress(&endpoint); | 1126 handle.socket()->GetPeerAddress(&endpoint); |
| 1127 // Verify that the socket used is connected to the IPv6 address. | 1127 // Verify that the socket used is connected to the IPv6 address. |
| 1128 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); | 1128 EXPECT_EQ(kIPv6AddressSize, endpoint.address().size()); |
| 1129 // Verify that TCP FastOpen was not turned on for the socket. | 1129 // Verify that TCP FastOpen was not turned on for the socket. |
| 1130 EXPECT_FALSE(socket_data.IsUsingTCPFastOpen()); | 1130 EXPECT_FALSE(socket_data.IsUsingTCPFastOpen()); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 } // namespace | 1133 } // namespace |
| 1134 | 1134 |
| 1135 } // namespace net | 1135 } // namespace net |
| OLD | NEW |