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

Side by Side Diff: remoting/host/host_mock_objects.h

Issue 11778049: Making DesktopEnvironment a factory class used by ClientSession to create audio/video capturers and… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_ 5 #ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_
6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_ 6 #define REMOTING_HOST_HOST_MOCK_OBJECTS_H_
7 7
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "remoting/host/chromoting_host_context.h" 9 #include "remoting/host/chromoting_host_context.h"
10 #include "remoting/host/client_session.h" 10 #include "remoting/host/client_session.h"
11 #include "remoting/host/continue_window.h" 11 #include "remoting/host/continue_window.h"
12 #include "remoting/host/desktop_environment.h" 12 #include "remoting/host/desktop_environment.h"
13 #include "remoting/host/desktop_environment_factory.h" 13 #include "remoting/host/desktop_environment_factory.h"
14 #include "remoting/host/disconnect_window.h" 14 #include "remoting/host/disconnect_window.h"
15 #include "remoting/host/event_executor.h" 15 #include "remoting/host/event_executor.h"
16 #include "remoting/host/host_status_observer.h" 16 #include "remoting/host/host_status_observer.h"
17 #include "remoting/host/local_input_monitor.h" 17 #include "remoting/host/local_input_monitor.h"
18 #include "remoting/host/ui_strings.h" 18 #include "remoting/host/ui_strings.h"
19 #include "remoting/proto/control.pb.h" 19 #include "remoting/proto/control.pb.h"
20 #include "testing/gmock/include/gmock/gmock.h" 20 #include "testing/gmock/include/gmock/gmock.h"
21 21
22 namespace base {
23 class SingleThreadTaskRunner;
24 } // namespace base
25
22 namespace remoting { 26 namespace remoting {
23 27
28 class MockDesktopEnvironment : public DesktopEnvironment {
29 public:
30 MockDesktopEnvironment();
31 virtual ~MockDesktopEnvironment();
32
33 MOCK_METHOD1(CreateAudioCapturerPtr,
34 AudioCapturer*(scoped_refptr<base::SingleThreadTaskRunner>));
35 MOCK_METHOD2(CreateEventExecutorPtr,
36 EventExecutor*(scoped_refptr<base::SingleThreadTaskRunner>,
37 scoped_refptr<base::SingleThreadTaskRunner>));
38 MOCK_METHOD2(
39 CreateVideoCapturerPtr,
40 VideoFrameCapturer*(scoped_refptr<base::SingleThreadTaskRunner>,
41 scoped_refptr<base::SingleThreadTaskRunner>));
42
43 // DesktopEnvironment implementation.
44 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
45 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) OVERRIDE;
46 virtual scoped_ptr<EventExecutor> CreateEventExecutor(
47 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
48 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) OVERRIDE;
49 virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
50 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
51 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) OVERRIDE;
52 };
53
24 class MockDisconnectWindow : public DisconnectWindow { 54 class MockDisconnectWindow : public DisconnectWindow {
25 public: 55 public:
26 MockDisconnectWindow(); 56 MockDisconnectWindow();
27 virtual ~MockDisconnectWindow(); 57 virtual ~MockDisconnectWindow();
28 58
29 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings, 59 MOCK_METHOD3(Show, bool(const UiStrings& ui_strings,
30 const base::Closure& disconnect_callback, 60 const base::Closure& disconnect_callback,
31 const std::string& username)); 61 const std::string& username));
32 MOCK_METHOD0(Hide, void()); 62 MOCK_METHOD0(Hide, void());
33 }; 63 };
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const protocol::TransportRoute& route)); 100 const protocol::TransportRoute& route));
71 MOCK_METHOD2(OnClientDimensionsChanged, void(ClientSession* client, 101 MOCK_METHOD2(OnClientDimensionsChanged, void(ClientSession* client,
72 const SkISize& size)); 102 const SkISize& size));
73 103
74 private: 104 private:
75 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler); 105 DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler);
76 }; 106 };
77 107
78 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory { 108 class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
79 public: 109 public:
80 MockDesktopEnvironmentFactory(); 110 explicit MockDesktopEnvironmentFactory(
111 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner);
81 virtual ~MockDesktopEnvironmentFactory(); 112 virtual ~MockDesktopEnvironmentFactory();
82 113
83 MOCK_METHOD0(CreatePtr, DesktopEnvironment*()); 114 MOCK_METHOD0(CreatePtr, DesktopEnvironment*());
84 115
85 virtual scoped_ptr<DesktopEnvironment> Create() OVERRIDE; 116 virtual scoped_ptr<DesktopEnvironment> Create(
117 const std::string& client_jid,
118 const base::Closure& disconnect_callback) OVERRIDE;
86 119
87 private: 120 private:
88 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory); 121 DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory);
89 }; 122 };
90 123
91 class MockEventExecutor : public EventExecutor { 124 class MockEventExecutor : public EventExecutor {
92 public: 125 public:
93 MockEventExecutor(); 126 MockEventExecutor();
94 virtual ~MockEventExecutor(); 127 virtual ~MockEventExecutor();
95 128
(...skipping 23 matching lines...) Expand all
119 void(const std::string& jid, 152 void(const std::string& jid,
120 const std::string& channel_name, 153 const std::string& channel_name,
121 const protocol::TransportRoute& route)); 154 const protocol::TransportRoute& route));
122 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login)); 155 MOCK_METHOD1(OnStart, void(const std::string& xmpp_login));
123 MOCK_METHOD0(OnShutdown, void()); 156 MOCK_METHOD0(OnShutdown, void());
124 }; 157 };
125 158
126 } // namespace remoting 159 } // namespace remoting
127 160
128 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_ 161 #endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698