| Index: chrome/browser/sync/engine/syncer_unittest.cc
|
| diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc
|
| index 7f086d0f083917fefd0191b60043c53bad33aa50..24a10f665e6a7ec7c9ffacacb381c715389efd13 100644
|
| --- a/chrome/browser/sync/engine/syncer_unittest.cc
|
| +++ b/chrome/browser/sync/engine/syncer_unittest.cc
|
| @@ -47,6 +47,8 @@ using std::multimap;
|
| using std::set;
|
| using std::string;
|
|
|
| +using ::testing::_;
|
| +
|
| namespace browser_sync {
|
|
|
| using syncable::BaseTransaction;
|
| @@ -4497,6 +4499,34 @@ TEST_F(SyncerTest, GetUpdatesSetsRequestedTypes) {
|
| EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests());
|
| }
|
|
|
| +TEST_F(SyncerTest, CleanupDisabledTypes) {
|
| + // Set up mock directory and expectations.
|
| + MockDirectorySetterUpper mock_setter_upper;
|
| + mock_setter_upper.SetUp();
|
| + EXPECT_CALL(*mock_setter_upper.directory(), PurgeEntriesWithTypeIn(_));
|
| +
|
| + // Set up context.
|
| + std::vector<SyncEngineEventListener*> listeners;
|
| + SyncSessionContext context(mock_server_.get(),
|
| + mock_setter_upper.manager(), this, listeners);
|
| + context.set_account_name(mock_setter_upper.name());
|
| +
|
| + // Set up session.
|
| + ModelSafeRoutingInfo info;
|
| + std::vector<ModelSafeWorker*> workers;
|
| + GetModelSafeRoutingInfo(&info);
|
| + GetWorkers(&workers);
|
| + syncable::ModelTypePayloadMap types =
|
| + syncable::ModelTypePayloadMapFromRoutingInfo(info, std::string());
|
| + SyncSession sync_session(
|
| + &context, this,
|
| + sessions::SyncSourceInfo(sync_pb::GetUpdatesCallerInfo::UNKNOWN, types),
|
| + info, workers);
|
| +
|
| + // Do cleanup.
|
| + syncer_->CleanupDisabledTypes(&sync_session);
|
| +}
|
| +
|
| // Test what happens if a client deletes, then recreates, an object very
|
| // quickly. It is possible that the deletion gets sent as a commit, and
|
| // the undelete happens during the commit request. The principle here
|
|
|