OLD | NEW |
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 Loading... |
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( | 136 token_service->IssueAuthTokenForTest( |
135 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "token2"); | 137 GaiaConstants::kSyncService, "token"); |
136 } | 138 } |
137 | 139 |
138 scoped_ptr<TestProfileSyncService> service; | 140 scoped_ptr<TestProfileSyncService> service; |
139 scoped_ptr<TestingProfile> profile; | 141 scoped_ptr<TestingProfile> profile; |
140 | 142 |
141 private: | 143 private: |
142 base::MessageLoop ui_loop_; | 144 base::MessageLoop ui_loop_; |
143 // Needed by |service|. | 145 // Needed by |service|. |
144 content::TestBrowserThread ui_thread_; | 146 content::TestBrowserThread ui_thread_; |
145 content::TestBrowserThread db_thread_; | 147 content::TestBrowserThread db_thread_; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 namespace syncer { | 635 namespace syncer { |
634 namespace { | 636 namespace { |
635 | 637 |
636 // ProfileSyncService should behave just like an invalidator. | 638 // ProfileSyncService should behave just like an invalidator. |
637 INSTANTIATE_TYPED_TEST_CASE_P( | 639 INSTANTIATE_TYPED_TEST_CASE_P( |
638 ProfileSyncServiceInvalidatorTest, InvalidatorTest, | 640 ProfileSyncServiceInvalidatorTest, InvalidatorTest, |
639 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); | 641 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); |
640 | 642 |
641 } // namespace | 643 } // namespace |
642 } // namespace syncer | 644 } // namespace syncer |
OLD | NEW |