OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 Connect(); | 342 Connect(); |
343 | 343 |
344 std::unique_ptr<VideoStream> video_stream = | 344 std::unique_ptr<VideoStream> video_stream = |
345 host_connection_->StartVideoStream( | 345 host_connection_->StartVideoStream( |
346 base::WrapUnique(new TestScreenCapturer())); | 346 base::WrapUnique(new TestScreenCapturer())); |
347 | 347 |
348 WaitFirstVideoFrame(); | 348 WaitFirstVideoFrame(); |
349 } | 349 } |
350 | 350 |
| 351 TEST_P(ConnectionTest, DestroyOnIncomingMessage) { |
| 352 Connect(); |
| 353 |
| 354 KeyEvent event; |
| 355 event.set_usb_keycode(3); |
| 356 event.set_pressed(true); |
| 357 |
| 358 base::RunLoop run_loop; |
| 359 |
| 360 EXPECT_CALL(host_event_handler_, |
| 361 OnInputEventReceived(host_connection_.get(), _)); |
| 362 EXPECT_CALL(host_input_stub_, InjectKeyEvent(EqualsKeyEvent(event))) |
| 363 .WillOnce(DoAll(InvokeWithoutArgs(this, &ConnectionTest::DestroyHost), |
| 364 QuitRunLoop(&run_loop))); |
| 365 |
| 366 // Send key event from the client. |
| 367 client_connection_->input_stub()->InjectKeyEvent(event); |
| 368 |
| 369 run_loop.Run(); |
| 370 } |
| 371 |
351 } // namespace protocol | 372 } // namespace protocol |
352 } // namespace remoting | 373 } // namespace remoting |
OLD | NEW |