Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: remoting/host/ipc_desktop_environment_unittest.cc

Issue 1033913003: Touch Events capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add capabiility_names.h Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698