| Index: remoting/protocol/connection_to_client_unittest.cc
|
| diff --git a/remoting/protocol/connection_to_client_unittest.cc b/remoting/protocol/connection_to_client_unittest.cc
|
| index bb73a8f3d1cb36ffee2a2f72329c9af936cd83ca..378ac3e86c43f21b519bac021096c3b8d6a65543 100644
|
| --- a/remoting/protocol/connection_to_client_unittest.cc
|
| +++ b/remoting/protocol/connection_to_client_unittest.cc
|
| @@ -55,6 +55,8 @@ TEST_F(ConnectionToClientTest, SendUpdateStream) {
|
| viewer_->video_stub()->ProcessVideoPacket(
|
| packet, new DeleteTask<VideoPacket>(packet));
|
|
|
| + message_loop_.RunAllPending();
|
| +
|
| // And then close the connection to ConnectionToClient.
|
| viewer_->Disconnect();
|
|
|
| @@ -65,6 +67,21 @@ TEST_F(ConnectionToClientTest, SendUpdateStream) {
|
| EXPECT_GT(session_->video_channel()->written_data().size(), 0u);
|
| }
|
|
|
| +TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) {
|
| + // Then send the actual data.
|
| + VideoPacket* packet = new VideoPacket();
|
| + viewer_->video_stub()->ProcessVideoPacket(
|
| + packet, new DeleteTask<VideoPacket>(packet));
|
| +
|
| + // And then close the connection to ConnectionToClient.
|
| + viewer_->Disconnect();
|
| +
|
| + message_loop_.RunAllPending();
|
| +
|
| + // Nothing should be written because connection has been closed.
|
| + EXPECT_EQ(session_->video_channel()->written_data().size(), 0u);
|
| +}
|
| +
|
| TEST_F(ConnectionToClientTest, StateChange) {
|
| EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get()));
|
| session_->state_change_callback()->Run(protocol::Session::CLOSED);
|
|
|