Index: remoting/host/ipc_desktop_environment_unittest.cc |
diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc |
index d31d3d46acd51160f2aae5e3b6084cd03b66e202..7299d026251defe79c26b2fc6d65f24f880faa26 100644 |
--- a/remoting/host/ipc_desktop_environment_unittest.cc |
+++ b/remoting/host/ipc_desktop_environment_unittest.cc |
@@ -459,6 +459,59 @@ TEST_F(IpcDesktopEnvironmentTest, Basic) { |
main_run_loop_.Run(); |
} |
+// Check Capabilities. |
+TEST_F(IpcDesktopEnvironmentTest, CapabilitiesNoTouch) { |
+ scoped_ptr<protocol::MockClipboardStub> clipboard_stub( |
+ new protocol::MockClipboardStub()); |
+ EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) |
+ .Times(0); |
+ |
+ EXPECT_EQ("rateLimitResizeRequests", desktop_environment_->GetCapabilities()); |
+ |
+ // Start the input injector and screen capturer. |
+ input_injector_->Start(clipboard_stub.Pass()); |
+ |
+ // Run the message loop until the desktop is attached. |
+ setup_run_loop_->Run(); |
+ |
+ // Stop the test. |
+ DeleteDesktopEnvironment(); |
+ |
+ task_runner_ = nullptr; |
+ io_task_runner_ = nullptr; |
+ main_run_loop_.Run(); |
+} |
+ |
+// Check rawTouchEvents capability is set when the desktop environment can |
+// inject touch events. |
+TEST_F(IpcDesktopEnvironmentTest, RawTouchEventsCapabilities) { |
+ // Create an environment with multi touch enabled. |
+ desktop_environment_factory_->set_supports_raw_touch_events(true); |
+ desktop_environment_ = desktop_environment_factory_->Create( |
+ client_session_control_factory_.GetWeakPtr()); |
+ |
+ scoped_ptr<protocol::MockClipboardStub> clipboard_stub( |
+ new protocol::MockClipboardStub()); |
+ EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_)) |
+ .Times(0); |
+ |
+ EXPECT_EQ("rateLimitResizeRequests rawTouchEvents", |
+ desktop_environment_->GetCapabilities()); |
+ |
+ // Start the input injector and screen capturer. |
+ input_injector_->Start(clipboard_stub.Pass()); |
+ |
+ // Run the message loop until the desktop is attached. |
+ setup_run_loop_->Run(); |
+ |
+ // Stop the test. |
+ DeleteDesktopEnvironment(); |
+ |
+ task_runner_ = nullptr; |
+ io_task_runner_ = nullptr; |
+ main_run_loop_.Run(); |
+} |
+ |
// Tests that the video capturer receives a frame over IPC. |
TEST_F(IpcDesktopEnvironmentTest, CaptureFrame) { |
scoped_ptr<protocol::MockClipboardStub> clipboard_stub( |