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()); |
+} |