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

Unified Diff: net/socket/socket_test_util.h

Issue 149211: Correctly handle multiple control response lines in new FTP transaction (Closed)
Patch Set: fixes Created 11 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ftp/ftp_network_transaction_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.h
diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h
index fc288ad498089b5d06fe1b24aa2bee9594f561b6..93f96251886aa1b7935c9e87268b2730a8f0bcee 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -5,6 +5,7 @@
#ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
#define NET_SOCKET_SOCKET_TEST_UTIL_H_
+#include <deque>
#include <string>
#include <vector>
@@ -124,18 +125,23 @@ class DynamicMockSocket : public MockSocket {
int short_read_limit() const { return short_read_limit_; }
void set_short_read_limit(int limit) { short_read_limit_ = limit; }
+ void allow_unconsumed_reads(bool allow) { allow_unconsumed_reads_ = allow; }
+
protected:
// The next time there is a read from this socket, it will return |data|.
// Before calling SimulateRead next time, the previous data must be consumed.
void SimulateRead(const char* data);
private:
- MockRead read_;
- bool has_read_;
+ std::deque<MockRead> reads_;
// Max number of bytes we will read at a time. 0 means no limit.
int short_read_limit_;
+ // If true, we'll not require the client to consume all data before we
+ // mock the next read.
+ bool allow_unconsumed_reads_;
+
DISALLOW_COPY_AND_ASSIGN(DynamicMockSocket);
};
« no previous file with comments | « net/ftp/ftp_network_transaction_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698