| 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 // Test methods and classes common to transport_client_socket_pool_unittest.cc | 5 // Test methods and classes common to transport_client_socket_pool_unittest.cc |
| 6 // and websocket_transport_client_socket_pool_unittest.cc. If you find you need | 6 // and websocket_transport_client_socket_pool_unittest.cc. If you find you need |
| 7 // to use these for another purpose, consider moving them to socket_test_util.h. | 7 // to use these for another purpose, consider moving them to socket_test_util.h. |
| 8 | 8 |
| 9 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ | 9 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ |
| 10 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ | 10 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Connects successfully, asynchronously. | 55 // Connects successfully, asynchronously. |
| 56 MOCK_PENDING_CLIENT_SOCKET, | 56 MOCK_PENDING_CLIENT_SOCKET, |
| 57 // Fails to connect, asynchronously. | 57 // Fails to connect, asynchronously. |
| 58 MOCK_PENDING_FAILING_CLIENT_SOCKET, | 58 MOCK_PENDING_FAILING_CLIENT_SOCKET, |
| 59 // A delayed socket will pause before connecting through the message loop. | 59 // A delayed socket will pause before connecting through the message loop. |
| 60 MOCK_DELAYED_CLIENT_SOCKET, | 60 MOCK_DELAYED_CLIENT_SOCKET, |
| 61 // A delayed socket that fails. | 61 // A delayed socket that fails. |
| 62 MOCK_DELAYED_FAILING_CLIENT_SOCKET, | 62 MOCK_DELAYED_FAILING_CLIENT_SOCKET, |
| 63 // A stalled socket that never connects at all. | 63 // A stalled socket that never connects at all. |
| 64 MOCK_STALLED_CLIENT_SOCKET, | 64 MOCK_STALLED_CLIENT_SOCKET, |
| 65 // A stalled socket that never connects at all, but returns a failing |
| 66 // ConnectionAttempt in |GetConnectionAttempts|. |
| 67 MOCK_STALLED_FAILING_CLIENT_SOCKET, |
| 65 // A socket that can be triggered to connect explicitly, asynchronously. | 68 // A socket that can be triggered to connect explicitly, asynchronously. |
| 66 MOCK_TRIGGERABLE_CLIENT_SOCKET, | 69 MOCK_TRIGGERABLE_CLIENT_SOCKET, |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 explicit MockTransportClientSocketFactory(NetLog* net_log); | 72 explicit MockTransportClientSocketFactory(NetLog* net_log); |
| 70 ~MockTransportClientSocketFactory() override; | 73 ~MockTransportClientSocketFactory() override; |
| 71 | 74 |
| 72 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( | 75 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( |
| 73 DatagramSocket::BindType bind_type, | 76 DatagramSocket::BindType bind_type, |
| 74 const RandIntCallback& rand_int_cb, | 77 const RandIntCallback& rand_int_cb, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 base::TimeDelta delay_; | 121 base::TimeDelta delay_; |
| 119 std::queue<base::Closure> triggerable_sockets_; | 122 std::queue<base::Closure> triggerable_sockets_; |
| 120 base::Closure run_loop_quit_closure_; | 123 base::Closure run_loop_quit_closure_; |
| 121 | 124 |
| 122 DISALLOW_COPY_AND_ASSIGN(MockTransportClientSocketFactory); | 125 DISALLOW_COPY_AND_ASSIGN(MockTransportClientSocketFactory); |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 } // namespace net | 128 } // namespace net |
| 126 | 129 |
| 127 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ | 130 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_TEST_UTIL_H_ |
| OLD | NEW |