Revert of Remove OneClickSigninHelper since it is no longer used. (patchset #5 id...
[chromium-blink-merge.git] / remoting / host / host_mock_objects.h
blob6ea9d7b1ef72eff1bb2d9d44c8cd97ff15a47330
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(InjectTouchEvent, void(const protocol::TouchEvent& event));
116 MOCK_METHOD1(StartPtr,
117 void(protocol::ClipboardStub* client_clipboard));
119 void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard);
121 private:
122 DISALLOW_COPY_AND_ASSIGN(MockInputInjector);
125 class MockHostStatusObserver : public HostStatusObserver {
126 public:
127 MockHostStatusObserver();
128 virtual ~MockHostStatusObserver();
130 MOCK_METHOD1(OnAccessDenied, void(const std::string& jid));
131 MOCK_METHOD1(OnClientAuthenticated, void(const std::string& jid));
132 MOCK_METHOD1(OnClientConnected, void(const std::string& jid));
133 MOCK_METHOD1(OnClientDisconnected, void(const std::string& jid));
134 MOCK_METHOD3(OnClientRouteChange,
135 void(const std::string& jid,
136 const std::string& channel_name,
137 const protocol::TransportRoute& route));
138 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login));
139 MOCK_METHOD0(OnShutdown, void());
142 class MockGnubbyAuthHandler : public GnubbyAuthHandler {
143 public:
144 MockGnubbyAuthHandler();
145 virtual ~MockGnubbyAuthHandler();
147 MOCK_METHOD1(DeliverClientMessage, void(const std::string& message));
148 MOCK_CONST_METHOD2(DeliverHostDataMessage,
149 void(int connection_id, const std::string& data));
151 private:
152 DISALLOW_COPY_AND_ASSIGN(MockGnubbyAuthHandler);
155 class MockMouseCursorMonitor : public webrtc::MouseCursorMonitor {
156 public:
157 MockMouseCursorMonitor();
158 virtual ~MockMouseCursorMonitor();
160 MOCK_METHOD2(Init, void(Callback* callback, Mode mode));
161 MOCK_METHOD0(Capture, void());
163 private:
164 DISALLOW_COPY_AND_ASSIGN(MockMouseCursorMonitor);
167 } // namespace remoting
169 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_