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

Unified 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 a unit test name 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698