| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/websocket_transport_client_socket_pool.h" | 5 #include "net/socket/websocket_transport_client_socket_pool.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 bool ReleaseOneConnection(ClientSocketPoolTest::KeepAlive keep_alive) { | 95 bool ReleaseOneConnection(ClientSocketPoolTest::KeepAlive keep_alive) { |
| 96 return test_base_.ReleaseOneConnection(keep_alive); | 96 return test_base_.ReleaseOneConnection(keep_alive); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) { | 99 void ReleaseAllConnections(ClientSocketPoolTest::KeepAlive keep_alive) { |
| 100 test_base_.ReleaseAllConnections(keep_alive); | 100 test_base_.ReleaseAllConnections(keep_alive); |
| 101 } | 101 } |
| 102 | 102 |
| 103 TestSocketRequest* request(int i) { return test_base_.request(i); } | 103 TestSocketRequest* request(int i) { return test_base_.request(i); } |
| 104 | 104 |
| 105 ScopedVector<TestSocketRequest>* requests() { return test_base_.requests(); } | 105 std::vector<scoped_ptr<TestSocketRequest>>* requests() { |
| 106 return test_base_.requests(); |
| 107 } |
| 106 size_t completion_count() const { return test_base_.completion_count(); } | 108 size_t completion_count() const { return test_base_.completion_count(); } |
| 107 | 109 |
| 108 TestNetLog net_log_; | 110 TestNetLog net_log_; |
| 109 scoped_refptr<TransportSocketParams> params_; | 111 scoped_refptr<TransportSocketParams> params_; |
| 110 scoped_ptr<MockHostResolver> host_resolver_; | 112 scoped_ptr<MockHostResolver> host_resolver_; |
| 111 MockTransportClientSocketFactory client_socket_factory_; | 113 MockTransportClientSocketFactory client_socket_factory_; |
| 112 WebSocketTransportClientSocketPool pool_; | 114 WebSocketTransportClientSocketPool pool_; |
| 113 ClientSocketPoolTest test_base_; | 115 ClientSocketPoolTest test_base_; |
| 114 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_; | 116 ScopedWebSocketEndpointZeroUnlockDelay zero_unlock_delay_; |
| 115 | 117 |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 EXPECT_EQ(OK, request(1)->WaitForResult()); | 1112 EXPECT_EQ(OK, request(1)->WaitForResult()); |
| 1111 // Third socket should still be waiting for endpoint. | 1113 // Third socket should still be waiting for endpoint. |
| 1112 ASSERT_FALSE(request(2)->handle()->is_initialized()); | 1114 ASSERT_FALSE(request(2)->handle()->is_initialized()); |
| 1113 EXPECT_EQ(LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET, | 1115 EXPECT_EQ(LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET, |
| 1114 request(2)->handle()->GetLoadState()); | 1116 request(2)->handle()->GetLoadState()); |
| 1115 } | 1117 } |
| 1116 | 1118 |
| 1117 } // namespace | 1119 } // namespace |
| 1118 | 1120 |
| 1119 } // namespace net | 1121 } // namespace net |
| OLD | NEW |