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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 net::CompletionCallback* callback); | 618 net::CompletionCallback* callback); |
619 | 619 |
620 // StreamSocket methods: | 620 // StreamSocket methods: |
621 virtual int Connect(net::CompletionCallback* callback); | 621 virtual int Connect(net::CompletionCallback* callback); |
622 virtual void Disconnect(); | 622 virtual void Disconnect(); |
623 virtual bool IsConnected() const; | 623 virtual bool IsConnected() const; |
624 virtual bool IsConnectedAndIdle() const; | 624 virtual bool IsConnectedAndIdle() const; |
625 virtual int GetPeerAddress(AddressList* address) const; | 625 virtual int GetPeerAddress(AddressList* address) const; |
626 virtual bool WasEverUsed() const; | 626 virtual bool WasEverUsed() const; |
627 virtual bool UsingTCPFastOpen() const; | 627 virtual bool UsingTCPFastOpen() const; |
| 628 virtual int64 NumBytesRead() const; |
| 629 virtual int GetConnectTimeMicros() const; |
628 | 630 |
629 // MockClientSocket: | 631 // MockClientSocket: |
630 virtual void OnReadComplete(const MockRead& data); | 632 virtual void OnReadComplete(const MockRead& data); |
631 | 633 |
632 private: | 634 private: |
633 int CompleteRead(); | 635 int CompleteRead(); |
634 | 636 |
635 net::AddressList addresses_; | 637 net::AddressList addresses_; |
636 | 638 |
637 net::SocketDataProvider* data_; | 639 net::SocketDataProvider* data_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 virtual int Read(net::IOBuffer* buf, int buf_len, | 672 virtual int Read(net::IOBuffer* buf, int buf_len, |
671 net::CompletionCallback* callback); | 673 net::CompletionCallback* callback); |
672 | 674 |
673 // StreamSocket: | 675 // StreamSocket: |
674 virtual int Connect(net::CompletionCallback* callback); | 676 virtual int Connect(net::CompletionCallback* callback); |
675 virtual void Disconnect(); | 677 virtual void Disconnect(); |
676 virtual bool IsConnected() const; | 678 virtual bool IsConnected() const; |
677 virtual bool IsConnectedAndIdle() const; | 679 virtual bool IsConnectedAndIdle() const; |
678 virtual bool WasEverUsed() const; | 680 virtual bool WasEverUsed() const; |
679 virtual bool UsingTCPFastOpen() const; | 681 virtual bool UsingTCPFastOpen() const; |
| 682 virtual int64 NumBytesRead() const; |
| 683 virtual int GetConnectTimeMicros() const; |
680 | 684 |
681 // MockClientSocket: | 685 // MockClientSocket: |
682 virtual void OnReadComplete(const MockRead& data); | 686 virtual void OnReadComplete(const MockRead& data); |
683 | 687 |
684 private: | 688 private: |
685 bool write_pending_; | 689 bool write_pending_; |
686 net::CompletionCallback* write_callback_; | 690 net::CompletionCallback* write_callback_; |
687 int write_result_; | 691 int write_result_; |
688 | 692 |
689 net::MockRead read_data_; | 693 net::MockRead read_data_; |
(...skipping 21 matching lines...) Expand all Loading... |
711 net::CompletionCallback* callback); | 715 net::CompletionCallback* callback); |
712 virtual int Write(net::IOBuffer* buf, int buf_len, | 716 virtual int Write(net::IOBuffer* buf, int buf_len, |
713 net::CompletionCallback* callback); | 717 net::CompletionCallback* callback); |
714 | 718 |
715 // StreamSocket methods: | 719 // StreamSocket methods: |
716 virtual int Connect(net::CompletionCallback* callback); | 720 virtual int Connect(net::CompletionCallback* callback); |
717 virtual void Disconnect(); | 721 virtual void Disconnect(); |
718 virtual bool IsConnected() const; | 722 virtual bool IsConnected() const; |
719 virtual bool WasEverUsed() const; | 723 virtual bool WasEverUsed() const; |
720 virtual bool UsingTCPFastOpen() const; | 724 virtual bool UsingTCPFastOpen() const; |
| 725 virtual int64 NumBytesRead() const; |
| 726 virtual int GetConnectTimeMicros() const; |
721 | 727 |
722 // SSLClientSocket methods: | 728 // SSLClientSocket methods: |
723 virtual void GetSSLInfo(net::SSLInfo* ssl_info); | 729 virtual void GetSSLInfo(net::SSLInfo* ssl_info); |
724 virtual void GetSSLCertRequestInfo( | 730 virtual void GetSSLCertRequestInfo( |
725 net::SSLCertRequestInfo* cert_request_info); | 731 net::SSLCertRequestInfo* cert_request_info); |
726 virtual NextProtoStatus GetNextProto(std::string* proto); | 732 virtual NextProtoStatus GetNextProto(std::string* proto); |
727 virtual bool was_npn_negotiated() const; | 733 virtual bool was_npn_negotiated() const; |
728 virtual bool set_was_npn_negotiated(bool negotiated); | 734 virtual bool set_was_npn_negotiated(bool negotiated); |
729 | 735 |
730 // This MockSocket does not implement the manual async IO feature. | 736 // This MockSocket does not implement the manual async IO feature. |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 | 957 |
952 extern const char kSOCKS5OkRequest[]; | 958 extern const char kSOCKS5OkRequest[]; |
953 extern const int kSOCKS5OkRequestLength; | 959 extern const int kSOCKS5OkRequestLength; |
954 | 960 |
955 extern const char kSOCKS5OkResponse[]; | 961 extern const char kSOCKS5OkResponse[]; |
956 extern const int kSOCKS5OkResponseLength; | 962 extern const int kSOCKS5OkResponseLength; |
957 | 963 |
958 } // namespace net | 964 } // namespace net |
959 | 965 |
960 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 966 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
OLD | NEW |