| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/signin/signin_manager.h" | 10 #include "chrome/browser/signin/signin_manager.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // should not start up automatically (kSyncSetupCompleted will be false). | 291 // should not start up automatically (kSyncSetupCompleted will be false). |
| 292 Mock::VerifyAndClearExpectations(data_type_manager); | 292 Mock::VerifyAndClearExpectations(data_type_manager); |
| 293 EXPECT_CALL(*factory_mock(), CreateDataTypeManager(_, _)).Times(0); | 293 EXPECT_CALL(*factory_mock(), CreateDataTypeManager(_, _)).Times(0); |
| 294 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); | 294 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); |
| 295 profile_->GetPrefs()->ClearPref(prefs::kSyncManaged); | 295 profile_->GetPrefs()->ClearPref(prefs::kSyncManaged); |
| 296 } | 296 } |
| 297 | 297 |
| 298 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { | 298 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { |
| 299 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); | 299 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); |
| 300 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; | 300 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; |
| 301 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); | 301 csync::SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); |
| 302 std::list<SyncError> errors; | 302 std::list<csync::SyncError> errors; |
| 303 errors.push_back(error); | 303 errors.push_back(error); |
| 304 browser_sync::DataTypeManager::ConfigureResult result( | 304 browser_sync::DataTypeManager::ConfigureResult result( |
| 305 status, | 305 status, |
| 306 syncable::ModelTypeSet(), | 306 syncable::ModelTypeSet(), |
| 307 errors, | 307 errors, |
| 308 syncable::ModelTypeSet()); | 308 syncable::ModelTypeSet()); |
| 309 EXPECT_CALL(*data_type_manager, Configure(_, _)). | 309 EXPECT_CALL(*data_type_manager, Configure(_, _)). |
| 310 WillRepeatedly( | 310 WillRepeatedly( |
| 311 DoAll( | 311 DoAll( |
| 312 NotifyFromDataTypeManager(data_type_manager, | 312 NotifyFromDataTypeManager(data_type_manager, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 333 | 333 |
| 334 // Preload the tokens. | 334 // Preload the tokens. |
| 335 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( | 335 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( |
| 336 GaiaConstants::kSyncService, "sync_token"); | 336 GaiaConstants::kSyncService, "sync_token"); |
| 337 service_->fail_initial_download(); | 337 service_->fail_initial_download(); |
| 338 | 338 |
| 339 service_->Initialize(); | 339 service_->Initialize(); |
| 340 EXPECT_FALSE(service_->sync_initialized()); | 340 EXPECT_FALSE(service_->sync_initialized()); |
| 341 EXPECT_FALSE(service_->GetBackendForTest()); | 341 EXPECT_FALSE(service_->GetBackendForTest()); |
| 342 } | 342 } |
| OLD | NEW |