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

Unified Diff: components/sync/engine_impl/worker_entity_tracker_unittest.cc

Issue 2350803005: [Sync] Fixing two bugs in the worker revealed by trying to add an encryption integration test. (Closed)
Patch Set: Merging conflict. Created 4 years, 3 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 | « components/sync/engine_impl/worker_entity_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/worker_entity_tracker_unittest.cc
diff --git a/components/sync/engine_impl/worker_entity_tracker_unittest.cc b/components/sync/engine_impl/worker_entity_tracker_unittest.cc
index e1eb91750976904cb366bca9460d57912239042d..60cadd3017389aa45ca9427e7ff5f1dc7b1eb3b6 100644
--- a/components/sync/engine_impl/worker_entity_tracker_unittest.cc
+++ b/components/sync/engine_impl/worker_entity_tracker_unittest.cc
@@ -169,4 +169,21 @@ TEST_F(WorkerEntityTrackerTest, ReflectedUpdateDoesntClobberCommit) {
EXPECT_TRUE(entity_->HasPendingCommit());
}
+// Request two commits, both with the same old version. The second commit should
+// have the updated server version.
+TEST_F(WorkerEntityTrackerTest, QuickCommits) {
+ const int64_t kLocalBaseVersion = 10;
+ const int64_t kCommitResponseVersion = 11;
+ entity_->RequestCommit(MakeCommitRequestData(1, kLocalBaseVersion));
+ CommitResponseData ack;
+ ack.response_version = kCommitResponseVersion;
+ ack.id = kServerId;
+ entity_->ReceiveCommitResponse(&ack);
+
+ entity_->RequestCommit(MakeCommitRequestData(1, kLocalBaseVersion));
+ sync_pb::SyncEntity pb_entity;
+ entity_->PopulateCommitProto(&pb_entity);
+ EXPECT_EQ(kCommitResponseVersion, pb_entity.version());
+}
+
} // namespace syncer_v2
« no previous file with comments | « components/sync/engine_impl/worker_entity_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698