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

Unified Diff: net/socket/socket_test_util.h

Issue 1137183005: Remove DynamicSocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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 7d9a53b9125de1a78b28895a77c8550cb3eb5024..09d56eecebbafe563dffa3c321fab133197d191a 100644
--- a/net/socket/socket_test_util.h
+++ b/net/socket/socket_test_util.h
@@ -316,44 +316,6 @@ class StaticSocketDataProvider : public SocketDataProvider {
DISALLOW_COPY_AND_ASSIGN(StaticSocketDataProvider);
};
-// SocketDataProvider which can make decisions about next mock reads based on
-// received writes. It can also be used to enforce order of operations, for
-// example that tested code must send the "Hello!" message before receiving
-// response. This is useful for testing conversation-like protocols like FTP.
-class DynamicSocketDataProvider : public SocketDataProvider {
- public:
- DynamicSocketDataProvider();
- ~DynamicSocketDataProvider() override;
-
- 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; }
-
- // SocketDataProvider implementation.
- MockRead OnRead() override;
- MockWriteResult OnWrite(const std::string& data) override = 0;
- void Reset() override;
-
- 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, size_t length);
- void SimulateRead(const char* data) { SimulateRead(data, std::strlen(data)); }
-
- private:
- 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(DynamicSocketDataProvider);
-};
-
// SSLSocketDataProviders only need to keep track of the return code from calls
// to Connect().
struct SSLSocketDataProvider {
« 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