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

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

Issue 394883008: Add basic perf tests for chromoting protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « remoting/host/client_session.cc ('k') | remoting/host/fake_desktop_environment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
6 #define REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
7
8 #include "remoting/host/desktop_environment.h"
9 #include "remoting/host/fake_screen_capturer.h"
10 #include "remoting/host/input_injector.h"
11 #include "remoting/host/screen_controls.h"
12
13 namespace remoting {
14
15 class FakeInputInjector : public InputInjector {
16 public:
17 FakeInputInjector();
18 virtual ~FakeInputInjector();
19
20 virtual void Start(
21 scoped_ptr<protocol::ClipboardStub> client_clipboard) OVERRIDE;
22 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
23 virtual void InjectTextEvent(const protocol::TextEvent& event) OVERRIDE;
24 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
25 virtual void InjectClipboardEvent(
26 const protocol::ClipboardEvent& event) OVERRIDE;
27 };
28
29 class FakeScreenControls : public ScreenControls {
30 public:
31 FakeScreenControls();
32 virtual ~FakeScreenControls();
33
34 // ScreenControls implementation.
35 virtual void SetScreenResolution(const ScreenResolution& resolution) OVERRIDE;
36 };
37
38 class FakeDesktopEnvironment : public DesktopEnvironment {
39 public:
40 FakeDesktopEnvironment();
41 virtual ~FakeDesktopEnvironment();
42
43 // Sets frame generator to be used for FakeScreenCapturer created by
44 // FakeDesktopEnvironment.
45 void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) {
46 frame_generator_ = frame_generator;
47 }
48
49 // DesktopEnvironment implementation.
50 virtual scoped_ptr<AudioCapturer> CreateAudioCapturer() OVERRIDE;
51 virtual scoped_ptr<InputInjector> CreateInputInjector() OVERRIDE;
52 virtual scoped_ptr<ScreenControls> CreateScreenControls() OVERRIDE;
53 virtual scoped_ptr<webrtc::ScreenCapturer> CreateVideoCapturer() OVERRIDE;
54 virtual std::string GetCapabilities() const OVERRIDE;
55 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE;
56 virtual scoped_ptr<GnubbyAuthHandler> CreateGnubbyAuthHandler(
57 protocol::ClientStub* client_stub) OVERRIDE;
58
59 private:
60 FakeScreenCapturer::FrameGenerator frame_generator_;
61
62 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironment);
63 };
64
65 class FakeDesktopEnvironmentFactory : public DesktopEnvironmentFactory {
66 public:
67 FakeDesktopEnvironmentFactory();
68 virtual ~FakeDesktopEnvironmentFactory();
69
70 // Sets frame generator to be used for FakeScreenCapturer created by
71 // FakeDesktopEnvironment.
72 void set_frame_generator(FakeScreenCapturer::FrameGenerator frame_generator) {
73 frame_generator_ = frame_generator;
74 }
75
76 // DesktopEnvironmentFactory implementation.
77 virtual scoped_ptr<DesktopEnvironment> Create(
78 base::WeakPtr<ClientSessionControl> client_session_control) OVERRIDE;
79 virtual void SetEnableCurtaining(bool enable) OVERRIDE;
80 virtual bool SupportsAudioCapture() const OVERRIDE;
81 virtual void SetEnableGnubbyAuth(bool enable) OVERRIDE;
82
83 private:
84 FakeScreenCapturer::FrameGenerator frame_generator_;
85
86 DISALLOW_COPY_AND_ASSIGN(FakeDesktopEnvironmentFactory);
87 };
88
89 } // namespace remoting
90
91 #endif // REMOTING_HOST_FAKE_DESKTOP_ENVIRONMENT_H_
OLDNEW
« no previous file with comments | « remoting/host/client_session.cc ('k') | remoting/host/fake_desktop_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698