Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3298)

Unified Diff: chrome/browser/sync/engine/syncer_unittest.cc

Issue 7281017: [Sync] Add RequestCleanupDisabledTypes() method to SyncManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix migration integration tests Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698