summaryrefslogtreecommitdiffstats
path: root/sync/engine
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-19 02:19:52 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-19 02:19:52 +0000
commitc0a133ff4b6c69c1ae67dbf32a3f2169650112c0 (patch)
treea16120b1b72aae8386522286d3758ccd65e43120 /sync/engine
parent8e10a992f3fb4728c34c6e986f5cb663beed5c75 (diff)
downloadchromium_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.cc8
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");