| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Tests TelnetServer. | 5 // Tests TelnetServer. |
| 6 | 6 |
| 7 #include "net/base/listen_socket_unittest.h" | 7 #include "net/base/listen_socket_unittest.h" |
| 8 #include "net/base/telnet_server.h" | 8 #include "net/base/telnet_server.h" |
| 9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual bool Send(SOCKET sock, const std::string& str) { | 26 virtual bool Send(SOCKET sock, const std::string& str) { |
| 27 if (ListenSocketTester::Send(sock, str)) { | 27 if (ListenSocketTester::Send(sock, str)) { |
| 28 // TelnetServer currently calls DidRead after a CRLF, so we need to | 28 // TelnetServer currently calls DidRead after a CRLF, so we need to |
| 29 // append one to the end of the data that we send. | 29 // append one to the end of the data that we send. |
| 30 if (ListenSocketTester::Send(sock, kCRLF)) { | 30 if (ListenSocketTester::Send(sock, kCRLF)) { |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 return false; | 34 return false; |
| 35 } | 35 } |
| 36 |
| 37 private: |
| 38 ~TelnetServerTester() {} |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 class TelnetServerTest: public PlatformTest { | 41 class TelnetServerTest: public PlatformTest { |
| 39 protected: | 42 protected: |
| 40 TelnetServerTest() { | 43 TelnetServerTest() { |
| 41 tester_ = NULL; | 44 tester_ = NULL; |
| 42 } | 45 } |
| 43 | 46 |
| 44 virtual void SetUp() { | 47 virtual void SetUp() { |
| 45 PlatformTest::SetUp(); | 48 PlatformTest::SetUp(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 tester_->TestClientSend(); | 63 tester_->TestClientSend(); |
| 61 } | 64 } |
| 62 | 65 |
| 63 TEST_F(TelnetServerTest, ClientSendLong) { | 66 TEST_F(TelnetServerTest, ClientSendLong) { |
| 64 tester_->TestClientSendLong(); | 67 tester_->TestClientSendLong(); |
| 65 } | 68 } |
| 66 | 69 |
| 67 TEST_F(TelnetServerTest, ServerSend) { | 70 TEST_F(TelnetServerTest, ServerSend) { |
| 68 tester_->TestServerSend(); | 71 tester_->TestServerSend(); |
| 69 } | 72 } |
| OLD | NEW |