| 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 "chrome/browser/sync/backend_migrator.h" | 5 #include "chrome/browser/sync/backend_migrator.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/tracked_objects.h" | 8 #include "base/tracked_objects.h" |
| 9 #include "chrome/browser/sync/glue/data_type_manager_mock.h" | 9 #include "chrome/browser/sync/glue/data_type_manager_mock.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_mock.h" | 10 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 BackendMigrator* migrator() { return migrator_.get(); } | 94 BackendMigrator* migrator() { return migrator_.get(); } |
| 95 void RemovePreferredType(syncer::ModelType type) { | 95 void RemovePreferredType(syncer::ModelType type) { |
| 96 preferred_types_.Remove(type); | 96 preferred_types_.Remove(type); |
| 97 Mock::VerifyAndClear(&service_); | 97 Mock::VerifyAndClear(&service_); |
| 98 ON_CALL(service_, GetPreferredDataTypes()). | 98 ON_CALL(service_, GetPreferredDataTypes()). |
| 99 WillByDefault(Return(preferred_types_)); | 99 WillByDefault(Return(preferred_types_)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 scoped_ptr<SyncSessionSnapshot> snap_; | 103 scoped_ptr<SyncSessionSnapshot> snap_; |
| 104 MessageLoop message_loop_; | 104 base::MessageLoop message_loop_; |
| 105 syncer::ModelTypeSet preferred_types_; | 105 syncer::ModelTypeSet preferred_types_; |
| 106 NiceMock<ProfileSyncServiceMock> service_; | 106 NiceMock<ProfileSyncServiceMock> service_; |
| 107 NiceMock<DataTypeManagerMock> manager_; | 107 NiceMock<DataTypeManagerMock> manager_; |
| 108 syncer::TestUserShare test_user_share_; | 108 syncer::TestUserShare test_user_share_; |
| 109 scoped_ptr<BackendMigrator> migrator_; | 109 scoped_ptr<BackendMigrator> migrator_; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 class MockMigrationObserver : public MigrationObserver { | 112 class MockMigrationObserver : public MigrationObserver { |
| 113 public: | 113 public: |
| 114 virtual ~MockMigrationObserver() {} | 114 virtual ~MockMigrationObserver() {} |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 EXPECT_CALL( | 331 EXPECT_CALL( |
| 332 *manager(), | 332 *manager(), |
| 333 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)).Times(1); | 333 PurgeForMigration(_, syncer::CONFIGURE_REASON_MIGRATION)).Times(1); |
| 334 migrator()->MigrateTypes(to_migrate); | 334 migrator()->MigrateTypes(to_migrate); |
| 335 SetUnsyncedTypes(syncer::ModelTypeSet()); | 335 SetUnsyncedTypes(syncer::ModelTypeSet()); |
| 336 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); | 336 SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); |
| 337 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); | 337 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); |
| 338 } | 338 } |
| 339 | 339 |
| 340 }; // namespace browser_sync | 340 }; // namespace browser_sync |
| OLD | NEW |