Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / remoting / protocol / fake_connection_to_host.h
blob1c3fe4019e07b4fa81f5210678b3ae09c3685686
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.
5 #ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
6 #define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_
8 #include <string>
10 #include "remoting/protocol/connection_to_host.h"
11 #include "remoting/protocol/protocol_mock_objects.h"
13 namespace remoting {
14 namespace test {
16 class FakeConnectionToHost : public protocol::ConnectionToHost {
17 public:
18 FakeConnectionToHost();
19 ~FakeConnectionToHost() override;
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;
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);
44 // Calls OnConnectionReady on the |event_callback_| with the supplied bool.
45 void SignalConnectionReady(bool ready);
47 private:
48 void SetState(State state, protocol::ErrorCode error);
50 State state_;
52 HostEventCallback* event_callback_;
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 scoped_ptr<protocol::SessionConfig> session_config_;
59 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost);
62 } // namespace test
63 } // namespace remoting
65 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_