| 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 "components/sync_driver/backend_migrator.h" | 5 #include "components/sync_driver/backend_migrator.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/tracked_objects.h" | 9 #include "base/tracked_objects.h" |
| 10 #include "components/sync_driver/data_type_manager_mock.h" | 10 #include "components/sync_driver/data_type_manager_mock.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void RemovePreferredType(syncer::ModelType type) { | 91 void RemovePreferredType(syncer::ModelType type) { |
| 92 preferred_types_.Remove(type); | 92 preferred_types_.Remove(type); |
| 93 } | 93 } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 base::MessageLoop message_loop_; | 96 base::MessageLoop message_loop_; |
| 97 syncer::ModelTypeSet preferred_types_; | 97 syncer::ModelTypeSet preferred_types_; |
| 98 sync_driver::FakeSyncService service_; | 98 sync_driver::FakeSyncService service_; |
| 99 NiceMock<DataTypeManagerMock> manager_; | 99 NiceMock<DataTypeManagerMock> manager_; |
| 100 syncer::TestUserShare test_user_share_; | 100 syncer::TestUserShare test_user_share_; |
| 101 scoped_ptr<BackendMigrator> migrator_; | 101 std::unique_ptr<BackendMigrator> migrator_; |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 class MockMigrationObserver : public MigrationObserver { | 104 class MockMigrationObserver : public MigrationObserver { |
| 105 public: | 105 public: |
| 106 virtual ~MockMigrationObserver() {} | 106 virtual ~MockMigrationObserver() {} |
| 107 | 107 |
| 108 MOCK_METHOD0(OnMigrationStateChange, void()); | 108 MOCK_METHOD0(OnMigrationStateChange, void()); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 // Test that in the normal case a migration does transition through each state | 111 // Test that in the normal case a migration does transition through each state |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 EXPECT_CALL( | 323 EXPECT_CALL( |
| 324 *manager(), | 324 *manager(), |
| 325 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)).Times(1); | 325 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)).Times(1); |
| 326 migrator()->MigrateTypes(to_migrate); | 326 migrator()->MigrateTypes(to_migrate); |
| 327 SetUnsyncedTypes(syncer::ModelTypeSet()); | 327 SetUnsyncedTypes(syncer::ModelTypeSet()); |
| 328 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); | 328 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); |
| 329 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); | 329 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); |
| 330 } | 330 } |
| 331 | 331 |
| 332 }; // namespace browser_sync | 332 }; // namespace browser_sync |
| OLD | NEW |