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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 migrator_->OnConfigureDone(result); | 78 migrator_->OnConfigureDone(result); |
79 } else { | 79 } else { |
80 std::list<syncer::SyncError> errors; | 80 std::list<syncer::SyncError> errors; |
81 DataTypeManager::ConfigureResult result( | 81 DataTypeManager::ConfigureResult result( |
82 status, | 82 status, |
83 requested_types, | 83 requested_types, |
84 errors, | 84 errors, |
85 syncer::ModelTypeSet()); | 85 syncer::ModelTypeSet()); |
86 migrator_->OnConfigureDone(result); | 86 migrator_->OnConfigureDone(result); |
87 } | 87 } |
88 message_loop_.RunAllPending(); | 88 message_loop_.RunUntilIdle(); |
89 } | 89 } |
90 | 90 |
91 ProfileSyncService* service() { return &service_; } | 91 ProfileSyncService* service() { return &service_; } |
92 DataTypeManagerMock* manager() { return &manager_; } | 92 DataTypeManagerMock* manager() { return &manager_; } |
93 syncer::ModelTypeSet preferred_types() { return preferred_types_; } | 93 syncer::ModelTypeSet preferred_types() { return preferred_types_; } |
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()). |
(...skipping 232 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 |