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

Unified Diff: remoting/protocol/negotiating_authenticator_unittest.cc

Issue 12326090: Third Party authentication protocol. (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Add the missing new files Created 7 years, 10 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/negotiating_authenticator_unittest.cc
diff --git a/remoting/protocol/negotiating_authenticator_unittest.cc b/remoting/protocol/negotiating_authenticator_unittest.cc
index 213502247d32e46527664e61a4853a8fb174b4f2..ef1b3cc0428902c09b254c43b5aaa248970704e1 100644
--- a/remoting/protocol/negotiating_authenticator_unittest.cc
+++ b/remoting/protocol/negotiating_authenticator_unittest.cc
@@ -41,6 +41,18 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
}
protected:
+ class MockTokenFetcher
+ : public protocol::ThirdPartyAuthenticator::TokenFetcher {
+ public:
+ MOCK_METHOD4(FetchThirdPartyToken, void(
+ const std::string& token_url,
+ const std::string& host_public_key,
+ const std::string& scope,
+ const base::Callback<void(
+ const std::string& token,
+ const std::string& shared_secret)>& on_token_fetched));
+ };
+
void InitAuthenticators(
const std::string& client_secret,
const std::string& host_secret,
@@ -48,7 +60,7 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
bool client_hmac_only) {
std::string host_secret_hash = AuthenticationMethod::ApplyHashFunction(
hash_function, kTestHostId, host_secret);
- host_ = NegotiatingAuthenticator::CreateForHost(
+ host_ = NegotiatingAuthenticator::CreateForHostSharedSecret(
host_cert_, key_pair_->Copy(), host_secret_hash, hash_function);
std::vector<AuthenticationMethod> methods;
@@ -59,7 +71,8 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
AuthenticationMethod::NONE));
}
client_ = NegotiatingAuthenticator::CreateForClient(
- kTestHostId, client_secret, methods);
+ kTestHostId, client_secret, host_public_key_, methods,
+ &mock_token_fetcher_);
}
void VerifyRejected(Authenticator::RejectionReason reason) {
@@ -69,6 +82,7 @@ class NegotiatingAuthenticatorTest : public AuthenticatorTestBase {
(host_->rejection_reason() == reason)));
}
+ MockTokenFetcher mock_token_fetcher_;
DISALLOW_COPY_AND_ASSIGN(NegotiatingAuthenticatorTest);
};

Powered by Google App Engine
This is Rietveld 408576698