| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } | 275 } |
| 276 | 276 |
| 277 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { | 277 TEST_F(ProfileSyncServiceStartupTest, StartFailure) { |
| 278 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); | 278 DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); |
| 279 DataTypeManager::ConfigureStatus status = | 279 DataTypeManager::ConfigureStatus status = |
| 280 DataTypeManager::ASSOCIATION_FAILED; | 280 DataTypeManager::ASSOCIATION_FAILED; |
| 281 browser_sync::DataTypeManager::ConfigureResult result( | 281 browser_sync::DataTypeManager::ConfigureResult result( |
| 282 status, | 282 status, |
| 283 syncable::ModelTypeSet(), | 283 syncable::ModelTypeSet(), |
| 284 syncable::ModelTypeSet(), | 284 syncable::ModelTypeSet(), |
| 285 syncable::ModelTypeSet(), |
| 285 FROM_HERE); | 286 FROM_HERE); |
| 286 EXPECT_CALL(*data_type_manager, Configure(_, _)). | 287 EXPECT_CALL(*data_type_manager, Configure(_, _)). |
| 287 WillRepeatedly( | 288 WillRepeatedly( |
| 288 DoAll( | 289 DoAll( |
| 289 NotifyFromDataTypeManager(data_type_manager, | 290 NotifyFromDataTypeManager(data_type_manager, |
| 290 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), | 291 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_START)), |
| 291 NotifyFromDataTypeManagerWithResult(data_type_manager, | 292 NotifyFromDataTypeManagerWithResult(data_type_manager, |
| 292 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), | 293 static_cast<int>(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE), |
| 293 &result))); | 294 &result))); |
| 294 EXPECT_CALL(*data_type_manager, state()). | 295 EXPECT_CALL(*data_type_manager, state()). |
| (...skipping 15 matching lines...) Expand all Loading... |
| 310 | 311 |
| 311 // Preload the tokens. | 312 // Preload the tokens. |
| 312 profile_.GetTokenService()->IssueAuthTokenForTest( | 313 profile_.GetTokenService()->IssueAuthTokenForTest( |
| 313 GaiaConstants::kSyncService, "sync_token"); | 314 GaiaConstants::kSyncService, "sync_token"); |
| 314 service_->fail_initial_download(); | 315 service_->fail_initial_download(); |
| 315 | 316 |
| 316 service_->Initialize(); | 317 service_->Initialize(); |
| 317 EXPECT_FALSE(service_->sync_initialized()); | 318 EXPECT_FALSE(service_->sync_initialized()); |
| 318 EXPECT_FALSE(service_->GetBackendForTest()); | 319 EXPECT_FALSE(service_->GetBackendForTest()); |
| 319 } | 320 } |
| OLD | NEW |