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

Unified Diff: remoting/protocol/protocol_mock_objects.h

Issue 2277553002: Adding a new authenticator which can be used to validate the remote user (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy_change
Patch Set: Addressing Feedback Created 4 years, 4 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/protocol_mock_objects.h
diff --git a/remoting/protocol/protocol_mock_objects.h b/remoting/protocol/protocol_mock_objects.h
index 4d0302591641b3f5a240d4036a0c35b081601995..015086677fd8d7c7c23875f3e9871510d010a2c6 100644
--- a/remoting/protocol/protocol_mock_objects.h
+++ b/remoting/protocol/protocol_mock_objects.h
@@ -5,9 +5,9 @@
#ifndef REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_
#define REMOTING_PROTOCOL_PROTOCOL_MOCK_OBJECTS_H_
-#include <stdint.h>
-
+#include <cstdint>
#include <map>
+#include <memory>
#include <string>
#include "base/location.h"
@@ -19,6 +19,7 @@
#include "remoting/proto/internal.pb.h"
#include "remoting/proto/video.pb.h"
#include "remoting/protocol/authenticator.h"
+#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/connection_to_client.h"
@@ -30,10 +31,39 @@
#include "remoting/protocol/transport.h"
#include "remoting/protocol/video_stub.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "third_party/webrtc/libjingle/xmllite/xmlelement.h"
namespace remoting {
namespace protocol {
+class MockAuthenticator : public Authenticator {
+ public:
+ MockAuthenticator();
+ ~MockAuthenticator() override;
+
+ MOCK_CONST_METHOD0(state, Authenticator::State());
+ MOCK_CONST_METHOD0(started, bool());
+ MOCK_CONST_METHOD0(rejection_reason, Authenticator::RejectionReason());
+ MOCK_CONST_METHOD0(GetAuthKey, const std::string&());
+ MOCK_CONST_METHOD0(CreateChannelAuthenticatorPtr, ChannelAuthenticator*());
+ MOCK_METHOD2(ProcessMessage,
+ void(const buzz::XmlElement* message,
+ const base::Closure& resume_callback));
+ MOCK_METHOD0(GetNextMessagePtr, buzz::XmlElement*());
+
+ std::unique_ptr<ChannelAuthenticator> CreateChannelAuthenticator()
+ const override {
+ return base::WrapUnique(CreateChannelAuthenticatorPtr());
+ }
+
+ std::unique_ptr<buzz::XmlElement> GetNextMessage() override {
+ return base::WrapUnique(GetNextMessagePtr());
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockAuthenticator);
+};
+
class MockConnectionToClientEventHandler
: public ConnectionToClient::EventHandler {
public:

Powered by Google App Engine
This is Rietveld 408576698