Index: remoting/protocol/fake_authenticator.cc |
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc |
index 67f5d351db99787732997151327ce0b282e08f58..8fd9f930ccc5e3b23fb92eac171ca25ea6d9dee4 100644 |
--- a/remoting/protocol/fake_authenticator.cc |
+++ b/remoting/protocol/fake_authenticator.cc |
@@ -79,12 +79,24 @@ void FakeChannelAuthenticator::OnAuthBytesRead(int result) { |
} |
FakeAuthenticator::FakeAuthenticator( |
+ Type type, int round_trips, int messages_till_started, |
+ Action action, bool async) |
+ : type_(type), |
+ round_trips_(round_trips), |
+ action_(action), |
+ async_(async), |
+ messages_(0), |
+ messages_till_started_(messages_till_started) { |
+} |
+ |
+FakeAuthenticator::FakeAuthenticator( |
Type type, int round_trips, Action action, bool async) |
: type_(type), |
round_trips_(round_trips), |
action_(action), |
async_(async), |
- messages_(0) { |
+ messages_(0), |
+ messages_till_started_(0) { |
} |
FakeAuthenticator::~FakeAuthenticator() { |
@@ -116,6 +128,10 @@ Authenticator::State FakeAuthenticator::state() const { |
} |
} |
+bool FakeAuthenticator::started() const { |
+ return messages_ > messages_till_started_; |
+} |
+ |
Authenticator::RejectionReason FakeAuthenticator::rejection_reason() const { |
EXPECT_EQ(REJECTED, state()); |
return INVALID_CREDENTIALS; |
@@ -153,8 +169,10 @@ FakeAuthenticator::CreateChannelAuthenticator() const { |
} |
FakeHostAuthenticatorFactory::FakeHostAuthenticatorFactory( |
- int round_trips, FakeAuthenticator::Action action, bool async) |
+ int round_trips, int messages_till_started, |
+ FakeAuthenticator::Action action, bool async) |
: round_trips_(round_trips), |
+ messages_till_started_(messages_till_started), |
action_(action), async_(async) { |
} |
@@ -166,7 +184,8 @@ scoped_ptr<Authenticator> FakeHostAuthenticatorFactory::CreateAuthenticator( |
const std::string& remote_jid, |
const buzz::XmlElement* first_message) { |
return scoped_ptr<Authenticator>(new FakeAuthenticator( |
- FakeAuthenticator::HOST, round_trips_, action_, async_)); |
+ FakeAuthenticator::HOST, round_trips_, |
+ messages_till_started_, action_, async_)); |
} |
} // namespace protocol |