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

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: Addressing Sergey's feedback 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..9d5b68691ee677ac964101cd9505fda7b20d766d
--- /dev/null
+++ b/remoting/protocol/fake_connection_to_host.h
@@ -0,0 +1,49 @@
+// 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"
+#include "remoting/protocol/protocol_mock_objects.h"
+
+namespace remoting {
+namespace test {
+
+class FakeConnectionToHost : public remoting::protocol::ConnectionToHost {
Sergey Ulanov 2015/03/11 00:09:51 don't need remoting::
joedow 2015/03/11 19:06:39 Done.
+ public:
+ FakeConnectionToHost();
+ ~FakeConnectionToHost() override;
+
+ // ConnectionToHost interface.
Sergey Ulanov 2015/03/11 00:09:51 s/interface/overrides/. ConnectionToHost is not an
joedow 2015/03/11 19:06:39 Left this as interface since now ConnectionToHost
+ void Connect(SignalStrategy* signal_strategy,
+ scoped_ptr<protocol::TransportFactory> transport_factory,
+ scoped_ptr<protocol::Authenticator> authenticator,
+ const std::string& host_jid,
+ HostEventCallback* event_callback) override;
+ void OnSessionStateChange(protocol::Session::State state) override;
+ void OnVideoChannelStatus(bool active) override;
+ const protocol::SessionConfig& config() override;
+ protocol::HostStub* host_stub() override;
+
+ 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_;
+
+ testing::NiceMock<protocol::MockHostStub> mock_host_stub_;
+ protocol::SessionConfig session_config_;
+
+ 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