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

Unified Diff: remoting/host/ipc_desktop_environment_unittest.cc

Issue 15855004: Fixed a typo in DesktopSessionProxy::SetScreenResolution(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 7 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
« no previous file with comments | « remoting/host/desktop_session_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e2138d298cf83a5b03ce527172a5e58f14be2a6b..25b47d535be8c4595e45c98e02641dfc1d392315 100644
--- a/remoting/host/ipc_desktop_environment_unittest.cc
+++ b/remoting/host/ipc_desktop_environment_unittest.cc
@@ -59,6 +59,7 @@ class FakeDaemonSender : public IPC::Sender {
MOCK_METHOD3(ConnectTerminal, void(int, const ScreenResolution&, bool));
MOCK_METHOD1(DisconnectTerminal, void(int));
+ MOCK_METHOD2(SetScreenResolution, void(int, const ScreenResolution&));
private:
void OnMessageReceived(const IPC::Message& message);
@@ -95,6 +96,8 @@ void FakeDaemonSender::OnMessageReceived(const IPC::Message& message) {
ConnectTerminal)
IPC_MESSAGE_HANDLER(ChromotingNetworkHostMsg_DisconnectTerminal,
DisconnectTerminal)
+ IPC_MESSAGE_HANDLER(ChromotingNetworkDaemonMsg_SetScreenResolution,
+ SetScreenResolution)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -191,6 +194,9 @@ class IpcDesktopEnvironmentTest : public testing::Test {
// The IPC input injector.
scoped_ptr<InputInjector> input_injector_;
+ // The IPC screen controls.
+ scoped_ptr<ScreenControls> screen_controls_;
+
// The IPC screen capturer.
scoped_ptr<media::ScreenCapturer> video_capturer_;
@@ -276,6 +282,8 @@ void IpcDesktopEnvironmentTest::SetUp() {
desktop_environment_ = desktop_environment_factory_->Create(
client_session_control_factory_.GetWeakPtr());
+ screen_controls_ = desktop_environment_->CreateScreenControls();
+
// Create the input injector.
input_injector_ = desktop_environment_->CreateInputInjector();
@@ -343,6 +351,7 @@ media::ScreenCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
void IpcDesktopEnvironmentTest::DeleteDesktopEnvironment() {
input_injector_.reset();
+ screen_controls_.reset();
video_capturer_.reset();
// Trigger DisconnectTerminal().
@@ -618,4 +627,33 @@ TEST_F(IpcDesktopEnvironmentTest, InjectMouseEvent) {
main_run_loop_.Run();
}
+// Tests that setting the desktop resolution works.
+TEST_F(IpcDesktopEnvironmentTest, SetScreenResolution) {
+ scoped_ptr<protocol::MockClipboardStub> clipboard_stub(
+ new protocol::MockClipboardStub());
+ EXPECT_CALL(*clipboard_stub, InjectClipboardEvent(_))
+ .Times(0);
+
+ // Start the input injector and screen capturer.
+ input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
+ video_capturer_->Start(&screen_capturer_callback_);
+
+ // Run the message loop until the desktop is attached.
+ setup_run_loop_->Run();
+
+ EXPECT_CALL(daemon_channel_, SetScreenResolution(_, _))
+ .Times(1)
+ .WillOnce(InvokeWithoutArgs(
+ this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment));
+
+ // Change the desktop resolution.
+ screen_controls_->SetScreenResolution(ScreenResolution(
+ webrtc::DesktopSize(100, 100),
+ webrtc::DesktopVector(96, 96)));
+
+ task_runner_ = NULL;
+ io_task_runner_ = NULL;
+ main_run_loop_.Run();
+}
+
} // namespace remoting
« no previous file with comments | « remoting/host/desktop_session_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698