| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { | 304 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { |
| 305 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); | 305 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); |
| 306 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; | 306 DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; |
| 307 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); | 307 SyncError error(FROM_HERE, "Association failed.", syncable::BOOKMARKS); |
| 308 std::list<SyncError> errors; | 308 std::list<SyncError> errors; |
| 309 errors.push_back(error); | 309 errors.push_back(error); |
| 310 browser_sync::DataTypeManager::ConfigureResult result( | 310 browser_sync::DataTypeManager::ConfigureResult result( |
| 311 status, | 311 status, |
| 312 syncable::ModelTypeSet(), | 312 syncable::ModelTypeSet(), |
| 313 errors); | 313 errors, |
| 314 syncable::ModelTypeSet()); |
| 314 EXPECT_CALL(*data_type_manager, Configure(_, _)). | 315 EXPECT_CALL(*data_type_manager, Configure(_, _)). |
| 315 WillRepeatedly( | 316 WillRepeatedly( |
| 316 DoAll( | 317 DoAll( |
| 317 NotifyFromDataTypeManager(data_type_manager, | 318 NotifyFromDataTypeManager(data_type_manager, |
| 318 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), | 319 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), |
| 319 NotifyFromDataTypeManagerWithResult(data_type_manager, | 320 NotifyFromDataTypeManagerWithResult(data_type_manager, |
| 320 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), | 321 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), |
| 321 &result))); | 322 &result))); |
| 322 EXPECT_CALL(*data_type_manager, state()). | 323 EXPECT_CALL(*data_type_manager, state()). |
| 323 WillOnce(Return(DataTypeManager::STOPPED)); | 324 WillOnce(Return(DataTypeManager::STOPPED)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 338 | 339 |
| 339 // Preload the tokens. | 340 // Preload the tokens. |
| 340 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( | 341 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( |
| 341 GaiaConstants::kSyncService, "sync_token"); | 342 GaiaConstants::kSyncService, "sync_token"); |
| 342 service_->fail_initial_download(); | 343 service_->fail_initial_download(); |
| 343 | 344 |
| 344 service_->Initialize(); | 345 service_->Initialize(); |
| 345 EXPECT_FALSE(service_->sync_initialized()); | 346 EXPECT_FALSE(service_->sync_initialized()); |
| 346 EXPECT_FALSE(service_->GetBackendForTest()); | 347 EXPECT_FALSE(service_->GetBackendForTest()); |
| 347 } | 348 } |
| OLD | NEW |