Commit 07b3da30 authored by haitaol@chromium.org's avatar haitaol@chromium.org

Add a reason for configuring DTM for backup/rollback. In backup/rollback,

only add control types in addtional to user selectable types.

BUG=362679

Review URL: https://codereview.chromium.org/266883007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269612 0039d316-1c4b-4281-b951-d872f2087c98
parent 8acd5f7b
......@@ -77,7 +77,10 @@ DataTypeManagerImpl::~DataTypeManagerImpl() {}
void DataTypeManagerImpl::Configure(syncer::ModelTypeSet desired_types,
syncer::ConfigureReason reason) {
desired_types.PutAll(syncer::CoreTypes());
if (reason == syncer::CONFIGURE_REASON_BACKUP_ROLLBACK)
desired_types.PutAll(syncer::ControlTypes());
else
desired_types.PutAll(syncer::CoreTypes());
// Only allow control types and types that have controllers.
syncer::ModelTypeSet filtered_desired_types;
......
......@@ -1119,4 +1119,19 @@ TEST_F(SyncDataTypeManagerImplTest, FilterDesiredTypes) {
EXPECT_EQ(DataTypeManager::STOPPED, dtm_->state());
}
TEST_F(SyncDataTypeManagerImplTest, ConfigureForBackupRollback) {
AddController(BOOKMARKS);
SetConfigureStartExpectation();
ModelTypeSet expected_types = syncer::ControlTypes();
expected_types.Put(BOOKMARKS);
configurer_.set_expected_configure_types(expected_types);
dtm_->set_priority_types(expected_types);
dtm_->Configure(ModelTypeSet(BOOKMARKS),
syncer::CONFIGURE_REASON_BACKUP_ROLLBACK);
}
} // namespace browser_sync
......@@ -32,6 +32,9 @@ enum ConfigureReason {
// A configuration due to enabling or disabling encrypted types due to
// cryptographer errors/resolutions.
CONFIGURE_REASON_CRYPTO,
// Configure data types for backup/rollback.
CONFIGURE_REASON_BACKUP_ROLLBACK,
};
} // namespace syncer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment