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

Unified Diff: remoting/protocol/fake_session.h

Issue 10836030: Add unittests for BufferedSocketWriter and fix some bugs in that code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « remoting/protocol/buffered_socket_writer_unittest.cc ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_session.h
diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h
index 5b59d90b3317e626d4e6475e6818a2104b20a6d0..848a2bf5e3c122c63ed43374c56e9e631869cc3f 100644
--- a/remoting/protocol/fake_session.h
+++ b/remoting/protocol/fake_session.h
@@ -40,6 +40,9 @@ class FakeSocket : public net::StreamSocket {
const std::string& written_data() const { return written_data_; }
+ void set_write_limit(int write_limit) { write_limit_ = write_limit; }
+ void set_async_write(bool async_write) { async_write_ = async_write; }
+ void set_next_write_error(int error) { next_write_error_ = error; }
void set_next_read_error(int error) { next_read_error_ = error; }
void AppendInputData(const std::vector<char>& data);
void PairWith(FakeSocket* peer_socket);
@@ -74,6 +77,15 @@ class FakeSocket : public net::StreamSocket {
virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE;
private:
+ void DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len,
+ const net::CompletionCallback& callback);
+ void DoWrite(net::IOBuffer* buf, int buf_len);
+
+ bool async_write_;
+ bool write_pending_;
+ int write_limit_;
+ int next_write_error_;
+
int next_read_error_;
bool read_pending_;
scoped_refptr<net::IOBuffer> read_buffer_;
« no previous file with comments | « remoting/protocol/buffered_socket_writer_unittest.cc ('k') | remoting/protocol/fake_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698