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, Capabilities) { | |
|
Wez
2015/03/30 17:10:07
CapabilitiesNoTouch?
Rintaro Kuroiwa
2015/04/08 03:27:43
Renamed to NoTouchCapabilities and moved these tes
| |
| 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(); | |
| 483 } | |
| 484 | |
| 485 // Check multiTouch in capabilities. | |
| 486 TEST_F(IpcDesktopEnvironmentTest, MultiTouchCapabilities) { | |
| 487 // Create an environment with multi touch enabled. | |
| 488 desktop_environment_factory_->SetEnableMultiTouch(true); | |
| 489 desktop_environment_ = desktop_environment_factory_->Create( | |
| 490 client_session_control_factory_.GetWeakPtr()); | |
| 491 | |
| 492 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( | |
| 493 new protocol::MockClipboardStub()); | |
| 494 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | |
| 495 .Times(0); | |
| 496 | |
| 497 EXPECT_EQ("rateLimitResizeRequests multiTouch", | |
| 498 desktop_environment_->GetCapabilities()); | |
| 499 | |
| 500 // Start the input injector and screen capturer. | |
| 501 input_injector_->Start(clipboard_stub.Pass()); | |
| 502 | |
| 503 // Run the message loop until the desktop is attached. | |
| 504 setup_run_loop_->Run(); | |
| 505 | |
| 506 // Stop the test. | |
| 507 DeleteDesktopEnvironment(); | |
| 508 | |
| 509 task_runner_ = nullptr; | |
| 510 io_task_runner_ = nullptr; | |
| 511 main_run_loop_.Run(); | |
| 512 } | |
| 513 | |
| 462 // Tests that the video capturer receives a frame over IPC. | 514 // Tests that the video capturer receives a frame over IPC. |
| 463 TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) { | 515 TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) { |
| 464 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( | 516 scoped_ptr<protocol::MockClipboardStub> clipboard_stub( |
| 465 new protocol::MockClipboardStub()); | 517 new protocol::MockClipboardStub()); |
| 466 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | 518 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) |
| 467 .Times(0); | 519 .Times(0); |
| 468 | 520 |
| 469 // Start the input injector and screen capturer. | 521 // Start the input injector and screen capturer. |
| 470 input_injector_->Start(clipboard_stub.Pass()); | 522 input_injector_->Start(clipboard_stub.Pass()); |
| 471 video_capturer_->Start(&desktop_capturer_callback_); | 523 video_capturer_->Start(&desktop_capturer_callback_); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 screen_controls_->SetScreenResolution(ScreenResolution( | 765 screen_controls_->SetScreenResolution(ScreenResolution( |
| 714 webrtc::DesktopSize(100, 100), | 766 webrtc::DesktopSize(100, 100), |
| 715 webrtc::DesktopVector(96, 96))); | 767 webrtc::DesktopVector(96, 96))); |
| 716 | 768 |
| 717 task_runner_ = nullptr; | 769 task_runner_ = nullptr; |
| 718 io_task_runner_ = nullptr; | 770 io_task_runner_ = nullptr; |
| 719 main_run_loop_.Run(); | 771 main_run_loop_.Run(); |
| 720 } | 772 } |
| 721 | 773 |
| 722 } // namespace remoting | 774 } // namespace remoting |
| OLD | NEW |