Revert of Report viewport memory and timing correctly for Slimming Paint. (patchset...
[chromium-blink-merge.git] / remoting / host / host_mock_objects.h
blobeb35e19a18cd925b68e5060a19e41120c4a1ab89
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_
6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_
8 #include <string>
10 #include "net/base/ip_endpoint.h"
11 #include "remoting/host/chromoting_host_context.h"
12 #include "remoting/host/client_session.h"
13 #include "remoting/host/client_session_control.h"
14 #include "remoting/host/desktop_environment.h"
15 #include "remoting/host/gnubby_auth_handler.h"
16 #include "remoting/host/host_status_observer.h"
17 #include "remoting/host/input_injector.h"
18 #include "remoting/host/screen_controls.h"
19 #include "remoting/host/screen_resolution.h"
20 #include "remoting/proto/control.pb.h"
21 #include "testing/gmock/include/gmock/gmock.h"
22 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
24 namespace base {
25 class SingleThreadTaskRunner;
26 } // namespace base
28 namespace remoting {
30 class MockDesktopEnvironment : public DesktopEnvironment {
31 public:
32 MockDesktopEnvironment();
33 virtual ~MockDesktopEnvironment();
35 MOCK_METHOD0(CreateAudioCapturerPtr, AudioCapturer*());
36 MOCK_METHOD0(CreateInputInjectorPtr, InputInjector*());
37 MOCK_METHOD0(CreateScreenControlsPtr, ScreenControls*());
38 MOCK_METHOD0(CreateVideoCapturerPtr, webrtc::DesktopCapturer*());
39 MOCK_METHOD0(CreateMouseCursorMonitorPtr, webrtc::MouseCursorMonitor*());
40 MOCK_CONST_METHOD0(GetCapabilities, std::string());
41 MOCK_METHOD1(SetCapabilities, void(const std::string&));
42 MOCK_METHOD1(CreateGnubbyAuthHandlerPtr, GnubbyAuthHandler*(
43 protocol::ClientStub* client_stub));
45 // DesktopEnvironment implementation.
46 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() override;
47 virtual scoped_ptr<InputInjector> CreateInputInjector() override;
48 virtual scoped_ptr<ScreenControls> CreateScreenControls() override;
49 virtual scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer() override;
50 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
51 protocol::ClientStub* client_stub) override;
52 virtual scoped_ptr<webrtc::MouseCursorMonitor> CreateMouseCursorMonitor()
53 override;
56 class MockClientSessionControl : public ClientSessionControl {
57 public:
58 MockClientSessionControl();
59 virtual ~MockClientSessionControl();
61 MOCK_CONST_METHOD0(client_jid, const std::string&());
62 MOCK_METHOD0(DisconnectSession, void());
63 MOCK_METHOD1(OnLocalMouseMoved, void(const webrtc::DesktopVector&));
64 MOCK_METHOD1(SetDisableInputs, void(bool));
65 MOCK_METHOD0(ResetVideoPipeline, void());
67 private:
68 DISALLOW_COPY_AND_ASSIGN(MockClientSessionControl);
71 class MockClientSessionEventHandler : public ClientSession::EventHandler {
72 public:
73 MockClientSessionEventHandler();
74 virtual ~MockClientSessionEventHandler();
76 MOCK_METHOD1(OnSessionAuthenticating, void(ClientSession* client));
77 MOCK_METHOD1(OnSessionAuthenticated, bool(ClientSession* client));
78 MOCK_METHOD1(OnSessionChannelsConnected, void(ClientSession* client));
79 MOCK_METHOD1(OnSessionAuthenticationFailed, void(ClientSession* client));
80 MOCK_METHOD1(OnSessionClosed, void(ClientSession* client));
81 MOCK_METHOD3(OnSessionRouteChange, void(
82 ClientSession* client,
83 const std::string& channel_name,
84 const protocol::TransportRoute& route));
86 private:
87 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler);
90 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
91 public:
92 MockDesktopEnvironmentFactory();
93 virtual ~MockDesktopEnvironmentFactory();
95 MOCK_METHOD0(CreatePtr, DesktopEnvironment*());
96 MOCK_CONST_METHOD0(SupportsAudioCapture, bool());
98 virtual scoped_ptr<DesktopEnvironment> Create(
99 base::WeakPtr<ClientSessionControl> client_session_control) override;
101 private:
102 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory);
105 class MockInputInjector : public InputInjector {
106 public:
107 MockInputInjector();
108 virtual ~MockInputInjector();
110 MOCK_METHOD1(InjectClipboardEvent,
111 void(const protocol::ClipboardEvent& event));
112 MOCK_METHOD1(InjectKeyEvent, void(const protocol::KeyEvent& event));
113 MOCK_METHOD1(InjectTextEvent, void(const protocol::TextEvent& event));
114 MOCK_METHOD1(InjectMouseEvent, void(const protocol::MouseEvent& event));
115 MOCK_METHOD1(StartPtr,
116 void(protocol::ClipboardStub* client_clipboard));
118 void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard);
120 private:
121 DISALLOW_COPY_AND_ASSIGN(MockInputInjector);
124 class MockHostStatusObserver : public HostStatusObserver {
125 public:
126 MockHostStatusObserver();
127 virtual ~MockHostStatusObserver();
129 MOCK_METHOD1(OnAccessDenied, void(const std::string& jid));
130 MOCK_METHOD1(OnClientAuthenticated, void(const std::string& jid));
131 MOCK_METHOD1(OnClientConnected, void(const std::string& jid));
132 MOCK_METHOD1(OnClientDisconnected, void(const std::string& jid));
133 MOCK_METHOD3(OnClientRouteChange,
134 void(const std::string& jid,
135 const std::string& channel_name,
136 const protocol::TransportRoute& route));
137 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login));
138 MOCK_METHOD0(OnShutdown, void());
141 class MockGnubbyAuthHandler : public GnubbyAuthHandler {
142 public:
143 MockGnubbyAuthHandler();
144 virtual ~MockGnubbyAuthHandler();
146 MOCK_METHOD1(DeliverClientMessage, void(const std::string& message));
147 MOCK_CONST_METHOD2(DeliverHostDataMessage,
148 void(int connection_id, const std::string& data));
150 private:
151 DISALLOW_COPY_AND_ASSIGN(MockGnubbyAuthHandler);
154 class MockMouseCursorMonitor : public webrtc::MouseCursorMonitor {
155 public:
156 MockMouseCursorMonitor();
157 virtual ~MockMouseCursorMonitor();
159 MOCK_METHOD2(Init, void(Callback* callback, Mode mode));
160 MOCK_METHOD0(Capture, void());
162 private:
163 DISALLOW_COPY_AND_ASSIGN(MockMouseCursorMonitor);
166 } // namespace remoting
168 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_