diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-14 02:58:23 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-14 02:58:23 +0000 |
commit | 31aa39ddb62a29bbff6b7073a71d2f513c6e06d7 (patch) | |
tree | c035fcb07a0f494ec4266fa49fa1c83a99bac519 /sync/syncable/syncable_unittest.cc | |
parent | 20184248e067fa7d9235c16397f2504cfcf6783a (diff) | |
download | chromium_src-31aa39ddb62a29bbff6b7073a71d2f513c6e06d7.zip chromium_src-31aa39ddb62a29bbff6b7073a71d2f513c6e06d7.tar.gz chromium_src-31aa39ddb62a29bbff6b7073a71d2f513c6e06d7.tar.bz2 |
sync: Improve handling of bad UniquePositions
Makes the client assign a valid position to incoming bookmarks if the
server has not populated the required fields. This code should never be
triggered unless there is a bug in the server. This risks reordering
users' bookmarks, but that's probably preferable to a crash.
Detects bookmarks that do not have valid position information during
database load. If these corrupted bookmarks are detected, the entire
database is declared to be corrupt. Sync will then re-download
all of the user's data, which should fix the problem.
BUG=367247
Review URL: https://codereview.chromium.org/278153002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/syncable/syncable_unittest.cc')
-rw-r--r-- | sync/syncable/syncable_unittest.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index 021e4bd..227b406 100644 --- a/sync/syncable/syncable_unittest.cc +++ b/sync/syncable/syncable_unittest.cc @@ -344,7 +344,7 @@ TEST_F(OnDiskSyncableDirectoryTest, specifics.mutable_bookmark()->set_favicon("PNG"); specifics.mutable_bookmark()->set_url("http://nowhere"); create.PutSpecifics(specifics); - update.PutSpecifics(specifics); + update.PutServerSpecifics(specifics); create_pre_save = create.GetKernelCopy(); update_pre_save = update.GetKernelCopy(); create_id = create.GetId(); @@ -379,10 +379,9 @@ TEST_F(OnDiskSyncableDirectoryTest, (i == TRANSACTION_VERSION ? 1 : 0), create_post_save.ref((Int64Field)i)) << "int64 field #" << i << " changed during save/load"; - EXPECT_EQ(update_pre_save.ref((Int64Field)i) + - (i == TRANSACTION_VERSION ? 1 : 0), + EXPECT_EQ(update_pre_save.ref((Int64Field)i), update_post_save.ref((Int64Field)i)) - << "int64 field #" << i << " changed during save/load"; + << "int64 field #" << i << " changed during save/load"; } for ( ; i < TIME_FIELDS_END ; ++i) { EXPECT_EQ(create_pre_save.ref((TimeField)i), |