| 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/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 done.Wait(); | 134 done.Wait(); |
| 135 base::RunLoop().RunUntilIdle(); | 135 base::RunLoop().RunUntilIdle(); |
| 136 if (service->sync_initialized()) { | 136 if (service->sync_initialized()) { |
| 137 return; | 137 return; |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 LOG(ERROR) << "Backend not initialized."; | 140 LOG(ERROR) << "Backend not initialized."; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void IssueTestTokens() { | 143 void IssueTestTokens() { |
| 144 TokenService* token_service = | 144 ProfileOAuth2TokenServiceFactory::GetForProfile(profile.get()) |
| 145 TokenServiceFactory::GetForProfile(profile.get()); | 145 ->UpdateCredentials("test", "oauth2_login_token"); |
| 146 token_service->IssueAuthTokenForTest( | 146 TokenServiceFactory::GetForProfile(profile.get()) |
| 147 GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token"); | 147 ->IssueAuthTokenForTest(GaiaConstants::kSyncService, "token"); |
| 148 token_service->IssueAuthTokenForTest( | |
| 149 GaiaConstants::kSyncService, "token"); | |
| 150 } | 148 } |
| 151 | 149 |
| 152 scoped_ptr<TestProfileSyncService> service; | 150 scoped_ptr<TestProfileSyncService> service; |
| 153 scoped_ptr<TestingProfile> profile; | 151 scoped_ptr<TestingProfile> profile; |
| 154 | 152 |
| 155 private: | 153 private: |
| 156 content::TestBrowserThreadBundle thread_bundle_; | 154 content::TestBrowserThreadBundle thread_bundle_; |
| 157 }; | 155 }; |
| 158 | 156 |
| 159 class TestProfileSyncServiceObserver : public ProfileSyncServiceObserver { | 157 class TestProfileSyncServiceObserver : public ProfileSyncServiceObserver { |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 TEST_F(ProfileSyncServiceTest, FailToDownloadControlTypes) { | 476 TEST_F(ProfileSyncServiceTest, FailToDownloadControlTypes) { |
| 479 harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, | 477 harness_.StartSyncServiceAndSetInitialSyncEnded(false, true, true, true, |
| 480 syncer::STORAGE_IN_MEMORY); | 478 syncer::STORAGE_IN_MEMORY); |
| 481 | 479 |
| 482 // The backend is not ready. Ensure the PSS knows this. | 480 // The backend is not ready. Ensure the PSS knows this. |
| 483 EXPECT_FALSE(harness_.service->sync_initialized()); | 481 EXPECT_FALSE(harness_.service->sync_initialized()); |
| 484 } | 482 } |
| 485 | 483 |
| 486 } // namespace | 484 } // namespace |
| 487 } // namespace browser_sync | 485 } // namespace browser_sync |
| OLD | NEW |