| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 WillOnce(VerifyResult(expected_result)); | 186 WillOnce(VerifyResult(expected_result)); |
| 187 | 187 |
| 188 model_association_manager.Initialize(types); | 188 model_association_manager.Initialize(types); |
| 189 model_association_manager.StopDisabledTypes(); | 189 model_association_manager.StopDisabledTypes(); |
| 190 model_association_manager.StartAssociationAsync(types); | 190 model_association_manager.StartAssociationAsync(types); |
| 191 | 191 |
| 192 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), | 192 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 193 DataTypeController::ASSOCIATING); | 193 DataTypeController::ASSOCIATING); |
| 194 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( | 194 GetController(controllers_, syncer::BOOKMARKS)->FinishStart( |
| 195 DataTypeController::ASSOCIATION_FAILED); | 195 DataTypeController::ASSOCIATION_FAILED); |
| 196 EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), |
| 197 DataTypeController::NOT_RUNNING); |
| 196 } | 198 } |
| 197 | 199 |
| 198 // Ensure configuring stops when a type returns a unrecoverable error. | 200 // Ensure configuring stops when a type returns a unrecoverable error. |
| 199 TEST_F(SyncModelAssociationManagerTest, TypeReturnUnrecoverableError) { | 201 TEST_F(SyncModelAssociationManagerTest, TypeReturnUnrecoverableError) { |
| 200 controllers_[syncer::BOOKMARKS] = | 202 controllers_[syncer::BOOKMARKS] = |
| 201 new FakeDataTypeController(syncer::BOOKMARKS); | 203 new FakeDataTypeController(syncer::BOOKMARKS); |
| 202 ModelAssociationManager model_association_manager( | 204 ModelAssociationManager model_association_manager( |
| 203 &controllers_, | 205 &controllers_, |
| 204 &result_processor_); | 206 &result_processor_); |
| 205 syncer::ModelTypeSet types; | 207 syncer::ModelTypeSet types; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 syncer::ModelTypeSet(syncer::APPS)); | 425 syncer::ModelTypeSet(syncer::APPS)); |
| 424 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), | 426 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), |
| 425 DataTypeController::ASSOCIATING); | 427 DataTypeController::ASSOCIATING); |
| 426 GetController(controllers_, syncer::APPS)->FinishStart( | 428 GetController(controllers_, syncer::APPS)->FinishStart( |
| 427 DataTypeController::OK); | 429 DataTypeController::OK); |
| 428 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), | 430 EXPECT_EQ(GetController(controllers_, syncer::APPS)->state(), |
| 429 DataTypeController::RUNNING); | 431 DataTypeController::RUNNING); |
| 430 } | 432 } |
| 431 | 433 |
| 432 } // namespace browser_sync | 434 } // namespace browser_sync |
| OLD | NEW |