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

Side by Side Diff: remoting/protocol/fake_connection_to_host.h

Issue 976233003: Adding the base ChromotingInstance implementation and unittests. This class will be used by the ap… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Release Build Break Created 5 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2015 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_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
7
8 #include <string>
9
10 #include "remoting/protocol/connection_to_host.h"
11 #include "remoting/protocol/protocol_mock_objects.h"
12
13 namespace remoting {
14 namespace test {
15
16 class FakeConnectionToHost : public protocol::ConnectionToHost {
17 public:
18 FakeConnectionToHost();
19 ~FakeConnectionToHost() override;
20
21 // ConnectionToHost interface.
22 void set_candidate_config(
23 scoped_ptr<protocol::CandidateSessionConfig> config) override;
24 void set_client_stub(protocol::ClientStub* client_stub) override;
25 void set_clipboard_stub(protocol::ClipboardStub* clipboard_stub) override;
26 void set_video_stub(protocol::VideoStub* video_stub) override;
27 void set_audio_stub(protocol::AudioStub* audio_stub) override;
28 void Connect(SignalStrategy* signal_strategy,
29 scoped_ptr<protocol::TransportFactory> transport_factory,
30 scoped_ptr<protocol::Authenticator> authenticator,
31 const std::string& host_jid,
32 HostEventCallback* event_callback) override;
33 const protocol::SessionConfig& config() override;
34 protocol::ClipboardStub* clipboard_forwarder() override;
35 protocol::HostStub* host_stub() override;
36 protocol::InputStub* input_stub() override;
37 State state() const override;
38
39 // Calls OnConnectionState on the |event_callback_| with the supplied state
40 // and error.
41 void SignalStateChange(protocol::Session::State state,
42 protocol::ErrorCode error);
43
44 // Calls OnConnectionReady on the |event_callback_| with the supplied bool.
45 void SignalConnectionReady(bool ready);
46
47 private:
48 void SetState(State state, protocol::ErrorCode error);
49
50 State state_;
51
52 HostEventCallback* event_callback_;
53
54 testing::NiceMock<protocol::MockClipboardStub> mock_clipboard_stub_;
55 testing::NiceMock<protocol::MockHostStub> mock_host_stub_;
56 testing::NiceMock<protocol::MockInputStub> mock_input_stub_;
57 protocol::SessionConfig session_config_;
58
59 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost);
60 };
61
62 } // namespace test
63 } // namespace remoting
64
65 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698