#include "remoting/host/desktop_session.h"
#include "remoting/host/desktop_session_connector.h"
#include "remoting/host/desktop_session_proxy.h"
+#include "remoting/host/fake_desktop_capturer.h"
+#include "remoting/host/fake_mouse_cursor_monitor.h"
#include "remoting/host/host_mock_objects.h"
#include "remoting/host/ipc_desktop_environment.h"
-#include "remoting/host/screen_capturer_fake.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
bool virtual_terminal);
void DisconnectTerminal(int terminal_id);
- // Creates a DesktopEnvironment with a fake webrtc::ScreenCapturer, to mock
+ // Creates a DesktopEnvironment with a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironmentFactory::Create().
DesktopEnvironment* CreateDesktopEnvironment();
// DesktopEnvironment::CreateInputInjector().
InputInjector* CreateInputInjector();
- // Creates a fake webrtc::ScreenCapturer, to mock
+ // Creates a fake webrtc::DesktopCapturer, to mock
// DesktopEnvironment::CreateVideoCapturer().
- webrtc::ScreenCapturer* CreateVideoCapturer();
+ webrtc::DesktopCapturer* CreateVideoCapturer();
+
+ // Creates a MockMouseCursorMonitor, to mock
+ // DesktopEnvironment::CreateMouseCursorMonitor
+ webrtc::MouseCursorMonitor* CreateMouseCursorMonitor();
void DeleteDesktopEnvironment();
scoped_ptr<ScreenControls> screen_controls_;
// The IPC screen capturer.
- scoped_ptr<webrtc::ScreenCapturer> video_capturer_;
+ scoped_ptr<webrtc::DesktopCapturer> video_capturer_;
// Represents the desktop process running in a user session.
scoped_ptr<DesktopProcess> desktop_process_;
// The last |terminal_id| passed to ConnectTermina();
int terminal_id_;
- webrtc::MockScreenCapturerCallback screen_capturer_callback_;
+ webrtc::MockScreenCapturerCallback desktop_capturer_callback_;
MockClientSessionControl client_session_control_;
base::WeakPtrFactory<ClientSessionControl> client_session_control_factory_;
.Times(AtMost(1))
.WillOnce(Invoke(
this, &IpcDesktopEnvironmentTest::CreateVideoCapturer));
+ EXPECT_CALL(*desktop_environment, CreateMouseCursorMonitorPtr())
+ .Times(AtMost(1))
+ .WillOnce(Invoke(
+ this, &IpcDesktopEnvironmentTest::CreateMouseCursorMonitor));
EXPECT_CALL(*desktop_environment, GetCapabilities())
.Times(AtMost(1));
EXPECT_CALL(*desktop_environment, SetCapabilities(_))
return remote_input_injector_;
}
-webrtc::ScreenCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
- return new ScreenCapturerFake();
+webrtc::DesktopCapturer* IpcDesktopEnvironmentTest::CreateVideoCapturer() {
+ return new FakeDesktopCapturer();
+}
+
+webrtc::MouseCursorMonitor*
+IpcDesktopEnvironmentTest::CreateMouseCursorMonitor() {
+ return new FakeMouseCursorMonitor();
}
void IpcDesktopEnvironmentTest::DeleteDesktopEnvironment() {
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Stop the test when the first frame is captured.
- EXPECT_CALL(screen_capturer_callback_, OnCaptureCompleted(_))
+ EXPECT_CALL(desktop_capturer_callback_, OnCaptureCompleted(_))
.WillOnce(DoAll(
DeleteArg<0>(),
InvokeWithoutArgs(
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();
// Start the input injector and screen capturer.
input_injector_->Start(clipboard_stub.PassAs<protocol::ClipboardStub>());
- video_capturer_->Start(&screen_capturer_callback_);
+ video_capturer_->Start(&desktop_capturer_callback_);
// Run the message loop until the desktop is attached.
setup_run_loop_->Run();