Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 setup_run_loop_->Run(); | 452 setup_run_loop_->Run(); |
| 453 | 453 |
| 454 // Stop the test. | 454 // Stop the test. |
| 455 DeleteDesktopEnvironment(); | 455 DeleteDesktopEnvironment(); |
| 456 | 456 |
| 457 task_runner_ = nullptr; | 457 task_runner_ = nullptr; |
| 458 io_task_runner_ = nullptr; | 458 io_task_runner_ = nullptr; |
| 459 main_run_loop_.Run(); | 459 main_run_loop_.Run(); |
| 460 } | 460 } |
| 461 | 461 |
| 462 // Check Capabilities. | |
| 463 TEST_F(IpcDesktopEnvironmentTest, CapabilitiesNoTouch) { | |
| 464 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( | |
| 465 new protocol::MockClipboardStub()); | |
| 466 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | |
| 467 .Times(0); | |
| 468 | |
| 469 EXPECT_EQ("rateLimitResizeRequests", desktop_environment_->GetCapabilities()); | |
| 470 | |
| 471 // Start the input injector and screen capturer. | |
| 472 input_injector_->Start(clipboard_stub.Pass()); | |
| 473 | |
| 474 // Run the message loop until the desktop is attached. | |
| 475 setup_run_loop_->Run(); | |
| 476 | |
| 477 // Stop the test. | |
| 478 DeleteDesktopEnvironment(); | |
| 479 | |
| 480 task_runner_ = nullptr; | |
| 481 io_task_runner_ = nullptr; | |
| 482 main_run_loop_.Run(); | |
|
Wez
2015/05/21 00:59:14
nit: Consider moving these three lines into a RunM
Rintaro Kuroiwa
2015/05/21 21:53:29
Oh, this 3 lines are duplicated in all tests. Mayb
Wez
2015/05/21 22:10:45
That's a good idea, yes.
Rintaro Kuroiwa
2015/05/22 01:04:04
Done.
| |
| 483 } | |
| 484 | |
| 485 // Check touchEvents capability is set when the desktop environment can | |
| 486 // inject touch events. | |
| 487 TEST_F(IpcDesktopEnvironmentTest, RawTouchEventsCapabilities) { | |
|
Wez
2015/05/21 00:59:14
nit: Rename test, since capability has changed.
Rintaro Kuroiwa
2015/05/21 21:53:29
Done.
| |
| 488 // Create an environment with multi touch enabled. | |
| 489 desktop_environment_factory_->set_supports_touch_events(true); | |
| 490 desktop_environment_ = desktop_environment_factory_->Create( | |
| 491 client_session_control_factory_.GetWeakPtr()); | |
| 492 | |
| 493 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( | |
| 494 new protocol::MockClipboardStub()); | |
| 495 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | |
| 496 .Times(0); | |
| 497 | |
| 498 EXPECT_EQ("rateLimitResizeRequests touchEvents", | |
| 499 desktop_environment_->GetCapabilities()); | |
| 500 | |
| 501 // Start the input injector and screen capturer. | |
| 502 input_injector_->Start(clipboard_stub.Pass()); | |
| 503 | |
| 504 // Run the message loop until the desktop is attached. | |
| 505 setup_run_loop_->Run(); | |
| 506 | |
| 507 // Stop the test. | |
| 508 DeleteDesktopEnvironment(); | |
| 509 | |
| 510 task_runner_ = nullptr; | |
| 511 io_task_runner_ = nullptr; | |
| 512 main_run_loop_.Run(); | |
| 513 } | |
| 514 | |
| 462 // Tests that the video capturer receives a frame over IPC. | 515 // Tests that the video capturer receives a frame over IPC. |
| 463 TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) { | 516 TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) { |
| 464 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( | 517 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( |
| 465 new protocol::MockClipboardStub()); | 518 new protocol::MockClipboardStub()); |
| 466 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | 519 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) |
| 467 .Times(0); | 520 .Times(0); |
| 468 | 521 |
| 469 // Start the input injector and screen capturer. | 522 // Start the input injector and screen capturer. |
| 470 input_injector_->Start(clipboard_stub.Pass()); | 523 input_injector_->Start(clipboard_stub.Pass()); |
| 471 video_capturer_->Start(&desktop_capturer_callback_); | 524 video_capturer_->Start(&desktop_capturer_callback_); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 screen_controls_->SetScreenResolution(ScreenResolution( | 766 screen_controls_->SetScreenResolution(ScreenResolution( |
| 714 webrtc::DesktopSize(100, 100), | 767 webrtc::DesktopSize(100, 100), |
| 715 webrtc::DesktopVector(96, 96))); | 768 webrtc::DesktopVector(96, 96))); |
| 716 | 769 |
| 717 task_runner_ = nullptr; | 770 task_runner_ = nullptr; |
| 718 io_task_runner_ = nullptr; | 771 io_task_runner_ = nullptr; |
| 719 main_run_loop_.Run(); | 772 main_run_loop_.Run(); |
| 720 } | 773 } |
| 721 | 774 |
| 722 } // namespace remoting | 775 } // namespace remoting |
| OLD | NEW |