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

Unified Diff: trunk/src/sync/syncable/directory_unittest.cc

Issue 270543005: Revert 270308 "sync: Improve handling of bad UniquePositions" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « trunk/src/sync/syncable/directory_backing_store.cc ('k') | trunk/src/sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/sync/syncable/directory_unittest.cc
===================================================================
--- trunk/src/sync/syncable/directory_unittest.cc (revision 270323)
+++ trunk/src/sync/syncable/directory_unittest.cc (working copy)
@@ -81,11 +81,6 @@
DirOpenResult open_result =
dir_->Open(kDirectoryName, &delegate_, NullTransactionObserver());
-
- if (open_result != OPENED) {
- dir_.reset();
- }
-
return open_result;
}
@@ -1226,38 +1221,6 @@
}
}
-// Any item with BOOKMARKS in their local specifics should have a valid local
-// unique position. If there is an item in the loaded DB that does not match
-// this criteria, we consider the whole DB to be corrupt.
-TEST_F(SyncableDirectoryTest, BadPositionCountsAsCorruption) {
- TestIdFactory id_factory;
-
- {
- WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
-
- MutableEntry parent(&trans, CREATE, BOOKMARKS, id_factory.root(), "parent");
- parent.PutIsDir(true);
- parent.PutIsUnsynced(true);
-
- // The code is littered with DCHECKs that try to stop us from doing what
- // we're about to do. Our work-around is to create a bookmark based on
- // a server update, then update its local specifics without updating its
- // local unique position.
-
- MutableEntry child(
- &trans, CREATE_NEW_UPDATE_ITEM, id_factory.MakeServer("child"));
- sync_pb::EntitySpecifics specifics;
- AddDefaultFieldValue(BOOKMARKS, &specifics);
- child.PutIsUnappliedUpdate(true);
- child.PutSpecifics(specifics);
-
- EXPECT_TRUE(child.ShouldMaintainPosition());
- EXPECT_TRUE(!child.GetUniquePosition().IsValid());
- }
-
- EXPECT_EQ(FAILED_DATABASE_CORRUPT, SimulateSaveAndReloadDir());
-}
-
TEST_F(SyncableDirectoryTest, General) {
int64 written_metahandle;
const Id id = TestIdFactory::FromNumber(99);
« no previous file with comments | « trunk/src/sync/syncable/directory_backing_store.cc ('k') | trunk/src/sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698