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

Unified Diff: remoting/protocol/connection_unittest.cc

Issue 2172153005: Ensure that connection can be closed in response to a data message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass all tests Created 4 years, 5 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 | « no previous file | remoting/protocol/webrtc_data_stream_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_unittest.cc
diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc
index aba7ba3e1735ac60f0ac3aa887a738f8d9ef7875..4f7b3627e5f660c6abc1385ea6559569cd3931ba 100644
--- a/remoting/protocol/connection_unittest.cc
+++ b/remoting/protocol/connection_unittest.cc
@@ -348,5 +348,26 @@ TEST_P(ConnectionTest, VideoWithSlowSignaling) {
WaitFirstVideoFrame();
}
+TEST_P(ConnectionTest, DestroyOnIncomingMessage) {
+ Connect();
+
+ KeyEvent event;
+ event.set_usb_keycode(3);
+ event.set_pressed(true);
+
+ base::RunLoop run_loop;
+
+ EXPECT_CALL(host_event_handler_,
+ OnInputEventReceived(host_connection_.get(), _));
+ EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(event)))
+ .WillOnce(DoAll(InvokeWithoutArgs(this, &ConnectionTest::DestroyHost),
+ QuitRunLoop(&run_loop)));
+
+ // Send key event from the client.
+ client_connection_->input_stub()->InjectKeyEvent(event);
+
+ run_loop.Run();
+}
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « no previous file | remoting/protocol/webrtc_data_stream_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698