summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfgorski@chromium.org <fgorski@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 21:46:30 +0000
committerfgorski@chromium.org <fgorski@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-23 21:46:30 +0000
commit39310fd42acfed12b9a344a2e884e6769acfd574 (patch)
tree866703bfd6a368d2df245907440b625f6671c462
parentd567e739c702b5076623e2d1b8a508e1a23567ea (diff)
downloadchromium_src-39310fd42acfed12b9a344a2e884e6769acfd574.zip
chromium_src-39310fd42acfed12b9a344a2e884e6769acfd574.tar.gz
chromium_src-39310fd42acfed12b9a344a2e884e6769acfd574.tar.bz2
Removing O2TS.StartRequest OVERRIDE from test_profile_sync_service.cc
(This is part of removing virtual keyword from O2TS.StartRequest) Dependent on https://codereview.chromium.org/23382008/ BUG=282454 Review URL: https://chromiumcodereview.appspot.com/24269011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224802 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/test_profile_sync_service.cc24
-rw-r--r--chrome/browser/sync/test_profile_sync_service.h13
2 files changed, 21 insertions, 16 deletions
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index 4c89ec7..92d3828 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -321,18 +321,20 @@ void TestProfileSyncService::CreateBackend() {
storage_option_));
}
-scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest(
+void FakeOAuth2TokenService::FetchOAuth2Token(
+ OAuth2TokenService::RequestImpl* request,
const std::string& account_id,
- const OAuth2TokenService::ScopeSet& scopes,
- OAuth2TokenService::Consumer* consumer) {
- // Ensure token in question is cached and never expires. Request will succeed
- // without network IO.
- RegisterCacheEntry("test_client_id",
- account_id,
- scopes,
- "access_token",
- base::Time::Max());
- return ProfileOAuth2TokenService::StartRequest(account_id, scopes, consumer);
+ net::URLRequestContextGetter* getter,
+ const std::string& client_id,
+ const std::string& client_secret,
+ const OAuth2TokenService::ScopeSet& scopes) {
+ // Request will succeed without network IO.
+ base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
+ &RequestImpl::InformConsumer,
+ request->AsWeakPtr(),
+ GoogleServiceAuthError(GoogleServiceAuthError::NONE),
+ "access_token",
+ base::Time::Max()));
}
BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService(
diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h
index bc272bc..999ea58 100644
--- a/chrome/browser/sync/test_profile_sync_service.h
+++ b/chrome/browser/sync/test_profile_sync_service.h
@@ -198,15 +198,18 @@ class TestProfileSyncService : public ProfileSyncService {
class FakeOAuth2TokenService : public ProfileOAuth2TokenService {
public:
- virtual scoped_ptr<OAuth2TokenService::Request> StartRequest(
- const std::string& account_id,
- const OAuth2TokenService::ScopeSet& scopes,
- OAuth2TokenService::Consumer* consumer) OVERRIDE;
-
static BrowserContextKeyedService* BuildTokenService(
content::BrowserContext* context);
protected:
+ virtual void FetchOAuth2Token(
+ OAuth2TokenService::RequestImpl* request,
+ const std::string& account_id,
+ net::URLRequestContextGetter* getter,
+ const std::string& client_id,
+ const std::string& client_secret,
+ const OAuth2TokenService::ScopeSet& scopes) OVERRIDE;
+
virtual void PersistCredentials(const std::string& account_id,
const std::string& refresh_token) OVERRIDE;