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

Unified Diff: chrome/browser/sync/test_profile_sync_service.h

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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: chrome/browser/sync/test_profile_sync_service.h
diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h
index 42c5aa0c97dbd39fb509383184f8c16466b3bed0..dd76f2c75ca275bb72f0f756427f41c399906827 100644
--- a/chrome/browser/sync/test_profile_sync_service.h
+++ b/chrome/browser/sync/test_profile_sync_service.h
@@ -11,6 +11,9 @@
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/invalidation/invalidator_storage.h"
+#include "chrome/browser/signin/oauth2_token_service.h"
+#include "chrome/browser/signin/profile_oauth2_token_service.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/sync/glue/data_type_manager_impl.h"
#include "chrome/browser/sync/profile_sync_components_factory_mock.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -128,6 +131,10 @@ class TestProfileSyncService : public ProfileSyncService {
virtual ~TestProfileSyncService();
+ virtual void RequestAccessToken() OVERRIDE;
+ virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
+ const GoogleServiceAuthError& error) OVERRIDE;
+
virtual void OnBackendInitialized(
const syncer::WeakHandle<syncer::JsBackend>& backend,
const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
@@ -188,4 +195,18 @@ class TestProfileSyncService : public ProfileSyncService {
syncer::StorageOption storage_option_;
};
+
+class FakeOAuth2TokenService : public ProfileOAuth2TokenService {
+ public:
+ explicit FakeOAuth2TokenService(net::URLRequestContextGetter* getter)
+ : ProfileOAuth2TokenService(getter) {}
+
+ virtual scoped_ptr<OAuth2TokenService::Request> StartRequest(
+ const OAuth2TokenService::ScopeSet& scopes,
+ OAuth2TokenService::Consumer* consumer) OVERRIDE;
+
+ static BrowserContextKeyedService* BuildTokenService(
+ content::BrowserContext* context);
+};
+
#endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
« no previous file with comments | « chrome/browser/sync/test/integration/sync_errors_test.cc ('k') | chrome/browser/sync/test_profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698