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

Unified Diff: remoting/protocol/message_reader_unittest.cc

Issue 2757723002: Update ICE protocol to handle closed channel (Closed)
Patch Set: . Created 3 years, 9 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/message_reader.cc ('k') | remoting/protocol/stream_message_pipe_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/message_reader_unittest.cc
diff --git a/remoting/protocol/message_reader_unittest.cc b/remoting/protocol/message_reader_unittest.cc
index 02bf273960f828b5e5d3ad435fd9e15a9cbe73d0..f67466a12dad5914abeb7f49cfefdeb24d381e8f 100644
--- a/remoting/protocol/message_reader_unittest.cc
+++ b/remoting/protocol/message_reader_unittest.cc
@@ -149,7 +149,7 @@ TEST_F(MessageReaderTest, TwoMessages_Separately) {
// Read() returns error.
TEST_F(MessageReaderTest, ReadError) {
- socket_.AppendReadError(net::ERR_FAILED);
+ socket_.SetReadError(net::ERR_FAILED);
EXPECT_CALL(callback_, OnMessage()).Times(0);
@@ -159,6 +159,18 @@ TEST_F(MessageReaderTest, ReadError) {
EXPECT_FALSE(reader_);
}
+// Read() returns 0 (end of stream).
+TEST_F(MessageReaderTest, EndOfStream) {
+ socket_.SetReadError(0);
+
+ EXPECT_CALL(callback_, OnMessage()).Times(0);
+
+ InitReader();
+
+ EXPECT_EQ(0, read_error_);
+ EXPECT_FALSE(reader_);
+}
+
// Verify that we the OnMessage callback is not reentered.
TEST_F(MessageReaderTest, ReadFromCallback) {
AddMessage(kTestMessage1);
« no previous file with comments | « remoting/protocol/message_reader.cc ('k') | remoting/protocol/stream_message_pipe_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698