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

Unified Diff: remoting/protocol/fake_authenticator.h

Issue 2808283002: Improve tests for Mixed-Case JIDs. (Closed)
Patch Set: . Created 3 years, 8 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_authenticator.h
diff --git a/remoting/protocol/fake_authenticator.h b/remoting/protocol/fake_authenticator.h
index 8d0ac2f21d18873771d5a81f0e0123414ed375eb..2302ed8238031970d8c6bde22daeb88ae0f8aeca 100644
--- a/remoting/protocol/fake_authenticator.h
+++ b/remoting/protocol/fake_authenticator.h
@@ -56,7 +56,24 @@ class FakeAuthenticator : public Authenticator {
REJECT_CHANNEL
};
- FakeAuthenticator(Type type, int round_trips, Action action, bool async);
+ struct Config {
+ Config();
+ Config(Action action);
+ Config(int round_trips, Action action, bool async);
+
+ int round_trips = 1;
+ Action action = Action::ACCEPT;
+ bool async = false;
+ };
+
+ FakeAuthenticator(Type type,
+ Config config,
+ const std::string& local_id,
+ const std::string& remote_id);
+
+ // Special constructor for authenticators in ACCEPTED or REJECTED state that
+ // don't exchange any messages.
+ FakeAuthenticator(Action action);
~FakeAuthenticator() override;
@@ -89,9 +106,9 @@ class FakeAuthenticator : public Authenticator {
protected:
const Type type_;
- const int round_trips_;
- const Action action_;
- const bool async_;
+ const Config config_;
+ const std::string local_id_;
+ const std::string remote_id_;
// Total number of messages that have been processed.
int messages_ = 0;
@@ -109,9 +126,8 @@ class FakeAuthenticator : public Authenticator {
class FakeHostAuthenticatorFactory : public AuthenticatorFactory {
public:
- FakeHostAuthenticatorFactory(
- int round_trips, int messages_till_start,
- FakeAuthenticator::Action action, bool async);
+ FakeHostAuthenticatorFactory(int messages_till_start,
+ FakeAuthenticator::Config config);
joedow 2017/04/11 16:20:34 nit: Config struct passed by const ref?
Sergey Ulanov 2017/04/11 21:14:20 That struct is only 12 bytes, not much bigger than
~FakeHostAuthenticatorFactory() override;
// AuthenticatorFactory interface.
@@ -120,10 +136,8 @@ class FakeHostAuthenticatorFactory : public AuthenticatorFactory {
const std::string& remote_jid) override;
private:
- const int round_trips_;
const int messages_till_started_;
- const FakeAuthenticator::Action action_;
- const bool async_;
+ const FakeAuthenticator::Config config_;
DISALLOW_COPY_AND_ASSIGN(FakeHostAuthenticatorFactory);
};
« no previous file with comments | « no previous file | remoting/protocol/fake_authenticator.cc » ('j') | remoting/protocol/jingle_session_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698