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

Unified Diff: sync/engine/syncer_unittest.cc

Issue 1393633003: Sync: fix for the code that checks whether the initial download has completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed control data types and added unit tests Created 5 years, 2 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: sync/engine/syncer_unittest.cc
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index c630fe4aa38db8fdb885786594590d0198858682..d527d202e556c5e9607cc6acdd40362e7fadf37d 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -4336,6 +4336,8 @@ TEST_F(SyncerTest, ClientTagUpdateClashesWithLocalEntry) {
tag2_metahandle = tag2.GetMetahandle();
// Preferences type root should have been created by the updates above.
+ ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
ASSERT_TRUE(pref_root.good());
@@ -4378,6 +4380,8 @@ TEST_F(SyncerTest, ClientTagUpdateClashesWithLocalEntry) {
EXPECT_EQ(tag2_metahandle, tag2.GetMetahandle());
// Preferences type root should have been created by the updates above.
+ ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
ASSERT_TRUE(pref_root.good());
@@ -4460,6 +4464,8 @@ TEST_F(SyncerTest, ClientTagClashWithinBatchOfUpdates) {
EXPECT_EQ("tag c", tag_c.GetUniqueClientTag());
// Preferences type root should have been created by the updates above.
+ ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
ASSERT_TRUE(pref_root.good());
@@ -4483,6 +4489,9 @@ TEST_F(SyncerTest, EntryWithParentIdUpdatedWithEntryWithoutParentId) {
// Preferences type root should have been created by the update above.
// We need it in order to get its ID.
syncable::ReadTransaction trans(FROM_HERE, directory());
+
+ ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
ASSERT_TRUE(pref_root.good());
pref_root_id = pref_root.GetId();

Powered by Google App Engine
This is Rietveld 408576698