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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/host_mock_objects.h
diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h
index e8dd33a2d4f970c53c038d859d7afebc1b0e2b9b..eed38bad961ef3f7e0ffbf78f12eb8e5c6b20dca 100644
--- a/remoting/host/host_mock_objects.h
+++ b/remoting/host/host_mock_objects.h
@@ -19,8 +19,38 @@
#include "remoting/proto/control.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace remoting {
+class MockDesktopEnvironment : public DesktopEnvironment {
+ public:
+ MockDesktopEnvironment();
+ virtual ~MockDesktopEnvironment();
+
+ MOCK_METHOD1(CreateAudioCapturerPtr,
+ AudioCapturer*(scoped_refptr<base::SingleThreadTaskRunner>));
+ MOCK_METHOD2(CreateEventExecutorPtr,
+ EventExecutor*(scoped_refptr<base::SingleThreadTaskRunner>,
+ scoped_refptr<base::SingleThreadTaskRunner>));
+ MOCK_METHOD2(
+ CreateVideoCapturerPtr,
+ VideoFrameCapturer*(scoped_refptr<base::SingleThreadTaskRunner>,
+ scoped_refptr<base::SingleThreadTaskRunner>));
+
+ // DesktopEnvironment implementation.
+ virtual scoped_ptr<AudioCapturer> CreateAudioCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) OVERRIDE;
+ virtual scoped_ptr<EventExecutor> CreateEventExecutor(
+ scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) OVERRIDE;
+ virtual scoped_ptr<VideoFrameCapturer> CreateVideoCapturer(
+ scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) OVERRIDE;
+};
+
class MockDisconnectWindow : public DisconnectWindow {
public:
MockDisconnectWindow();
@@ -77,12 +107,15 @@ class MockClientSessionEventHandler : public ClientSession::EventHandler {
class MockDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
public:
- MockDesktopEnvironmentFactory();
+ explicit MockDesktopEnvironmentFactory(
+ scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner);
virtual ~MockDesktopEnvironmentFactory();
MOCK_METHOD0(CreatePtr, DesktopEnvironment*());
- virtual scoped_ptr<DesktopEnvironment> Create() OVERRIDE;
+ virtual scoped_ptr<DesktopEnvironment> Create(
+ const std::string& client_jid,
+ const base::Closure& disconnect_callback) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(MockDesktopEnvironmentFactory);

Powered by Google App Engine
This is Rietveld 408576698