| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 public: | 602 public: |
| 603 MockTCPClientSocket(const net::AddressList& addresses, net::NetLog* net_log, | 603 MockTCPClientSocket(const net::AddressList& addresses, net::NetLog* net_log, |
| 604 net::SocketDataProvider* socket); | 604 net::SocketDataProvider* socket); |
| 605 | 605 |
| 606 // ClientSocket methods: | 606 // ClientSocket methods: |
| 607 virtual int Connect(net::CompletionCallback* callback); | 607 virtual int Connect(net::CompletionCallback* callback); |
| 608 virtual void Disconnect(); | 608 virtual void Disconnect(); |
| 609 virtual bool IsConnected() const; | 609 virtual bool IsConnected() const; |
| 610 virtual bool IsConnectedAndIdle() const { return IsConnected(); } | 610 virtual bool IsConnectedAndIdle() const { return IsConnected(); } |
| 611 virtual bool WasEverUsed() const { return was_used_to_convey_data_; } | 611 virtual bool WasEverUsed() const { return was_used_to_convey_data_; } |
| 612 virtual bool UsingTCPFastOpen() const { return false; } |
| 612 | 613 |
| 613 // Socket methods: | 614 // Socket methods: |
| 614 virtual int Read(net::IOBuffer* buf, int buf_len, | 615 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 615 net::CompletionCallback* callback); | 616 net::CompletionCallback* callback); |
| 616 virtual int Write(net::IOBuffer* buf, int buf_len, | 617 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 617 net::CompletionCallback* callback); | 618 net::CompletionCallback* callback); |
| 618 | 619 |
| 619 virtual void OnReadComplete(const MockRead& data); | 620 virtual void OnReadComplete(const MockRead& data); |
| 620 | 621 |
| 621 net::AddressList addresses() const { return addresses_; } | 622 net::AddressList addresses() const { return addresses_; } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 647 public: | 648 public: |
| 648 DeterministicMockTCPClientSocket(net::NetLog* net_log, | 649 DeterministicMockTCPClientSocket(net::NetLog* net_log, |
| 649 net::DeterministicSocketData* data); | 650 net::DeterministicSocketData* data); |
| 650 | 651 |
| 651 // ClientSocket methods: | 652 // ClientSocket methods: |
| 652 virtual int Connect(net::CompletionCallback* callback); | 653 virtual int Connect(net::CompletionCallback* callback); |
| 653 virtual void Disconnect(); | 654 virtual void Disconnect(); |
| 654 virtual bool IsConnected() const; | 655 virtual bool IsConnected() const; |
| 655 virtual bool IsConnectedAndIdle() const { return IsConnected(); } | 656 virtual bool IsConnectedAndIdle() const { return IsConnected(); } |
| 656 virtual bool WasEverUsed() const { return was_used_to_convey_data_; } | 657 virtual bool WasEverUsed() const { return was_used_to_convey_data_; } |
| 658 virtual bool UsingTCPFastOpen() const { return false; } |
| 657 | 659 |
| 658 // Socket methods: | 660 // Socket methods: |
| 659 virtual int Write(net::IOBuffer* buf, int buf_len, | 661 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 660 net::CompletionCallback* callback); | 662 net::CompletionCallback* callback); |
| 661 virtual int Read(net::IOBuffer* buf, int buf_len, | 663 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 662 net::CompletionCallback* callback); | 664 net::CompletionCallback* callback); |
| 663 | 665 |
| 664 bool write_pending() const { return write_pending_; } | 666 bool write_pending() const { return write_pending_; } |
| 665 bool read_pending() const { return read_pending_; } | 667 bool read_pending() const { return read_pending_; } |
| 666 | 668 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 691 const net::SSLConfig& ssl_config, | 693 const net::SSLConfig& ssl_config, |
| 692 SSLHostInfo* ssl_host_info, | 694 SSLHostInfo* ssl_host_info, |
| 693 net::SSLSocketDataProvider* socket); | 695 net::SSLSocketDataProvider* socket); |
| 694 ~MockSSLClientSocket(); | 696 ~MockSSLClientSocket(); |
| 695 | 697 |
| 696 // ClientSocket methods: | 698 // ClientSocket methods: |
| 697 virtual int Connect(net::CompletionCallback* callback); | 699 virtual int Connect(net::CompletionCallback* callback); |
| 698 virtual void Disconnect(); | 700 virtual void Disconnect(); |
| 699 virtual bool IsConnected() const; | 701 virtual bool IsConnected() const; |
| 700 virtual bool WasEverUsed() const; | 702 virtual bool WasEverUsed() const; |
| 703 virtual bool UsingTCPFastOpen() const; |
| 701 | 704 |
| 702 // Socket methods: | 705 // Socket methods: |
| 703 virtual int Read(net::IOBuffer* buf, int buf_len, | 706 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 704 net::CompletionCallback* callback); | 707 net::CompletionCallback* callback); |
| 705 virtual int Write(net::IOBuffer* buf, int buf_len, | 708 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 706 net::CompletionCallback* callback); | 709 net::CompletionCallback* callback); |
| 707 | 710 |
| 708 // SSLClientSocket methods: | 711 // SSLClientSocket methods: |
| 709 virtual void GetSSLInfo(net::SSLInfo* ssl_info); | 712 virtual void GetSSLInfo(net::SSLInfo* ssl_info); |
| 710 virtual NextProtoStatus GetNextProto(std::string* proto); | 713 virtual NextProtoStatus GetNextProto(std::string* proto); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 934 |
| 932 extern const char kSOCKS5OkRequest[]; | 935 extern const char kSOCKS5OkRequest[]; |
| 933 extern const int kSOCKS5OkRequestLength; | 936 extern const int kSOCKS5OkRequestLength; |
| 934 | 937 |
| 935 extern const char kSOCKS5OkResponse[]; | 938 extern const char kSOCKS5OkResponse[]; |
| 936 extern const int kSOCKS5OkResponseLength; | 939 extern const int kSOCKS5OkResponseLength; |
| 937 | 940 |
| 938 } // namespace net | 941 } // namespace net |
| 939 | 942 |
| 940 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 943 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |