| 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "chrome/browser/sync/glue/fake_data_type_controller.h" | 7 #include "chrome/browser/sync/glue/fake_data_type_controller.h" |
| 8 #include "chrome/browser/sync/glue/model_association_manager.h" | 8 #include "chrome/browser/sync/glue/model_association_manager.h" |
| 9 #include "content/public/test/test_browser_thread.h" | 9 #include "content/public/test/test_browser_thread.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 WillOnce(VerifyResult(expected_result)); | 183 WillOnce(VerifyResult(expected_result)); |
| 184 | 184 |
| 185 model_association_manager.Initialize(types); | 185 model_association_manager.Initialize(types); |
| 186 model_association_manager.StopDisabledTypes(); | 186 model_association_manager.StopDisabledTypes(); |
| 187 model_association_manager.StartAssociationAsync(types); | 187 model_association_manager.StartAssociationAsync(types); |
| 188 | 188 |
| 189 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), | 189 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 190 DataTypeController::ASSOCIATING); | 190 DataTypeController::ASSOCIATING); |
| 191 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( | 191 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( |
| 192 DataTypeController::ASSOCIATION_FAILED); | 192 DataTypeController::ASSOCIATION_FAILED); |
| 193 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 194 DataTypeController::NOT_RUNNING); |
| 193 } | 195 } |
| 194 | 196 |
| 195 // Ensure configuring stops when a type returns a unrecoverable error. | 197 // Ensure configuring stops when a type returns a unrecoverable error. |
| 196 TEST_F(SyncModelAssociationManagerTest, TypeReturnUnrecoverableError) { | 198 TEST_F(SyncModelAssociationManagerTest, TypeReturnUnrecoverableError) { |
| 197 controllers_[syncer::BOOKMARKS] = | 199 controllers_[syncer::BOOKMARKS] = |
| 198 new FakeDataTypeController(syncer::BOOKMARKS); | 200 new FakeDataTypeController(syncer::BOOKMARKS); |
| 199 ModelAssociationManager model_association_manager( | 201 ModelAssociationManager model_association_manager( |
| 200 &controllers_, | 202 &controllers_, |
| 201 &result_processor_); | 203 &result_processor_); |
| 202 syncer::ModelTypeSet types; | 204 syncer::ModelTypeSet types; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 syncer::ModelTypeSet(syncer::APPS)); | 419 syncer::ModelTypeSet(syncer::APPS)); |
| 418 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), | 420 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), |
| 419 DataTypeController::ASSOCIATING); | 421 DataTypeController::ASSOCIATING); |
| 420 GetController(controllers_, syncer::APPS)->FinishStart( | 422 GetController(controllers_, syncer::APPS)->FinishStart( |
| 421 DataTypeController::OK); | 423 DataTypeController::OK); |
| 422 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), | 424 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), |
| 423 DataTypeController::RUNNING); | 425 DataTypeController::RUNNING); |
| 424 } | 426 } |
| 425 | 427 |
| 426 } // namespace browser_sync | 428 } // namespace browser_sync |
| OLD | NEW |