| 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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ | 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // If the |result| member of a MockRead is | 54 // If the |result| member of a MockRead is |
| 55 // ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ, that MockRead is just a | 55 // ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ, that MockRead is just a |
| 56 // marker that indicates the peer will close the connection after the next | 56 // marker that indicates the peer will close the connection after the next |
| 57 // MockRead. The other members of that MockRead are ignored. | 57 // MockRead. The other members of that MockRead are ignored. |
| 58 ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ = -10000, | 58 ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ = -10000, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class AsyncSocket; | 61 class AsyncSocket; |
| 62 class ChannelIDService; | 62 class ChannelIDService; |
| 63 class MockClientSocket; | 63 class MockClientSocket; |
| 64 class SocketPerformanceWatcherFactory; |
| 64 class SSLClientSocket; | 65 class SSLClientSocket; |
| 65 class StreamSocket; | 66 class StreamSocket; |
| 66 | 67 |
| 67 enum IoMode { | 68 enum IoMode { |
| 68 ASYNC, | 69 ASYNC, |
| 69 SYNCHRONOUS | 70 SYNCHRONOUS |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 struct MockConnect { | 73 struct MockConnect { |
| 73 // Asynchronous connection success. | 74 // Asynchronous connection success. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 } | 508 } |
| 508 | 509 |
| 509 // ClientSocketFactory | 510 // ClientSocketFactory |
| 510 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( | 511 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( |
| 511 DatagramSocket::BindType bind_type, | 512 DatagramSocket::BindType bind_type, |
| 512 const RandIntCallback& rand_int_cb, | 513 const RandIntCallback& rand_int_cb, |
| 513 NetLog* net_log, | 514 NetLog* net_log, |
| 514 const NetLog::Source& source) override; | 515 const NetLog::Source& source) override; |
| 515 scoped_ptr<StreamSocket> CreateTransportClientSocket( | 516 scoped_ptr<StreamSocket> CreateTransportClientSocket( |
| 516 const AddressList& addresses, | 517 const AddressList& addresses, |
| 518 SocketPerformanceWatcherFactory* socket_performance_watcher_factory, |
| 517 NetLog* net_log, | 519 NetLog* net_log, |
| 518 const NetLog::Source& source) override; | 520 const NetLog::Source& source) override; |
| 519 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 521 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
| 520 scoped_ptr<ClientSocketHandle> transport_socket, | 522 scoped_ptr<ClientSocketHandle> transport_socket, |
| 521 const HostPortPair& host_and_port, | 523 const HostPortPair& host_and_port, |
| 522 const SSLConfig& ssl_config, | 524 const SSLConfig& ssl_config, |
| 523 const SSLClientSocketContext& context) override; | 525 const SSLClientSocketContext& context) override; |
| 524 void ClearSSLSessionCache() override; | 526 void ClearSSLSessionCache() override; |
| 525 | 527 |
| 526 const std::vector<uint16_t>& udp_client_socket_ports() const { | 528 const std::vector<uint16_t>& udp_client_socket_ports() const { |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 | 1001 |
| 1000 // Helper function to get the total data size of the MockReads in |reads|. | 1002 // Helper function to get the total data size of the MockReads in |reads|. |
| 1001 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); | 1003 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); |
| 1002 | 1004 |
| 1003 // Helper function to get the total data size of the MockWrites in |writes|. | 1005 // Helper function to get the total data size of the MockWrites in |writes|. |
| 1004 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); | 1006 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); |
| 1005 | 1007 |
| 1006 } // namespace net | 1008 } // namespace net |
| 1007 | 1009 |
| 1008 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1010 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |