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

Unified Diff: remoting/protocol/fake_stream_socket.h

Issue 1536713005: Cleanup ChannelMultiplexer tests to avoid dependency on FakeSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection_tests
Patch Set: Created 5 years 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/channel_multiplexer_unittest.cc ('k') | remoting/protocol/fake_stream_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_stream_socket.h
diff --git a/remoting/protocol/fake_stream_socket.h b/remoting/protocol/fake_stream_socket.h
index c6a4a9cdc5c22ca2c2100215ac17d27d2cb3047e..bfa3fc9d0a40d74bdf8fea53c19115f23eab0cbd 100644
--- a/remoting/protocol/fake_stream_socket.h
+++ b/remoting/protocol/fake_stream_socket.h
@@ -79,20 +79,20 @@ class FakeStreamSocket : public P2PStreamSocket {
const net::CompletionCallback& callback);
void DoWrite(const scoped_refptr<net::IOBuffer>& buf, int buf_len);
- bool async_write_;
- bool write_pending_;
- int write_limit_;
- int next_write_error_;
+ bool async_write_ = false;
+ bool write_pending_ = false;
+ int write_limit_ = 0;
+ int next_write_error_ = 0;
- int next_read_error_;
+ int next_read_error_ = 0;
scoped_refptr<net::IOBuffer> read_buffer_;
- int read_buffer_size_;
+ int read_buffer_size_ = 0;
net::CompletionCallback read_callback_;
base::WeakPtr<FakeStreamSocket> peer_socket_;
std::string written_data_;
std::string input_data_;
- int input_pos_;
+ int input_pos_ = 0;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
base::WeakPtrFactory<FakeStreamSocket> weak_factory_;
@@ -112,6 +112,9 @@ class FakeStreamChannelFactory : public StreamChannelFactory {
void set_fail_create(bool fail_create) { fail_create_ = fail_create; }
+ // Enables asynchronous Write() on created channels.
+ void set_async_write(bool async_write) { async_write_ = async_write; }
+
FakeStreamSocket* GetFakeChannel(const std::string& name);
// Pairs the socket with |peer_socket|. Deleting either of the paired sockets
@@ -129,10 +132,12 @@ class FakeStreamChannelFactory : public StreamChannelFactory {
const ChannelCreatedCallback& callback);
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- bool asynchronous_create_;
- std::map<std::string, base::WeakPtr<FakeStreamSocket> > channels_;
+ bool asynchronous_create_ = false;
+ std::map<std::string, base::WeakPtr<FakeStreamSocket>> channels_;
+
+ bool fail_create_ = false;
- bool fail_create_;
+ bool async_write_ = false;
base::WeakPtr<FakeStreamChannelFactory> peer_factory_;
base::WeakPtrFactory<FakeStreamChannelFactory> weak_factory_;
« no previous file with comments | « remoting/protocol/channel_multiplexer_unittest.cc ('k') | remoting/protocol/fake_stream_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698