| Index: net/base/tcp_listen_socket_unittest.h
|
| diff --git a/net/base/listen_socket_unittest.h b/net/base/tcp_listen_socket_unittest.h
|
| similarity index 77%
|
| rename from net/base/listen_socket_unittest.h
|
| rename to net/base/tcp_listen_socket_unittest.h
|
| index 1f63bc919a2d7398d5152e4d5f1250f0ad5ce7b1..3d4b11cdb2800b2fa7ccddb42e39e6b16d531576 100644
|
| --- a/net/base/listen_socket_unittest.h
|
| +++ b/net/base/tcp_listen_socket_unittest.h
|
| @@ -23,8 +23,8 @@
|
| #include "base/synchronization/condition_variable.h"
|
| #include "base/synchronization/lock.h"
|
| #include "base/threading/thread.h"
|
| -#include "net/base/listen_socket.h"
|
| #include "net/base/net_util.h"
|
| +#include "net/base/tcp_listen_socket.h"
|
| #include "net/base/winsock_init.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -47,11 +47,11 @@ enum ActionType {
|
| ACTION_SHUTDOWN = 6
|
| };
|
|
|
| -class ListenSocketTestAction {
|
| +class TCPListenSocketTestAction {
|
| public:
|
| - ListenSocketTestAction() : action_(ACTION_NONE) {}
|
| - explicit ListenSocketTestAction(ActionType action) : action_(action) {}
|
| - ListenSocketTestAction(ActionType action, std::string data)
|
| + TCPListenSocketTestAction() : action_(ACTION_NONE) {}
|
| + explicit TCPListenSocketTestAction(ActionType action) : action_(action) {}
|
| + TCPListenSocketTestAction(ActionType action, std::string data)
|
| : action_(action),
|
| data_(data) {}
|
|
|
| @@ -66,17 +66,17 @@ class ListenSocketTestAction {
|
|
|
| // This had to be split out into a separate class because I couldn't
|
| // make the testing::Test class refcounted.
|
| -class ListenSocketTester :
|
| +class TCPListenSocketTester :
|
| public ListenSocket::ListenSocketDelegate,
|
| - public base::RefCountedThreadSafe<ListenSocketTester> {
|
| + public base::RefCountedThreadSafe<TCPListenSocketTester> {
|
|
|
| public:
|
| - ListenSocketTester();
|
| + TCPListenSocketTester();
|
|
|
| void SetUp();
|
| void TearDown();
|
|
|
| - void ReportAction(const ListenSocketTestAction& action);
|
| + void ReportAction(const TCPListenSocketTestAction& action);
|
| void NextAction();
|
|
|
| // read all pending data from the test socket
|
| @@ -97,30 +97,29 @@ class ListenSocketTester :
|
| // ListenSocket::ListenSocketDelegate:
|
| virtual void DidAccept(ListenSocket *server,
|
| ListenSocket *connection) OVERRIDE;
|
| - virtual void DidRead(ListenSocket *connection,
|
| - const char* data,
|
| + virtual void DidRead(ListenSocket *connection, const char* data,
|
| int len) OVERRIDE;
|
| virtual void DidClose(ListenSocket *sock) OVERRIDE;
|
|
|
| scoped_ptr<base::Thread> thread_;
|
| MessageLoopForIO* loop_;
|
| - ListenSocket* server_;
|
| + TCPListenSocket* server_;
|
| ListenSocket* connection_;
|
| - ListenSocketTestAction last_action_;
|
| + TCPListenSocketTestAction last_action_;
|
|
|
| SOCKET test_socket_;
|
| static const int kTestPort;
|
|
|
| base::Lock lock_; // protects |queue_| and wraps |cv_|
|
| base::ConditionVariable cv_;
|
| - std::deque<ListenSocketTestAction> queue_;
|
| + std::deque<TCPListenSocketTestAction> queue_;
|
|
|
| protected:
|
| - friend class base::RefCountedThreadSafe<ListenSocketTester>;
|
| + friend class base::RefCountedThreadSafe<TCPListenSocketTester>;
|
|
|
| - virtual ~ListenSocketTester();
|
| + virtual ~TCPListenSocketTester();
|
|
|
| - virtual ListenSocket* DoListen();
|
| + virtual TCPListenSocket* DoListen();
|
| };
|
|
|
| } // namespace net
|
|
|