From c0a133ff4b6c69c1ae67dbf32a3f2169650112c0 Mon Sep 17 00:00:00 2001 From: "zea@chromium.org" Date: Sat, 19 Jul 2014 02:19:52 +0000 Subject: [Sync] Rely on directory to decide which types need to be purged Preivously we relied on the SyncBackendRegistrar's last configured types to decide which types have been recently disabled. Now we just purge all disabled types that exist in the directory, as recorded by their progress markers (which should never be deleted unless the type has been purged). BUG=386778 Review URL: https://codereview.chromium.org/398813005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284283 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/engine/syncer_unittest.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sync/engine') diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index 6f891e8d..160ed9c 100644 --- a/sync/engine/syncer_unittest.cc +++ b/sync/engine/syncer_unittest.cc @@ -1037,6 +1037,10 @@ TEST_F(SyncerTest, TestPurgeWhileUnsynced) { // Similar to above, but throw a purge operation into the mix. Bug 49278. syncable::Id pref_node_id = TestIdFactory::MakeServer("Tim"); { + directory()->SetDownloadProgress(BOOKMARKS, + syncable::BuildProgress(BOOKMARKS)); + directory()->SetDownloadProgress(PREFERENCES, + syncable::BuildProgress(PREFERENCES)); WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry parent(&wtrans, CREATE, BOOKMARKS, wtrans.root_id(), "Pete"); ASSERT_TRUE(parent.good()); @@ -1086,6 +1090,8 @@ TEST_F(SyncerTest, TestPurgeWhileUnsynced) { TEST_F(SyncerTest, TestPurgeWhileUnapplied) { // Similar to above, but for unapplied items. Bug 49278. { + directory()->SetDownloadProgress(BOOKMARKS, + syncable::BuildProgress(BOOKMARKS)); WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry parent(&wtrans, CREATE, BOOKMARKS, wtrans.root_id(), "Pete"); ASSERT_TRUE(parent.good()); @@ -1111,6 +1117,8 @@ TEST_F(SyncerTest, TestPurgeWhileUnapplied) { TEST_F(SyncerTest, TestPurgeWithJournal) { { + directory()->SetDownloadProgress(BOOKMARKS, + syncable::BuildProgress(BOOKMARKS)); WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry parent(&wtrans, syncable::CREATE, BOOKMARKS, wtrans.root_id(), "Pete"); -- cgit v1.1