Index: chrome/browser/sync/engine/apply_updates_command_unittest.cc |
diff --git a/chrome/browser/sync/engine/apply_updates_command_unittest.cc b/chrome/browser/sync/engine/apply_updates_command_unittest.cc |
index 19bc480c9f6c4e771dab874833d2d65a1309b34e..83b57710892d02898b77cd92edbd93ca4a048b3d 100644 |
--- a/chrome/browser/sync/engine/apply_updates_command_unittest.cc |
+++ b/chrome/browser/sync/engine/apply_updates_command_unittest.cc |
@@ -143,6 +143,42 @@ class ApplyUpdatesCommandTest : public SyncerCommandTest { |
*metahandle_out = entry.Get(syncable::META_HANDLE); |
} |
+ // Creates an item that is both unsynced an an unapplied update. The item_id |
+ // parameter must be a server ID. The metahandle of the created item will be |
+ // output to metahandle_out. Returns the metahandle of the created item in |
+ // metahandle_out if not NULL. |
+ void CreateUnappliedAndUnsyncedItem(const Id& item_id, |
akalin
2012/02/02 01:34:39
you only call this function twice, with very simil
rlarocque
2012/02/03 22:31:15
Yes, that makes sense. I wrote this function befo
|
+ const Id& parent_id, |
+ const string& name, |
+ bool is_folder, |
+ syncable::ModelType model_type, |
+ int64* metahandle_out) { |
+ // This function requires that the item_id be a server ID. |
+ CHECK(item_id.ServerKnows()); |
akalin
2012/02/02 01:34:39
you CHECK here but you ASSERT_TRUE later in the fu
rlarocque
2012/02/03 22:31:15
Good point. I would fix this, but in the latest p
|
+ |
+ // If our caller did not specify a location to store the returned |
+ // metahandle, then use our own temporary storage. |
+ int64 local_metahandle_out = 0; |
+ if (!metahandle_out) |
+ metahandle_out = &local_metahandle_out; |
+ |
+ CreateUnsyncedItem(item_id, parent_id, name, is_folder, |
+ model_type, metahandle_out); |
+ |
+ ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
+ ASSERT_TRUE(dir.good()); |
+ WriteTransaction trans(FROM_HERE, UNITTEST, dir); |
+ MutableEntry entry(&trans, syncable::GET_BY_HANDLE, *metahandle_out); |
+ ASSERT_TRUE(entry.good()); |
+ |
+ entry.Put(syncable::IS_UNAPPLIED_UPDATE, true); |
+ entry.Put(syncable::SERVER_VERSION, next_revision_++); |
akalin
2012/02/02 01:34:39
use GetNextRevision() here, too?
rlarocque
2012/02/03 22:31:15
Done.
|
+ } |
+ |
+ int64 GetNextRevision() { |
+ return next_revision_++; |
+ } |
+ |
ApplyUpdatesCommand apply_updates_command_; |
TestIdFactory id_factory_; |
private: |
@@ -169,7 +205,11 @@ TEST_F(ApplyUpdatesCommandTest, Simple) { |
EXPECT_EQ(2, status->update_progress()->AppliedUpdatesSize()) |
akalin
2012/02/02 01:34:39
comment this test, too
|
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
+ << "Simple update shouldn't result in conflicts"; |
+ EXPECT_EQ(0, status->conflict_progress()->EncryptionConflictingItemsSize()) |
+ << "Simple update shouldn't result in conflicts"; |
+ EXPECT_EQ(0, status->conflict_progress()->HierarchyConflictingItemsSize()) |
<< "Simple update shouldn't result in conflicts"; |
EXPECT_EQ(2, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "All items should have been successfully applied"; |
@@ -204,13 +244,226 @@ TEST_F(ApplyUpdatesCommandTest, UpdateWithChildrenBeforeParents) { |
EXPECT_EQ(5, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "Simple update shouldn't result in conflicts, even if out-of-order"; |
EXPECT_EQ(5, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "All updates should have been successfully applied"; |
} |
-TEST_F(ApplyUpdatesCommandTest, NestedItemsWithUnknownParent) { |
+// Runs the ApplyUpdatesCommand on an item that has both local and remote |
+// modifications (IS_UNSYNCED and IS_UNAPPLIED_UPDATE). We expect the command |
+// to detect that this update can't be applied because it is in a CONFLICT |
+// state. |
+TEST_F(ApplyUpdatesCommandTest, SimpleConflict) { |
+ string root_server_id = syncable::GetNullId().GetServerId(); |
akalin
2012/02/02 01:34:39
this variable doesn't seem to be used
rlarocque
2012/02/03 22:31:15
Done.
|
+ CreateUnappliedAndUnsyncedItem(id_factory_.MakeServer("item"), |
+ id_factory_.root(), "item", false, |
+ syncable::BOOKMARKS, NULL); |
+ |
+ ExpectGroupToChange(apply_updates_command_, GROUP_UI); |
+ apply_updates_command_.ExecuteImpl(session()); |
+ |
+ sessions::StatusController* status = session()->mutable_status_controller(); |
akalin
2012/02/02 01:34:39
can you use the non-mutable status_controller acce
rlarocque
2012/02/03 22:31:15
The ScopedModelSafeGroupRestriction needs to modif
|
+ sessions::ScopedModelSafeGroupRestriction r(status, GROUP_UI); |
+ ASSERT_TRUE(status->conflict_progress()); |
+ EXPECT_EQ(1, status->conflict_progress()->SimpleConflictingItemsSize()) |
+ << "Unsynced and unapplied item should be a simple conflict"; |
+} |
+ |
+// Runs the ApplyUpdatesCommand on an item that has both local and remote |
+// modifications *and* the remote modification can not be applied without |
akalin
2012/02/02 01:34:39
can not -> cannot
rlarocque
2012/02/03 22:31:15
Done.
|
+// violating the tree constraints. We expect the command to detect that this |
+// update can't be applied and that this situation can't be resolved with the |
+// simple conflict processing logic; it is in a CONFLICT_HIERARCHY state. |
+TEST_F(ApplyUpdatesCommandTest, HierarchyAndSimpleConflict) { |
+ int64 handle = 0; |
+ // Create a simply-conflicting item. It will start with valid parent ids. |
+ CreateUnappliedAndUnsyncedItem(id_factory_.MakeServer("orphaned_by_server"), |
+ id_factory_.root(), "orphaned_by_server", |
+ false, syncable::BOOKMARKS, &handle); |
+ { |
+ // Manually set the SERVER_PARENT_ID to bad value. |
+ // A bad parent indicates a hierarchy conflict. |
+ ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
+ ASSERT_TRUE(dir.good()); |
+ WriteTransaction trans(FROM_HERE, UNITTEST, dir); |
+ MutableEntry entry(&trans, syncable::GET_BY_HANDLE, handle); |
+ ASSERT_TRUE(entry.good()); |
+ |
+ entry.Put(syncable::SERVER_PARENT_ID, |
+ id_factory_.MakeServer("bogus_parent")); |
+ } |
+ |
+ ExpectGroupToChange(apply_updates_command_, GROUP_UI); |
+ apply_updates_command_.ExecuteImpl(session()); |
+ |
+ sessions::StatusController* status = session()->mutable_status_controller(); |
akalin
2012/02/02 01:34:39
here too
akalin
2012/02/02 01:34:39
all these lines are just to check HierarchyConflic
rlarocque
2012/02/03 22:31:15
I'm on the fence about that.
If we pass in the
|
+ sessions::ScopedModelSafeGroupRestriction r(status, GROUP_UI); |
+ |
+ EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()); |
+ |
+ // An update that is both a simple conflict and a hierarchy conflict should be |
+ // treated as a hierarchy conflict. |
+ ASSERT_TRUE(status->conflict_progress()); |
+ EXPECT_EQ(1, status->conflict_progress()->HierarchyConflictingItemsSize()); |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()); |
+} |
+ |
+ |
+// Runs the ApplyUpdatesCommand on an item with remote modifications that would |
+// create a directory loop if the update were applied. We expect the command to |
+// detect that this update can't be applied because it is in a |
+// CONFLICT_HIERARCHY state. |
+TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDirectoryLoop) { |
+ // Item 'X' locally has parent of 'root'. Server is updating it to have |
+ // parent of 'Y'. |
+ { |
+ ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
+ ASSERT_TRUE(dir.good()); |
+ WriteTransaction trans(FROM_HERE, UNITTEST, dir); |
+ |
+ syncable::Id parent_id(id_factory_.root()); |
+ MutableEntry entry(&trans, syncable::CREATE, parent_id, "X"); |
+ ASSERT_TRUE(entry.good()); |
+ |
+ entry.Put(syncable::ID, id_factory_.MakeServer("X")); |
+ entry.Put(syncable::BASE_VERSION, GetNextRevision()); |
+ entry.Put(syncable::IS_UNSYNCED, false); |
+ entry.Put(syncable::NON_UNIQUE_NAME, "X"); |
+ entry.Put(syncable::IS_DIR, true); |
+ entry.Put(syncable::IS_DEL, false); |
+ entry.Put(syncable::PARENT_ID, parent_id); |
+ |
+ CHECK(entry.PutPredecessor(id_factory_.root())); |
akalin
2012/02/02 01:34:39
ASSERT_TRUE
rlarocque
2012/02/03 22:31:15
Done.
|
+ entry.Put(syncable::SPECIFICS, DefaultBookmarkSpecifics()); |
+ |
+ entry.Put(syncable::SERVER_VERSION, GetNextRevision()); |
+ entry.Put(syncable::IS_UNAPPLIED_UPDATE, true); |
+ entry.Put(syncable::SERVER_NON_UNIQUE_NAME, "X"); |
+ entry.Put(syncable::SERVER_PARENT_ID, id_factory_.MakeServer("Y")); |
+ entry.Put(syncable::SERVER_IS_DIR, true); |
+ entry.Put(syncable::SERVER_SPECIFICS, DefaultBookmarkSpecifics()); |
+ } |
+ |
+ // Item 'Y' is child of 'X'. |
+ CreateUnsyncedItem(id_factory_.MakeServer("Y"), id_factory_.MakeServer("X"), |
+ "Y", true, syncable::BOOKMARKS, NULL); |
+ |
+ // If the server's update were applied, we would have X be a child of Y, and Y |
+ // as a child of X. That's a directory loop. The UpdateApplicator should |
+ // prevent the update from being applied and note that this is a hierarchy |
+ // conflict. |
+ |
+ ExpectGroupToChange(apply_updates_command_, GROUP_UI); |
+ apply_updates_command_.ExecuteImpl(session()); |
+ |
+ sessions::StatusController* status = session()->mutable_status_controller(); |
+ sessions::ScopedModelSafeGroupRestriction r(status, GROUP_UI); |
+ |
+ EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()); |
+ |
+ // This should count as a hierarchy conflict. |
+ ASSERT_TRUE(status->conflict_progress()); |
+ EXPECT_EQ(1, status->conflict_progress()->HierarchyConflictingItemsSize()); |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()); |
+} |
+ |
+// Runs the ApplyUpdatesCommand on a directory where the server sent us an |
+// update to add a child to a locally deleted (and unsynced) parent. We expect |
+// the command to not apply the update and to indicate the update is in a |
+// CONFLICT_HIERARCHY state. |
+TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDeletedParent) { |
+ // Create a locally deleted parent item. |
+ int64 parent_handle; |
+ CreateUnsyncedItem(Id::CreateFromServerId("parent"), id_factory_.root(), |
+ "parent", true, syncable::BOOKMARKS, &parent_handle); |
+ { |
+ ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
+ ASSERT_TRUE(dir.good()); |
+ WriteTransaction trans(FROM_HERE, UNITTEST, dir); |
+ MutableEntry entry(&trans, syncable::GET_BY_HANDLE, parent_handle); |
+ entry.Put(syncable::IS_DEL, true); |
+ } |
+ |
+ // Create an incoming child from the server. |
+ CreateUnappliedNewItemWithParent("child", DefaultBookmarkSpecifics(), |
+ "parent"); |
+ |
+ // The server's update may seem valid to some other client, but on this client |
+ // that new item's parent no longer exists. The update should not be applied |
+ // and the update applicator should indicate this is a hierarchy conflict. |
+ |
+ ExpectGroupToChange(apply_updates_command_, GROUP_UI); |
+ apply_updates_command_.ExecuteImpl(session()); |
+ |
+ sessions::StatusController* status = session()->mutable_status_controller(); |
+ sessions::ScopedModelSafeGroupRestriction r(status, GROUP_UI); |
+ |
+ // This should count as a hierarchy conflict. |
+ ASSERT_TRUE(status->conflict_progress()); |
+ EXPECT_EQ(1, status->conflict_progress()->HierarchyConflictingItemsSize()); |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()); |
+} |
+ |
+// Runs the ApplyUpdatesCommand on a directory where the server is trying to |
+// delete a folder that has a recently added (and unsynced) child. We expect |
+// the command to not apply the update because it is in a CONFLICT_HIERARCHY |
+// state. |
+TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDeleteNonEmptyDirectory) { |
+ // Create a server-deleted directory. |
+ { |
+ ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
+ ASSERT_TRUE(dir.good()); |
+ WriteTransaction trans(FROM_HERE, UNITTEST, dir); |
+ |
+ syncable::Id parent_id(id_factory_.root()); |
+ MutableEntry entry(&trans, syncable::CREATE, parent_id, "parent"); |
+ ASSERT_TRUE(entry.good()); |
+ |
+ entry.Put(syncable::ID, id_factory_.MakeServer("parent")); |
+ entry.Put(syncable::BASE_VERSION, GetNextRevision()); |
akalin
2012/02/02 01:34:39
i feel like you can decomp this into some helper f
rlarocque
2012/02/03 22:31:15
That's a good idea. Implemented in the next patch
|
+ entry.Put(syncable::IS_UNSYNCED, false); |
+ entry.Put(syncable::NON_UNIQUE_NAME, "parent"); |
+ entry.Put(syncable::IS_DIR, true); |
+ entry.Put(syncable::IS_DEL, false); |
+ entry.Put(syncable::PARENT_ID, parent_id); |
+ |
+ CHECK(entry.PutPredecessor(id_factory_.root())); |
+ entry.Put(syncable::SPECIFICS, DefaultBookmarkSpecifics()); |
+ |
+ entry.Put(syncable::SERVER_VERSION, GetNextRevision()); |
+ entry.Put(syncable::IS_UNAPPLIED_UPDATE, true); |
+ entry.Put(syncable::SERVER_NON_UNIQUE_NAME, "parent"); |
+ entry.Put(syncable::SERVER_PARENT_ID, parent_id); |
+ entry.Put(syncable::SERVER_IS_DIR, true); |
+ entry.Put(syncable::SERVER_IS_DEL, true); |
+ entry.Put(syncable::SERVER_SPECIFICS, DefaultBookmarkSpecifics()); |
+ } |
+ |
+ // Create a local child of the server-deleted directory. |
+ CreateUnsyncedItem(id_factory_.MakeServer("child"), |
+ id_factory_.MakeServer("parent"), "child", false, |
+ syncable::BOOKMARKS, NULL); |
+ |
+ // The server's request to delete the directory must be ignored, otherwise our |
+ // unsynced new child would be orphaned. This is a hierarchy conflict. |
+ |
+ ExpectGroupToChange(apply_updates_command_, GROUP_UI); |
+ apply_updates_command_.ExecuteImpl(session()); |
+ |
+ sessions::StatusController* status = session()->mutable_status_controller(); |
+ sessions::ScopedModelSafeGroupRestriction r(status, GROUP_UI); |
+ |
+ // This should count as a hierarchy conflict. |
+ ASSERT_TRUE(status->conflict_progress()); |
+ EXPECT_EQ(1, status->conflict_progress()->HierarchyConflictingItemsSize()); |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()); |
+} |
+ |
+// Runs the ApplyUpdatesCommand on a server-created item that has a locally |
+// unknown parent. We expect the command to not apply the update because the |
+// item is in a CONFLICT_HIERARCHY state. |
+TEST_F(ApplyUpdatesCommandTest, HierarchyConflictUnknownParent) { |
// We shouldn't be able to do anything with either of these items. |
CreateUnappliedNewItemWithParent("some_item", |
DefaultBookmarkSpecifics(), |
@@ -228,7 +481,10 @@ TEST_F(ApplyUpdatesCommandTest, NestedItemsWithUnknownParent) { |
EXPECT_EQ(2, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(2, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
+ << "Updates with unknown parent should not be treated as 'simple'" |
+ << " conflicts"; |
+ EXPECT_EQ(2, status->conflict_progress()->HierarchyConflictingItemsSize()) |
<< "All updates with an unknown ancestors should be in conflict"; |
EXPECT_EQ(0, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "No item with an unknown ancestor should be applied"; |
@@ -265,7 +521,7 @@ TEST_F(ApplyUpdatesCommandTest, ItemsBothKnownAndUnknown) { |
EXPECT_EQ(6, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(2, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(2, status->conflict_progress()->HierarchyConflictingItemsSize()) |
<< "The updates with unknown ancestors should be in conflict"; |
EXPECT_EQ(4, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The updates with known ancestors should be successfully applied"; |
@@ -304,7 +560,7 @@ TEST_F(ApplyUpdatesCommandTest, DecryptablePassword) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "No update should be in conflict because they're all decryptable"; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The updates that can be decrypted should be applied"; |
@@ -337,11 +593,11 @@ TEST_F(ApplyUpdatesCommandTest, UndecryptableData) { |
EXPECT_EQ(2, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The updates that can't be decrypted should not be in regular " |
<< "conflict"; |
- EXPECT_EQ(2, status->conflict_progress()->NonblockingConflictingItemsSize()) |
- << "The updates that can't be decrypted should be in nonblocking " |
+ EXPECT_EQ(2, status->conflict_progress()->EncryptionConflictingItemsSize()) |
+ << "The updates that can't be decrypted should be in encryption " |
<< "conflict"; |
EXPECT_EQ(0, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "No update that can't be decrypted should be applied"; |
@@ -352,11 +608,11 @@ TEST_F(ApplyUpdatesCommandTest, UndecryptableData) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The updates that can't be decrypted should not be in regular " |
<< "conflict"; |
- EXPECT_EQ(1, status->conflict_progress()->NonblockingConflictingItemsSize()) |
- << "The updates that can't be decrypted should be in nonblocking " |
+ EXPECT_EQ(1, status->conflict_progress()->EncryptionConflictingItemsSize()) |
+ << "The updates that can't be decrypted should be in encryption " |
<< "conflict"; |
EXPECT_EQ(0, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "No update that can't be decrypted should be applied"; |
@@ -412,11 +668,11 @@ TEST_F(ApplyUpdatesCommandTest, SomeUndecryptablePassword) { |
EXPECT_EQ(2, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The updates that can't be decrypted should not be in regular " |
<< "conflict"; |
- EXPECT_EQ(1, status->conflict_progress()->NonblockingConflictingItemsSize()) |
- << "The updates that can't be decrypted should be in nonblocking " |
+ EXPECT_EQ(1, status->conflict_progress()->EncryptionConflictingItemsSize()) |
+ << "The updates that can't be decrypted should be in encryption " |
<< "conflict"; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The undecryptable password update shouldn't be applied"; |
@@ -463,7 +719,7 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdate) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The nigori update shouldn't be in conflict"; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The nigori update should be applied"; |
@@ -517,7 +773,7 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdateForDisabledTypes) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The nigori update shouldn't be in conflict"; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The nigori update should be applied"; |
@@ -607,9 +863,9 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "No updates should be in conflict"; |
- EXPECT_EQ(0, status->conflict_progress()->NonblockingConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->EncryptionConflictingItemsSize()) |
<< "No updates should be in conflict"; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The nigori update should be applied"; |
@@ -710,11 +966,11 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { |
EXPECT_EQ(1, status->update_progress()->AppliedUpdatesSize()) |
<< "All updates should have been attempted"; |
ASSERT_TRUE(status->conflict_progress()); |
- EXPECT_EQ(0, status->conflict_progress()->ConflictingItemsSize()) |
+ EXPECT_EQ(0, status->conflict_progress()->SimpleConflictingItemsSize()) |
<< "The unsynced changes don't trigger a blocking conflict with the " |
<< "nigori update."; |
- EXPECT_EQ(0, status->conflict_progress()->NonblockingConflictingItemsSize()) |
- << "The unsynced changes don't trigger a non-blocking conflict with the " |
+ EXPECT_EQ(0, status->conflict_progress()->EncryptionConflictingItemsSize()) |
+ << "The unsynced changes don't trigger an encryption conflict with the " |
<< "nigori update."; |
EXPECT_EQ(1, status->update_progress()->SuccessfullyAppliedUpdateCount()) |
<< "The nigori update should be applied"; |