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..ca6cb9c6f774d95d1c6c839085783e625eeaf746 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(); |
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.
|
+} |
+ |
+// Check touchEvents capability is set when the desktop environment can |
+// inject touch events. |
+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.
|
+ // Create an environment with multi touch enabled. |
+ desktop_environment_factory_->set_supports_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 touchEvents", |
+ 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( |