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

Side by Side Diff: remoting/host/ipc_desktop_environment_unittest.cc

Issue 2446053002: Use ChannelMojo between the remoting daemon and desktop processes. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « remoting/host/desktop_process_unittest.cc ('k') | remoting/host/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 scoped_refptr<AutoThreadTaskRunner> io_task_runner_; 208 scoped_refptr<AutoThreadTaskRunner> io_task_runner_;
209 209
210 std::string client_jid_; 210 std::string client_jid_;
211 211
212 // Clipboard stub that receives clipboard events from the desktop process. 212 // Clipboard stub that receives clipboard events from the desktop process.
213 protocol::ClipboardStub* clipboard_stub_; 213 protocol::ClipboardStub* clipboard_stub_;
214 214
215 // The daemons's end of the daemon-to-desktop channel. 215 // The daemons's end of the daemon-to-desktop channel.
216 std::unique_ptr<IPC::ChannelProxy> desktop_channel_; 216 std::unique_ptr<IPC::ChannelProxy> desktop_channel_;
217 217
218 // Name of the daemon-to-desktop channel.
219 std::string desktop_channel_name_;
220
221 // Delegate that is passed to |desktop_channel_|. 218 // Delegate that is passed to |desktop_channel_|.
222 MockDaemonListener desktop_listener_; 219 MockDaemonListener desktop_listener_;
223 220
224 FakeDaemonSender daemon_channel_; 221 FakeDaemonSender daemon_channel_;
225 222
226 std::unique_ptr<IpcDesktopEnvironmentFactory> desktop_environment_factory_; 223 std::unique_ptr<IpcDesktopEnvironmentFactory> desktop_environment_factory_;
227 std::unique_ptr<DesktopEnvironment> desktop_environment_; 224 std::unique_ptr<DesktopEnvironment> desktop_environment_;
228 225
229 // The IPC input injector. 226 // The IPC input injector.
230 std::unique_ptr<InputInjector> input_injector_; 227 std::unique_ptr<InputInjector> input_injector_;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 void IpcDesktopEnvironmentTest::ReflectClipboardEvent( 407 void IpcDesktopEnvironmentTest::ReflectClipboardEvent(
411 const protocol::ClipboardEvent& event) { 408 const protocol::ClipboardEvent& event) {
412 clipboard_stub_->InjectClipboardEvent(event); 409 clipboard_stub_->InjectClipboardEvent(event);
413 } 410 }
414 411
415 void IpcDesktopEnvironmentTest::CreateDesktopProcess() { 412 void IpcDesktopEnvironmentTest::CreateDesktopProcess() {
416 EXPECT_TRUE(task_runner_.get()); 413 EXPECT_TRUE(task_runner_.get());
417 EXPECT_TRUE(io_task_runner_.get()); 414 EXPECT_TRUE(io_task_runner_.get());
418 415
419 // Create the daemon end of the daemon-to-desktop channel. 416 // Create the daemon end of the daemon-to-desktop channel.
420 desktop_channel_name_ = IPC::Channel::GenerateUniqueRandomChannelID(); 417 mojo::MessagePipe pipe;
421 desktop_channel_ = IPC::ChannelProxy::Create( 418 desktop_channel_ = IPC::ChannelProxy::Create(
422 IPC::ChannelHandle(desktop_channel_name_), IPC::Channel::MODE_SERVER, 419 pipe.handle0.release(), IPC::Channel::MODE_SERVER, &desktop_listener_,
423 &desktop_listener_, io_task_runner_.get()); 420 io_task_runner_.get());
424 421
425 // Create and start the desktop process. 422 // Create and start the desktop process.
426 desktop_process_.reset(new DesktopProcess(task_runner_, 423 desktop_process_.reset(new DesktopProcess(
427 io_task_runner_, 424 task_runner_, io_task_runner_, io_task_runner_, std::move(pipe.handle1)));
428 desktop_channel_name_));
429 425
430 std::unique_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory( 426 std::unique_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory(
431 new MockDesktopEnvironmentFactory()); 427 new MockDesktopEnvironmentFactory());
432 EXPECT_CALL(*desktop_environment_factory, CreatePtr()) 428 EXPECT_CALL(*desktop_environment_factory, CreatePtr())
433 .Times(AnyNumber()) 429 .Times(AnyNumber())
434 .WillRepeatedly(Invoke( 430 .WillRepeatedly(Invoke(
435 this, &IpcDesktopEnvironmentTest::CreateDesktopEnvironment)); 431 this, &IpcDesktopEnvironmentTest::CreateDesktopEnvironment));
436 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture()) 432 EXPECT_CALL(*desktop_environment_factory, SupportsAudioCapture())
437 .Times(AnyNumber()) 433 .Times(AnyNumber())
438 .WillRepeatedly(Return(false)); 434 .WillRepeatedly(Return(false));
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 .WillOnce(InvokeWithoutArgs( 752 .WillOnce(InvokeWithoutArgs(
757 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment)); 753 this, &IpcDesktopEnvironmentTest::DeleteDesktopEnvironment));
758 754
759 // Change the desktop resolution. 755 // Change the desktop resolution.
760 screen_controls_->SetScreenResolution(ScreenResolution( 756 screen_controls_->SetScreenResolution(ScreenResolution(
761 webrtc::DesktopSize(100, 100), 757 webrtc::DesktopSize(100, 100),
762 webrtc::DesktopVector(96, 96))); 758 webrtc::DesktopVector(96, 96)));
763 } 759 }
764 760
765 } // namespace remoting 761 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_process_unittest.cc ('k') | remoting/host/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698