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

Unified Diff: chrome/browser/sync/engine/syncer_unittest.cc

Issue 6104003: sync: use progress markers instead of timestamps during GetUpdates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tim's fixes Created 9 years, 11 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
Index: chrome/browser/sync/engine/syncer_unittest.cc
diff --git a/chrome/browser/sync/engine/syncer_unittest.cc b/chrome/browser/sync/engine/syncer_unittest.cc
index 27725b37021f3cc50dfd8e6edd9f5807aa23a59a..883b30b48fc9b556e9ef6164993bac9918548bcd 100644
--- a/chrome/browser/sync/engine/syncer_unittest.cc
+++ b/chrome/browser/sync/engine/syncer_unittest.cc
@@ -3567,7 +3567,7 @@ TEST_F(SyncerTest, MergingExistingItems) {
TEST_F(SyncerTest, LongChangelistWithApplicationConflict) {
ScopedDirLookup dir(syncdb_.manager(), syncdb_.name());
CHECK(dir.good());
- const int DEPTH = 400;
+ const int depth = 400;
syncable::Id folder_id = ids_.FromNumber(1);
// First we an item in a folder in the root. However the folder won't come
@@ -3575,17 +3575,23 @@ TEST_F(SyncerTest, LongChangelistWithApplicationConflict) {
syncable::Id stuck_entry_id = TestIdFactory::FromNumber(99999);
mock_server_->AddUpdateDirectory(stuck_entry_id,
folder_id, "stuck", 1, 1);
- mock_server_->SetChangesRemaining(DEPTH - 1);
+ mock_server_->SetChangesRemaining(depth - 1);
syncer_->SyncShare(session_.get());
- // Very long changelist. We should never be stuck.
- for (int i = 0; i < DEPTH; i++) {
- mock_server_->SetNewTimestamp(i);
- mock_server_->SetChangesRemaining(DEPTH - i);
- syncer_->SyncShare(session_.get());
- EXPECT_FALSE(session_->status_controller()->syncer_status().syncer_stuck);
+ // Buffer up a very long series of downloads.
+ // We should never be stuck (conflict resolution shouldn't
+ // kick in so long as we're making forward progress).
+ for (int i = 0; i < depth; i++) {
+ mock_server_->NextUpdateBatch();
+ mock_server_->SetNewTimestamp(i + 1);
+ mock_server_->SetChangesRemaining(depth - i);
+ }
- // Ensure our folder hasn't somehow applied.
+ syncer_->SyncShare(session_.get());
+ EXPECT_FALSE(session_->status_controller()->syncer_status().syncer_stuck);
+
+ // Ensure our folder hasn't somehow applied.
+ {
ReadTransaction trans(dir, __FILE__, __LINE__);
Entry child(&trans, GET_BY_ID, stuck_entry_id);
EXPECT_TRUE(child.good());
« no previous file with comments | « chrome/browser/sync/engine/syncer_thread_unittest.cc ('k') | chrome/browser/sync/engine/verify_updates_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698