| 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 "remoting/host/ipc_desktop_environment.h" | 5 #include "remoting/host/ipc_desktop_environment.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // Start the input injector and screen capturer. | 484 // Start the input injector and screen capturer. |
| 485 input_injector_->Start(std::move(clipboard_stub)); | 485 input_injector_->Start(std::move(clipboard_stub)); |
| 486 | 486 |
| 487 // Run the message loop until the desktop is attached. | 487 // Run the message loop until the desktop is attached. |
| 488 setup_run_loop_->Run(); | 488 setup_run_loop_->Run(); |
| 489 | 489 |
| 490 // Stop the test. | 490 // Stop the test. |
| 491 DeleteDesktopEnvironment(); | 491 DeleteDesktopEnvironment(); |
| 492 } | 492 } |
| 493 | 493 |
| 494 // Check Capabilities. | |
| 495 TEST_F(IpcDesktopEnvironmentTest, CapabilitiesNoTouch) { | |
| 496 std::unique_ptr<protocol::MockClipboardStub> clipboard_stub( | |
| 497 new protocol::MockClipboardStub()); | |
| 498 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | |
| 499 .Times(0); | |
| 500 | |
| 501 EXPECT_EQ("rateLimitResizeRequests", desktop_environment_->GetCapabilities()); | |
| 502 | |
| 503 // Start the input injector and screen capturer. | |
| 504 input_injector_->Start(std::move(clipboard_stub)); | |
| 505 | |
| 506 // Run the message loop until the desktop is attached. | |
| 507 setup_run_loop_->Run(); | |
| 508 | |
| 509 // Stop the test. | |
| 510 DeleteDesktopEnvironment(); | |
| 511 } | |
| 512 | |
| 513 // Check touchEvents capability is set when the desktop environment can | 494 // Check touchEvents capability is set when the desktop environment can |
| 514 // inject touch events. | 495 // inject touch events. |
| 515 TEST_F(IpcDesktopEnvironmentTest, TouchEventsCapabilities) { | 496 TEST_F(IpcDesktopEnvironmentTest, TouchEventsCapabilities) { |
| 516 // Create an environment with multi touch enabled. | 497 // Create an environment with multi touch enabled. |
| 517 desktop_environment_factory_->set_supports_touch_events(true); | |
| 518 desktop_environment_ = desktop_environment_factory_->Create( | 498 desktop_environment_ = desktop_environment_factory_->Create( |
| 519 client_session_control_factory_.GetWeakPtr()); | 499 client_session_control_factory_.GetWeakPtr()); |
| 520 | 500 |
| 521 std::unique_ptr<protocol::MockClipboardStub> clipboard_stub( | 501 std::unique_ptr<protocol::MockClipboardStub> clipboard_stub( |
| 522 new protocol::MockClipboardStub()); | 502 new protocol::MockClipboardStub()); |
| 523 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) | 503 EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) |
| 524 .Times(0); | 504 .Times(0); |
| 525 | 505 |
| 526 EXPECT_EQ("rateLimitResizeRequests touchEvents", | 506 std::string expected_capabilities = "rateLimitResizeRequests"; |
| 527 desktop_environment_->GetCapabilities()); | 507 if (InputInjector::SupportsTouchEvents()) |
| 508 expected_capabilities += " touchEvents"; |
| 509 |
| 510 EXPECT_EQ(expected_capabilities, desktop_environment_->GetCapabilities()); |
| 528 | 511 |
| 529 // Start the input injector and screen capturer. | 512 // Start the input injector and screen capturer. |
| 530 input_injector_->Start(std::move(clipboard_stub)); | 513 input_injector_->Start(std::move(clipboard_stub)); |
| 531 | 514 |
| 532 // Run the message loop until the desktop is attached. | 515 // Run the message loop until the desktop is attached. |
| 533 setup_run_loop_->Run(); | 516 setup_run_loop_->Run(); |
| 534 | 517 |
| 535 // Stop the test. | 518 // Stop the test. |
| 536 DeleteDesktopEnvironment(); | 519 DeleteDesktopEnvironment(); |
| 537 } | 520 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 .WillOnce(InvokeWithoutArgs( | 739 .WillOnce(InvokeWithoutArgs( |
| 757 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment)); | 740 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment)); |
| 758 | 741 |
| 759 // Change the desktop resolution. | 742 // Change the desktop resolution. |
| 760 screen_controls_->SetScreenResolution(ScreenResolution( | 743 screen_controls_->SetScreenResolution(ScreenResolution( |
| 761 webrtc::DesktopSize(100, 100), | 744 webrtc::DesktopSize(100, 100), |
| 762 webrtc::DesktopVector(96, 96))); | 745 webrtc::DesktopVector(96, 96))); |
| 763 } | 746 } |
| 764 | 747 |
| 765 } // namespace remoting | 748 } // namespace remoting |
| OLD | NEW |