Index: remoting/protocol/fake_connection_to_host.h |
diff --git a/remoting/protocol/fake_connection_to_host.h b/remoting/protocol/fake_connection_to_host.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43b0f3b6ca1f5868c1d7e0362ee8111b1dd7a513 |
--- /dev/null |
+++ b/remoting/protocol/fake_connection_to_host.h |
@@ -0,0 +1,47 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ |
+#define REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ |
+ |
+#include <string> |
+ |
+#include "remoting/protocol/connection_to_host.h" |
+ |
+namespace remoting { |
+namespace test { |
+ |
+class FakeConnectionToHost : public remoting::protocol::ConnectionToHost { |
+ public: |
+ FakeConnectionToHost(); |
+ ~FakeConnectionToHost() override; |
+ |
+ // ConnectionToHost interface. |
+ void OnSessionStateChange(protocol::Session::State state) override; |
+ void OnVideoChannelStatus(bool active) override; |
+ |
+ // GMock does not work with methods which have scoped_ptr params so we define |
+ // a method which uses raw pointers instead. |
+ void ConnectPtr( |
+ SignalStrategy* signal_strategy, |
+ protocol::TransportFactory* transport_factory, |
+ protocol::Authenticator* authenticator, |
+ const std::string& host_jid, |
+ HostEventCallback* event_callback); |
+ |
+ void set_session_state_change_error_code(protocol::ErrorCode error) { |
+ session_state_change_error_code_ = error; |
+ } |
+ |
+ private: |
+ // ErrorCode set when OnSessionStateChange() is called with a FAILED state. |
+ protocol::ErrorCode session_state_change_error_code_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FakeConnectionToHost); |
+}; |
+ |
+} // namespace test |
+} // namespace remoting |
+ |
+#endif // REMOTING_PROTOCOL_FAKE_CONNECTION_TO_HOST_H_ |