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

Side by Side Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues based on feedback 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 WillByDefault(ReturnNewDataTypeManager()); 120 WillByDefault(ReturnNewDataTypeManager());
121 121
122 if (issue_auth_token) { 122 if (issue_auth_token) {
123 IssueTestTokens(); 123 IssueTestTokens();
124 } 124 }
125 service->Initialize(); 125 service->Initialize();
126 } 126 }
127 } 127 }
128 128
129 void IssueTestTokens() { 129 void IssueTestTokens() {
130 ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory(
131 profile.get(), FakeOAuth2TokenService::BuildTokenService);
130 TokenService* token_service = 132 TokenService* token_service =
131 TokenServiceFactory::GetForProfile(profile.get()); 133 TokenServiceFactory::GetForProfile(profile.get());
132 token_service->IssueAuthTokenForTest( 134 token_service->IssueAuthTokenForTest(
133 GaiaConstants::kSyncService, "token1"); 135 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token");
134 token_service->IssueAuthTokenForTest(
135 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "token2");
136 } 136 }
137 137
138 scoped_ptr<TestProfileSyncService> service; 138 scoped_ptr<TestProfileSyncService> service;
139 scoped_ptr<TestingProfile> profile; 139 scoped_ptr<TestingProfile> profile;
140 140
141 private: 141 private:
142 base::MessageLoop ui_loop_; 142 base::MessageLoop ui_loop_;
143 // Needed by |service|. 143 // Needed by |service|.
144 content::TestBrowserThread ui_thread_; 144 content::TestBrowserThread ui_thread_;
145 content::TestBrowserThread db_thread_; 145 content::TestBrowserThread db_thread_;
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 namespace syncer { 629 namespace syncer {
630 namespace { 630 namespace {
631 631
632 // ProfileSyncService should behave just like an invalidator. 632 // ProfileSyncService should behave just like an invalidator.
633 INSTANTIATE_TYPED_TEST_CASE_P( 633 INSTANTIATE_TYPED_TEST_CASE_P(
634 ProfileSyncServiceInvalidatorTest, InvalidatorTest, 634 ProfileSyncServiceInvalidatorTest, InvalidatorTest,
635 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); 635 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate);
636 636
637 } // namespace 637 } // namespace
638 } // namespace syncer 638 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698