| Index: remoting/protocol/fake_session.cc
|
| diff --git a/remoting/protocol/fake_session.cc b/remoting/protocol/fake_session.cc
|
| index 30a6ddb54ad4944b4ed7cc00fab2eb97f5755e3d..4915dce8c26ec4e0596759069082e3b543ab8ade 100644
|
| --- a/remoting/protocol/fake_session.cc
|
| +++ b/remoting/protocol/fake_session.cc
|
| @@ -18,7 +18,8 @@ namespace protocol {
|
| const char kTestJid[] = "host1@gmail.com/chromoting123";
|
|
|
| FakeSocket::FakeSocket()
|
| - : read_pending_(false),
|
| + : next_read_error_(net::OK),
|
| + read_pending_(false),
|
| read_buffer_size_(0),
|
| input_pos_(0),
|
| message_loop_(MessageLoop::current()),
|
| @@ -55,6 +56,13 @@ void FakeSocket::PairWith(FakeSocket* peer_socket) {
|
| int FakeSocket::Read(net::IOBuffer* buf, int buf_len,
|
| const net::CompletionCallback& callback) {
|
| EXPECT_EQ(message_loop_, MessageLoop::current());
|
| +
|
| + if (next_read_error_ != net::OK) {
|
| + int r = next_read_error_;
|
| + next_read_error_ = net::OK;
|
| + return r;
|
| + }
|
| +
|
| if (input_pos_ < static_cast<int>(input_data_.size())) {
|
| int result = std::min(buf_len,
|
| static_cast<int>(input_data_.size()) - input_pos_);
|
|
|