Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: net/ftp/ftp_ctrl_response_buffer_unittest.cc

Issue 11377007: FTP: add net-internals logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ftp/ftp_ctrl_response_buffer.cc ('k') | net/ftp/ftp_network_transaction.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "net/ftp/ftp_ctrl_response_buffer.h" 5 #include "net/ftp/ftp_ctrl_response_buffer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace { 12 namespace {
13 13
14 class FtpCtrlResponseBufferTest : public testing::Test { 14 class FtpCtrlResponseBufferTest : public testing::Test {
15 public:
16 FtpCtrlResponseBufferTest() : buffer_(net::BoundNetLog()) {
17 }
18
15 protected: 19 protected:
16 int PushDataToBuffer(const char* data) { 20 int PushDataToBuffer(const char* data) {
17 return buffer_.ConsumeData(data, strlen(data)); 21 return buffer_.ConsumeData(data, strlen(data));
18 } 22 }
19 23
20 net::FtpCtrlResponseBuffer buffer_; 24 net::FtpCtrlResponseBuffer buffer_;
21 }; 25 };
22 26
23 TEST_F(FtpCtrlResponseBufferTest, Basic) { 27 TEST_F(FtpCtrlResponseBufferTest, Basic) {
24 EXPECT_FALSE(buffer_.ResponseAvailable()); 28 EXPECT_FALSE(buffer_.ResponseAvailable());
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_EQ(net::ERR_INVALID_RESPONSE, PushDataToBuffer("Non-numeric\r\n")); 166 EXPECT_EQ(net::ERR_INVALID_RESPONSE, PushDataToBuffer("Non-numeric\r\n"));
163 EXPECT_FALSE(buffer_.ResponseAvailable()); 167 EXPECT_FALSE(buffer_.ResponseAvailable());
164 } 168 }
165 169
166 TEST_F(FtpCtrlResponseBufferTest, OutOfRangeResponse) { 170 TEST_F(FtpCtrlResponseBufferTest, OutOfRangeResponse) {
167 EXPECT_EQ(net::ERR_INVALID_RESPONSE, PushDataToBuffer("777 OK?\r\n")); 171 EXPECT_EQ(net::ERR_INVALID_RESPONSE, PushDataToBuffer("777 OK?\r\n"));
168 EXPECT_FALSE(buffer_.ResponseAvailable()); 172 EXPECT_FALSE(buffer_.ResponseAvailable());
169 } 173 }
170 174
171 } // namespace 175 } // namespace
OLDNEW
« no previous file with comments | « net/ftp/ftp_ctrl_response_buffer.cc ('k') | net/ftp/ftp_network_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698