| 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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 namespace net { | 27 namespace net { |
| 28 | 28 |
| 29 using internal::ClientSocketPoolBaseHelper; | 29 using internal::ClientSocketPoolBaseHelper; |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const int kMaxSockets = 32; | 33 const int kMaxSockets = 32; |
| 34 const int kMaxSocketsPerGroup = 6; | 34 const int kMaxSocketsPerGroup = 6; |
| 35 const net::RequestPriority kDefaultPriority = LOW; | 35 const RequestPriority kDefaultPriority = LOW; |
| 36 | 36 |
| 37 class TransportClientSocketPoolTest : public testing::Test { | 37 class TransportClientSocketPoolTest : public testing::Test { |
| 38 protected: | 38 protected: |
| 39 TransportClientSocketPoolTest() | 39 TransportClientSocketPoolTest() |
| 40 : connect_backup_jobs_enabled_( | 40 : connect_backup_jobs_enabled_( |
| 41 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)), | 41 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(true)), |
| 42 params_( | 42 params_( |
| 43 new TransportSocketParams(HostPortPair("www.google.com", 80), | 43 new TransportSocketParams(HostPortPair("www.google.com", 80), |
| 44 false, false, | 44 false, false, |
| 45 OnHostResolutionCallback())), | 45 OnHostResolutionCallback())), |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 EXPECT_TRUE(handle.socket()); | 960 EXPECT_TRUE(handle.socket()); |
| 961 IPEndPoint endpoint; | 961 IPEndPoint endpoint; |
| 962 handle.socket()->GetLocalAddress(&endpoint); | 962 handle.socket()->GetLocalAddress(&endpoint); |
| 963 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); | 963 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); |
| 964 EXPECT_EQ(1, client_socket_factory_.allocation_count()); | 964 EXPECT_EQ(1, client_socket_factory_.allocation_count()); |
| 965 } | 965 } |
| 966 | 966 |
| 967 } // namespace | 967 } // namespace |
| 968 | 968 |
| 969 } // namespace net | 969 } // namespace net |
| OLD | NEW |