diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-19 02:19:52 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-19 02:19:52 +0000 |
commit | c0a133ff4b6c69c1ae67dbf32a3f2169650112c0 (patch) | |
tree | a16120b1b72aae8386522286d3758ccd65e43120 /sync/engine | |
parent | 8e10a992f3fb4728c34c6e986f5cb663beed5c75 (diff) | |
download | chromium_src-c0a133ff4b6c69c1ae67dbf32a3f2169650112c0.zip chromium_src-c0a133ff4b6c69c1ae67dbf32a3f2169650112c0.tar.gz chromium_src-c0a133ff4b6c69c1ae67dbf32a3f2169650112c0.tar.bz2 |
[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
Diffstat (limited to 'sync/engine')
-rw-r--r-- | sync/engine/syncer_unittest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |