| 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 <cstring> | 8 #include <cstring> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 | 867 |
| 868 // StreamSocket implementation. | 868 // StreamSocket implementation. |
| 869 virtual int Connect(const CompletionCallback& callback) OVERRIDE; | 869 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
| 870 virtual void Disconnect() OVERRIDE; | 870 virtual void Disconnect() OVERRIDE; |
| 871 virtual bool IsConnected() const OVERRIDE; | 871 virtual bool IsConnected() const OVERRIDE; |
| 872 virtual bool WasEverUsed() const OVERRIDE; | 872 virtual bool WasEverUsed() const OVERRIDE; |
| 873 virtual bool UsingTCPFastOpen() const OVERRIDE; | 873 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 874 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; | 874 virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; |
| 875 virtual bool WasNpnNegotiated() const OVERRIDE; | 875 virtual bool WasNpnNegotiated() const OVERRIDE; |
| 876 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 876 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 877 virtual bool was_spdy_negotiated() const OVERRIDE; |
| 878 virtual bool set_was_spdy_negotiated(bool negotiated) OVERRIDE; |
| 877 | 879 |
| 878 // SSLClientSocket implementation. | 880 // SSLClientSocket implementation. |
| 879 virtual void GetSSLCertRequestInfo( | 881 virtual void GetSSLCertRequestInfo( |
| 880 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 882 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
| 881 virtual NextProtoStatus GetNextProto(std::string* proto, | 883 virtual NextProtoStatus GetNextProto(std::string* proto, |
| 882 std::string* server_protos) OVERRIDE; | 884 std::string* server_protos) OVERRIDE; |
| 883 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; | 885 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; |
| 884 virtual void set_protocol_negotiated( | 886 virtual void set_protocol_negotiated( |
| 885 NextProto protocol_negotiated) OVERRIDE; | 887 NextProto protocol_negotiated) OVERRIDE; |
| 886 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 888 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
| 887 | 889 |
| 888 // This MockSocket does not implement the manual async IO feature. | 890 // This MockSocket does not implement the manual async IO feature. |
| 889 virtual void OnReadComplete(const MockRead& data) OVERRIDE; | 891 virtual void OnReadComplete(const MockRead& data) OVERRIDE; |
| 890 | 892 |
| 891 virtual bool WasChannelIDSent() const OVERRIDE; | 893 virtual bool WasChannelIDSent() const OVERRIDE; |
| 892 virtual void set_channel_id_sent(bool channel_id_sent) OVERRIDE; | 894 virtual void set_channel_id_sent(bool channel_id_sent) OVERRIDE; |
| 893 virtual ServerBoundCertService* GetServerBoundCertService() const OVERRIDE; | 895 virtual ServerBoundCertService* GetServerBoundCertService() const OVERRIDE; |
| 894 | 896 |
| 895 private: | 897 private: |
| 896 static void ConnectCallback(MockSSLClientSocket *ssl_client_socket, | 898 static void ConnectCallback(MockSSLClientSocket *ssl_client_socket, |
| 897 const CompletionCallback& callback, | 899 const CompletionCallback& callback, |
| 898 int rv); | 900 int rv); |
| 899 | 901 |
| 900 scoped_ptr<ClientSocketHandle> transport_; | 902 scoped_ptr<ClientSocketHandle> transport_; |
| 901 SSLSocketDataProvider* data_; | 903 SSLSocketDataProvider* data_; |
| 902 bool is_npn_state_set_; | 904 bool is_npn_state_set_; |
| 903 bool new_npn_value_; | 905 bool new_npn_value_; |
| 904 bool is_protocol_negotiated_set_; | 906 bool is_protocol_negotiated_set_; |
| 907 bool was_spdy_negotiated_; |
| 908 bool was_spdy_negotiated_set_; |
| 905 NextProto protocol_negotiated_; | 909 NextProto protocol_negotiated_; |
| 906 }; | 910 }; |
| 907 | 911 |
| 908 class MockUDPClientSocket | 912 class MockUDPClientSocket |
| 909 : public DatagramClientSocket, | 913 : public DatagramClientSocket, |
| 910 public AsyncSocket { | 914 public AsyncSocket { |
| 911 public: | 915 public: |
| 912 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log); | 916 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log); |
| 913 virtual ~MockUDPClientSocket(); | 917 virtual ~MockUDPClientSocket(); |
| 914 | 918 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 | 1182 |
| 1179 extern const char kSOCKS5OkRequest[]; | 1183 extern const char kSOCKS5OkRequest[]; |
| 1180 extern const int kSOCKS5OkRequestLength; | 1184 extern const int kSOCKS5OkRequestLength; |
| 1181 | 1185 |
| 1182 extern const char kSOCKS5OkResponse[]; | 1186 extern const char kSOCKS5OkResponse[]; |
| 1183 extern const int kSOCKS5OkResponseLength; | 1187 extern const int kSOCKS5OkResponseLength; |
| 1184 | 1188 |
| 1185 } // namespace net | 1189 } // namespace net |
| 1186 | 1190 |
| 1187 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1191 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |