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

Unified Diff: remoting/protocol/fake_authenticator.h

Issue 2808283002: Improve tests for Mixed-Case JIDs. (Closed)
Patch Set: fix tests 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
« no previous file with comments | « no previous file | remoting/protocol/fake_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/fake_authenticator.h
diff --git a/remoting/protocol/fake_authenticator.h b/remoting/protocol/fake_authenticator.h
index 8d0ac2f21d18873771d5a81f0e0123414ed375eb..3c61e735978c82de5a44b5095349f055dc090bd8 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 = true;
+ };
+
+ 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);
~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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698