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

Unified Diff: remoting/host/setup/oauth_client.cc

Issue 1099553003: Added unit tests for getCredentialsFromAuthCode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/host/setup/oauth_client.cc
diff --git a/remoting/host/setup/oauth_client.cc b/remoting/host/setup/oauth_client.cc
index 684ab2c2d84e4cdc99b3424bdf5a62a7d0a5196d..f2dfbb32a181cb4e4aa91ebaa3fd33e475fea571 100644
--- a/remoting/host/setup/oauth_client.cc
+++ b/remoting/host/setup/oauth_client.cc
@@ -12,15 +12,18 @@ const int kMaxGaiaRetries = 3;
namespace remoting {
-OAuthClient::OAuthClient(
+OAuthClient::~OAuthClient() {
+}
+
+GaiaOAuthClient::GaiaOAuthClient(
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter)
: gaia_oauth_client_(url_request_context_getter.get()) {
}
-OAuthClient::~OAuthClient() {
+GaiaOAuthClient::~GaiaOAuthClient() {
}
-void OAuthClient::GetCredentialsFromAuthCode(
+void GaiaOAuthClient::GetCredentialsFromAuthCode(
const gaia::OAuthClientInfo& oauth_client_info,
const std::string& auth_code,
CompletionCallback on_done) {
@@ -36,7 +39,7 @@ void OAuthClient::GetCredentialsFromAuthCode(
kMaxGaiaRetries, this);
}
-void OAuthClient::OnGetTokensResponse(
+void GaiaOAuthClient::OnGetTokensResponse(
const std::string& refresh_token,
const std::string& access_token,
int expires_in_seconds) {
@@ -45,15 +48,16 @@ void OAuthClient::OnGetTokensResponse(
gaia_oauth_client_.GetUserEmail(access_token, kMaxGaiaRetries, this);
}
-void OAuthClient::OnRefreshTokenResponse(
+void GaiaOAuthClient::OnRefreshTokenResponse(
const std::string& access_token,
int expires_in_seconds) {
// We never request a refresh token, so this call is not expected.
NOTREACHED();
}
-void OAuthClient::SendResponse(const std::string& user_email,
- const std::string& refresh_token) {
+void GaiaOAuthClient::SendResponse(
+ const std::string& user_email,
+ const std::string& refresh_token) {
CompletionCallback on_done = on_done_;
on_done_.Reset();
on_done.Run(user_email, refresh_token);
@@ -68,19 +72,19 @@ void OAuthClient::SendResponse(const std::string& user_email,
}
}
-void OAuthClient::OnGetUserEmailResponse(const std::string& user_email) {
+void GaiaOAuthClient::OnGetUserEmailResponse(const std::string& user_email) {
SendResponse(user_email, refresh_token_);
}
-void OAuthClient::OnOAuthError() {
+void GaiaOAuthClient::OnOAuthError() {
SendResponse("", "");
}
-void OAuthClient::OnNetworkError(int response_code) {
+void GaiaOAuthClient::OnNetworkError(int response_code) {
SendResponse("", "");
}
-OAuthClient::Request::Request(
+GaiaOAuthClient::Request::Request(
const gaia::OAuthClientInfo& oauth_client_info,
const std::string& auth_code,
CompletionCallback on_done) {
@@ -89,7 +93,7 @@ OAuthClient::Request::Request(
this->on_done = on_done;
}
-OAuthClient::Request::~Request() {
+GaiaOAuthClient::Request::~Request() {
}
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698