diff options
author | arindam@chromium.org <arindam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 14:05:26 +0000 |
---|---|---|
committer | arindam@chromium.org <arindam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 14:05:26 +0000 |
commit | bb5cc8729a3e96833c1e771e9ad49258a1ff88df (patch) | |
tree | 457036c8ed45582726666e7aeacce560d37c9813 /net/socket/socket_test_util.h | |
parent | c6a2eb748ba6dd1f570cbac0b806faae450274c7 (diff) | |
download | chromium_src-bb5cc8729a3e96833c1e771e9ad49258a1ff88df.zip chromium_src-bb5cc8729a3e96833c1e771e9ad49258a1ff88df.tar.gz chromium_src-bb5cc8729a3e96833c1e771e9ad49258a1ff88df.tar.bz2 |
reverting the change 19354, 19356
TEST=none
BUG=none
TBR=eroman
Review URL: http://codereview.chromium.org/149076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/socket_test_util.h')
-rw-r--r-- | net/socket/socket_test_util.h | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index f710820..bd7c437 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -10,13 +10,10 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/scoped_ptr.h" #include "net/base/address_list.h" -#include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/ssl_config_service.h" #include "net/socket/client_socket_factory.h" -#include "net/socket/ssl_client_socket.h" namespace net { @@ -203,88 +200,6 @@ class MockClientSocketFactory : public ClientSocketFactory { MockSocketArray<MockSSLSocket> mock_ssl_sockets_; }; -class MockClientSocket : public net::SSLClientSocket { - public: - MockClientSocket(); - - // ClientSocket methods: - virtual int Connect(net::CompletionCallback* callback) = 0; - - // SSLClientSocket methods: - virtual void GetSSLInfo(net::SSLInfo* ssl_info); - virtual void GetSSLCertRequestInfo( - net::SSLCertRequestInfo* cert_request_info); - virtual void Disconnect(); - virtual bool IsConnected() const; - virtual bool IsConnectedAndIdle() const; - - // Socket methods: - virtual int Read(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) = 0; - virtual int Write(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback) = 0; - -#if defined(OS_LINUX) - virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); -#endif - - protected: - void RunCallbackAsync(net::CompletionCallback* callback, int result); - void RunCallback(int result); - - ScopedRunnableMethodFactory<MockClientSocket> method_factory_; - net::CompletionCallback* callback_; - bool connected_; -}; - -class MockTCPClientSocket : public MockClientSocket { - public: - MockTCPClientSocket(const net::AddressList& addresses, - net::MockSocket* socket); - - // ClientSocket methods: - virtual int Connect(net::CompletionCallback* callback); - - // Socket methods: - virtual int Read(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback); - virtual int Write(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback); - - private: - net::MockSocket* data_; - int read_offset_; - net::MockRead read_data_; - bool need_read_data_; -}; - -class MockSSLClientSocket : public MockClientSocket { - public: - MockSSLClientSocket( - net::ClientSocket* transport_socket, - const std::string& hostname, - const net::SSLConfig& ssl_config, - net::MockSSLSocket* socket); - ~MockSSLClientSocket(); - - virtual void GetSSLInfo(net::SSLInfo* ssl_info); - - virtual int Connect(net::CompletionCallback* callback); - virtual void Disconnect(); - - // Socket methods: - virtual int Read(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback); - virtual int Write(net::IOBuffer* buf, int buf_len, - net::CompletionCallback* callback); - - private: - class ConnectCallback; - - scoped_ptr<ClientSocket> transport_; - net::MockSSLSocket* data_; -}; - } // namespace net #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |