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

Unified Diff: chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc

Issue 8248002: Merge 103908 - Extend GaiaOAuthFetcher with support for revoking tokens. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: Created 9 years, 2 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 | « chrome/browser/net/gaia/gaia_oauth_fetcher.cc ('k') | chrome/common/net/gaia/oauth_request_signer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc
===================================================================
--- chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc (revision 105055)
+++ chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc (working copy)
@@ -74,6 +74,10 @@
MOCK_METHOD1(OnUserInfoSuccess, void(const std::string& email));
MOCK_METHOD1(OnUserInfoFailure, void(const GoogleServiceAuthError& error));
+
+ MOCK_METHOD0(OnOAuthRevokeTokenSuccess, void());
+ MOCK_METHOD1(OnOAuthRevokeTokenFailure,
+ void(const GoogleServiceAuthError& error));
};
class MockGaiaOAuthFetcher : public GaiaOAuthFetcher {
@@ -200,7 +204,7 @@
TestingProfile profile;
MockGaiaOAuthFetcher oauth_fetcher(&consumer,
- profile .GetRequestContext(),
+ profile.GetRequestContext(),
&profile,
"service_scope-0fL85iOi");
EXPECT_CALL(oauth_fetcher, StartUserInfo(wrap_token)).Times(1);
@@ -228,7 +232,7 @@
TestingProfile profile;
MockGaiaOAuthFetcher oauth_fetcher(&consumer,
- profile .GetRequestContext(),
+ profile.GetRequestContext(),
&profile,
"service_scope-Nrj4LmgU");
@@ -241,3 +245,22 @@
cookies,
data);
}
+
+TEST_F(GaiaOAuthFetcherTest, OAuthRevokeToken) {
+ const std::string token = "1/OAuth2-Access_Token-nopqrstuvwxyz1234567890";
+ MockGaiaOAuthConsumer consumer;
+ EXPECT_CALL(consumer,
+ OnOAuthRevokeTokenSuccess()).Times(1);
+
+ TestingProfile profile;
+ MockGaiaOAuthFetcher oauth_fetcher(&consumer,
+ profile.GetRequestContext(),
+ &profile,
+ "service_scope-Nrj4LmgU");
+
+ net::ResponseCookies cookies;
+ net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
+ GURL url(GaiaUrls::GetInstance()->oauth_revoke_token_url());
+ oauth_fetcher.OnURLFetchComplete(NULL, url, status,
+ RC_REQUEST_OK, cookies, std::string());
+}
« no previous file with comments | « chrome/browser/net/gaia/gaia_oauth_fetcher.cc ('k') | chrome/common/net/gaia/oauth_request_signer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698