OLD | NEW |
(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 |
| 12 namespace remoting { |
| 13 namespace test { |
| 14 |
| 15 class FakeConnectionToHost : public remoting::protocol::ConnectionToHost { |
| 16 public: |
| 17 FakeConnectionToHost(); |
| 18 ~FakeConnectionToHost() override; |
| 19 |
| 20 // ConnectionToHost interface. |
| 21 void OnSessionStateChange(protocol::Session::State state) override; |
| 22 void OnVideoChannelStatus(bool active) override; |
| 23 |
| 24 // GMock does not work with methods which have scoped_ptr params so we define |
| 25 // a method which uses raw pointers instead. |
| 26 void ConnectPtr( |
| 27 SignalStrategy* signal_strategy, |
| 28 protocol::TransportFactory* transport_factory, |
| 29 protocol::Authenticator* authenticator, |
| 30 const std::string& host_jid, |
| 31 HostEventCallback* event_callback); |
| 32 |
| 33 void set_session_state_change_error_code(protocol::ErrorCode error) { |
| 34 session_state_change_error_code_ = error; |
| 35 } |
| 36 |
| 37 private: |
| 38 // ErrorCode set when OnSessionStateChange() is called with a FAILED state. |
| 39 protocol::ErrorCode session_state_change_error_code_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost); |
| 42 }; |
| 43 |
| 44 } // namespace test |
| 45 } // namespace remoting |
| 46 |
| 47 #endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ |
OLD | NEW |