| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 754 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 755 | 755 |
| 756 // SSLClientSocket implementation. | 756 // SSLClientSocket implementation. |
| 757 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 757 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 758 virtual void GetSSLCertRequestInfo( | 758 virtual void GetSSLCertRequestInfo( |
| 759 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 759 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
| 760 virtual NextProtoStatus GetNextProto(std::string* proto, | 760 virtual NextProtoStatus GetNextProto(std::string* proto, |
| 761 std::string* server_protos) OVERRIDE; | 761 std::string* server_protos) OVERRIDE; |
| 762 virtual bool was_npn_negotiated() const OVERRIDE; | 762 virtual bool was_npn_negotiated() const OVERRIDE; |
| 763 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; | 763 virtual bool set_was_npn_negotiated(bool negotiated) OVERRIDE; |
| 764 virtual SSLClientSocket::NextProto next_protocol_negotiated() const OVERRIDE; |
| 765 virtual void set_next_protocol_negotiated( |
| 766 SSLClientSocket::NextProto next_protocol) OVERRIDE; |
| 764 | 767 |
| 765 // This MockSocket does not implement the manual async IO feature. | 768 // This MockSocket does not implement the manual async IO feature. |
| 766 virtual void OnReadComplete(const MockRead& data) OVERRIDE; | 769 virtual void OnReadComplete(const MockRead& data) OVERRIDE; |
| 767 | 770 |
| 768 private: | 771 private: |
| 769 static void ConnectCallback(MockSSLClientSocket *ssl_client_socket, | 772 static void ConnectCallback(MockSSLClientSocket *ssl_client_socket, |
| 770 const CompletionCallback& callback, | 773 const CompletionCallback& callback, |
| 771 int rv); | 774 int rv); |
| 772 | 775 |
| 773 scoped_ptr<ClientSocketHandle> transport_; | 776 scoped_ptr<ClientSocketHandle> transport_; |
| 774 SSLSocketDataProvider* data_; | 777 SSLSocketDataProvider* data_; |
| 775 bool is_npn_state_set_; | 778 bool is_npn_state_set_; |
| 776 bool new_npn_value_; | 779 bool new_npn_value_; |
| 777 bool was_used_to_convey_data_; | 780 bool was_used_to_convey_data_; |
| 781 bool is_next_protocol_set_; |
| 782 SSLClientSocket::NextProto next_protocol_; |
| 778 }; | 783 }; |
| 779 | 784 |
| 780 class MockUDPClientSocket : public DatagramClientSocket, | 785 class MockUDPClientSocket : public DatagramClientSocket, |
| 781 public AsyncSocket { | 786 public AsyncSocket { |
| 782 public: | 787 public: |
| 783 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log); | 788 MockUDPClientSocket(SocketDataProvider* data, net::NetLog* net_log); |
| 784 virtual ~MockUDPClientSocket(); | 789 virtual ~MockUDPClientSocket(); |
| 785 | 790 |
| 786 // Socket implementation. | 791 // Socket implementation. |
| 787 virtual int Read(IOBuffer* buf, int buf_len, | 792 virtual int Read(IOBuffer* buf, int buf_len, |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 | 1046 |
| 1042 extern const char kSOCKS5OkRequest[]; | 1047 extern const char kSOCKS5OkRequest[]; |
| 1043 extern const int kSOCKS5OkRequestLength; | 1048 extern const int kSOCKS5OkRequestLength; |
| 1044 | 1049 |
| 1045 extern const char kSOCKS5OkResponse[]; | 1050 extern const char kSOCKS5OkResponse[]; |
| 1046 extern const int kSOCKS5OkResponseLength; | 1051 extern const int kSOCKS5OkResponseLength; |
| 1047 | 1052 |
| 1048 } // namespace net | 1053 } // namespace net |
| 1049 | 1054 |
| 1050 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1055 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |