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

Unified Diff: remoting/host/host_mock_objects.h

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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/host/host_mock_objects.h
diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h
index b5f1db9b810ff79a231adecc0d8b232710253531..027a83e5bd2cefa95342b6e7e2f8ed91f7456819 100644
--- a/remoting/host/host_mock_objects.h
+++ b/remoting/host/host_mock_objects.h
@@ -5,11 +5,16 @@
#ifndef REMOTING_HOST_HOST_MOCK_OBJECTS_H_
#define REMOTING_HOST_HOST_MOCK_OBJECTS_H_
+#include <string>
+
#include "net/base/ip_endpoint.h"
#include "remoting/host/chromoting_host_context.h"
#include "remoting/host/client_session.h"
#include "remoting/host/client_session_control.h"
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/gnubby_auth_handler.h"
+#include "remoting/host/gnubby_connection.h"
+#include "remoting/host/gnubby_connection_factory.h"
#include "remoting/host/host_status_observer.h"
#include "remoting/host/input_injector.h"
#include "remoting/host/screen_controls.h"
@@ -126,6 +131,59 @@ class MockHostStatusObserver : public HostStatusObserver {
MOCK_METHOD0(OnShutdown, void());
};
+class MockGnubbyAuthHandler : public GnubbyAuthHandler {
+ public:
+ MockGnubbyAuthHandler(
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ GnubbyConnectionFactory* gnubby_connection_factory,
+ protocol::ClientStub* client_stub);
+ virtual ~MockGnubbyAuthHandler();
+
+ MOCK_METHOD1(DeliverClientMessage, void(const std::string message));
+ MOCK_METHOD1(ConnectionClosed, void(int connection_id));
+ MOCK_METHOD2(ConnectionError, void(int connection_id, int result));
+ MOCK_CONST_METHOD2(DeliverHostControlMessage,
+ void(const std::string control_type,
+ const std::string data));
+ MOCK_CONST_METHOD2(DeliverHostDataMessage,
+ void(int connection_id, const std::string data));
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockGnubbyAuthHandler);
+};
+
+class MockGnubbyConnection : public GnubbyConnection {
+ public:
+ MockGnubbyConnection(
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ GnubbyAuthHandler* auth_handler,
+ int connection_id,
+ net::StreamSocket* socket);
+ virtual ~MockGnubbyConnection();
+
+ MOCK_METHOD0(Read, void());
+ MOCK_METHOD1(Write, void(const std::string& data));
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockGnubbyConnection);
+};
+
+class MockGnubbyConnectionFactory : public GnubbyConnectionFactory {
+ public:
+ MockGnubbyConnectionFactory();
+ virtual ~MockGnubbyConnectionFactory();
+
+ MOCK_METHOD4(Create,
+ GnubbyConnection*(scoped_refptr<base::SingleThreadTaskRunner>
+ network_task_runner,
+ GnubbyAuthHandler* auth_handler,
+ int connection_id,
+ net::StreamSocket* socket));
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockGnubbyConnectionFactory);
+};
+
} // namespace remoting
#endif // REMOTING_HOST_HOST_MOCK_OBJECTS_H_

Powered by Google App Engine
This is Rietveld 408576698