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

Unified Diff: remoting/protocol/client_video_dispatcher_unittest.cc

Issue 1143443003: Fix MessageReader to pass errors to the channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « remoting/protocol/channel_multiplexer.cc ('k') | remoting/protocol/message_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/client_video_dispatcher_unittest.cc
diff --git a/remoting/protocol/client_video_dispatcher_unittest.cc b/remoting/protocol/client_video_dispatcher_unittest.cc
index 92087b3357a595b5afe026f00110515ce5ef2476..5bf908cefe6b0be60aa24d1cc15cee4cb0ab6fe7 100644
--- a/remoting/protocol/client_video_dispatcher_unittest.cc
+++ b/remoting/protocol/client_video_dispatcher_unittest.cc
@@ -36,6 +36,7 @@ class ClientVideoDispatcherTest : public testing::Test,
protected:
void OnVideoAck(scoped_ptr<VideoAck> ack, const base::Closure& done);
+ void OnReadError(int error);
base::MessageLoop message_loop_;
@@ -72,7 +73,9 @@ ClientVideoDispatcherTest::ClientVideoDispatcherTest()
DCHECK(initialized_);
host_socket_.PairWith(
session_.fake_channel_factory().GetFakeChannel(kVideoChannelName));
- reader_.StartReading(&host_socket_);
+ reader_.StartReading(&host_socket_,
+ base::Bind(&ClientVideoDispatcherTest::OnReadError,
+ base::Unretained(this)));
writer_.Init(&host_socket_, BufferedSocketWriter::WriteFailedCallback());
}
@@ -101,6 +104,10 @@ void ClientVideoDispatcherTest::OnVideoAck(scoped_ptr<VideoAck> ack,
done.Run();
}
+void ClientVideoDispatcherTest::OnReadError(int error) {
+ LOG(FATAL) << "Unexpected read error: " << error;
+}
+
// Verify that the client can receive video packets and acks are not sent for
// VideoPackets that don't have frame_id field set.
TEST_F(ClientVideoDispatcherTest, WithoutAcks) {
« no previous file with comments | « remoting/protocol/channel_multiplexer.cc ('k') | remoting/protocol/message_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698