diff options
Diffstat (limited to 'google_apis/gaia/fake_oauth2_token_service.h')
-rw-r--r-- | google_apis/gaia/fake_oauth2_token_service.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/google_apis/gaia/fake_oauth2_token_service.h b/google_apis/gaia/fake_oauth2_token_service.h index 2554bd4..8c267e5 100644 --- a/google_apis/gaia/fake_oauth2_token_service.h +++ b/google_apis/gaia/fake_oauth2_token_service.h @@ -5,6 +5,7 @@ #ifndef GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_H_ #define GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_H_ +#include <set> #include <string> #include "base/compiler_specific.h" @@ -20,6 +21,12 @@ class FakeOAuth2TokenService : public OAuth2TokenService { FakeOAuth2TokenService(); virtual ~FakeOAuth2TokenService(); + void AddAccount(const std::string& account_id); + + void set_request_context(net::URLRequestContextGetter* request_context) { + request_context_ = request_context; + } + protected: // OAuth2TokenService overrides. virtual void FetchOAuth2Token(RequestImpl* request, @@ -34,13 +41,21 @@ class FakeOAuth2TokenService : public OAuth2TokenService { const ScopeSet& scopes, const std::string& access_token) OVERRIDE; - virtual std::string GetRefreshToken(const std::string& account_id) - const OVERRIDE; + virtual bool RefreshTokenIsAvailable(const std::string& account_id) const + OVERRIDE; private: // OAuth2TokenService overrides. virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; + virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher( + const std::string& account_id, + net::URLRequestContextGetter* getter, + OAuth2AccessTokenConsumer* consumer) OVERRIDE; + + std::set<std::string> account_ids_; + net::URLRequestContextGetter* request_context_; // weak + DISALLOW_COPY_AND_ASSIGN(FakeOAuth2TokenService); }; |