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

Unified Diff: sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years 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 | « sync/engine/apply_control_data_updates_unittest.cc ('k') | sync/engine/build_commit_command.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc
diff --git a/sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc b/sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc
index fb6480a5fe2c933704001a113e183ffe29f82f72..e882716d498749302d84cc670ebb027b04920ecb 100644
--- a/sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc
+++ b/sync/engine/apply_updates_and_resolve_conflicts_command_unittest.cc
@@ -71,12 +71,10 @@ class ApplyUpdatesAndResolveConflictsCommandTest : public SyncerCommandTest {
TEST_F(ApplyUpdatesAndResolveConflictsCommandTest, Simple) {
string root_server_id = syncable::GetNullId().GetServerId();
- entry_factory_->CreateUnappliedNewItemWithParent("parent",
- DefaultBookmarkSpecifics(),
- root_server_id);
- entry_factory_->CreateUnappliedNewItemWithParent("child",
- DefaultBookmarkSpecifics(),
- "parent");
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
+ "parent", DefaultBookmarkSpecifics(), root_server_id);
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
+ "child", DefaultBookmarkSpecifics(), "parent");
ExpectGroupToChange(apply_updates_command_, GROUP_UI);
apply_updates_command_.ExecuteImpl(session());
@@ -95,15 +93,15 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
// Set a bunch of updates which are difficult to apply in the order
// they're received due to dependencies on other unseen items.
string root_server_id = syncable::GetNullId().GetServerId();
- entry_factory_->CreateUnappliedNewItemWithParent(
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
"a_child_created_first", DefaultBookmarkSpecifics(), "parent");
- entry_factory_->CreateUnappliedNewItemWithParent(
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
"x_child_created_first", DefaultBookmarkSpecifics(), "parent");
- entry_factory_->CreateUnappliedNewItemWithParent(
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
"parent", DefaultBookmarkSpecifics(), root_server_id);
- entry_factory_->CreateUnappliedNewItemWithParent(
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
"a_child_created_second", DefaultBookmarkSpecifics(), "parent");
- entry_factory_->CreateUnappliedNewItemWithParent(
+ entry_factory_->CreateUnappliedNewBookmarkItemWithParent(
"x_child_created_second", DefaultBookmarkSpecifics(), "parent");
ExpectGroupToChange(apply_updates_command_, GROUP_UI);
@@ -119,7 +117,7 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
// expect the command to detect that this update can't be applied because it is
// in a CONFLICT state.
TEST_F(ApplyUpdatesAndResolveConflictsCommandTest, SimpleConflict) {
- entry_factory_->CreateUnappliedAndUnsyncedItem("item", BOOKMARKS);
+ entry_factory_->CreateUnappliedAndUnsyncedBookmarkItem("item");
ExpectGroupToChange(apply_updates_command_, GROUP_UI);
apply_updates_command_.ExecuteImpl(session());
@@ -139,8 +137,8 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest, SimpleConflict) {
// CONFLICT_HIERARCHY state.
TEST_F(ApplyUpdatesAndResolveConflictsCommandTest, HierarchyAndSimpleConflict) {
// Create a simply-conflicting item. It will start with valid parent ids.
- int64 handle = entry_factory_->CreateUnappliedAndUnsyncedItem(
- "orphaned_by_server", BOOKMARKS);
+ int64 handle = entry_factory_->CreateUnappliedAndUnsyncedBookmarkItem(
+ "orphaned_by_server");
{
// Manually set the SERVER_PARENT_ID to bad value.
// A bad parent indicates a hierarchy conflict.
@@ -170,7 +168,7 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
// parent of 'Y'.
{
// Create it as a child of root node.
- int64 handle = entry_factory_->CreateSyncedItem("X", BOOKMARKS, true);
+ int64 handle = entry_factory_->CreateSyncedBookmarkItem("X", true);
WriteTransaction trans(FROM_HERE, UNITTEST, directory());
MutableEntry entry(&trans, syncable::GET_BY_HANDLE, handle);
@@ -183,9 +181,9 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
}
// Item 'Y' is child of 'X'.
- entry_factory_->CreateUnsyncedItem(
+ entry_factory_->CreateUnsyncedBookmarkItem(
TestIdFactory::MakeServer("Y"), TestIdFactory::MakeServer("X"), "Y", true,
- BOOKMARKS, NULL);
+ 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
@@ -209,9 +207,9 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
HierarchyConflictDeletedParent) {
// Create a locally deleted parent item.
int64 parent_handle;
- entry_factory_->CreateUnsyncedItem(
+ entry_factory_->CreateUnsyncedBookmarkItem(
Id::CreateFromServerId("parent"), TestIdFactory::root(),
- "parent", true, BOOKMARKS, &parent_handle);
+ "parent", true, &parent_handle);
{
WriteTransaction trans(FROM_HERE, UNITTEST, directory());
MutableEntry entry(&trans, syncable::GET_BY_HANDLE, parent_handle);
@@ -242,8 +240,7 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
// Create a server-deleted directory.
{
// Create it as a child of root node.
- int64 handle =
- entry_factory_->CreateSyncedItem("parent", BOOKMARKS, true);
+ int64 handle = entry_factory_->CreateSyncedBookmarkItem("parent", true);
WriteTransaction trans(FROM_HERE, UNITTEST, directory());
MutableEntry entry(&trans, syncable::GET_BY_HANDLE, handle);
@@ -257,9 +254,9 @@ TEST_F(ApplyUpdatesAndResolveConflictsCommandTest,
}
// Create a local child of the server-deleted directory.
- entry_factory_->CreateUnsyncedItem(
+ entry_factory_->CreateUnsyncedBookmarkItem(
TestIdFactory::MakeServer("child"), TestIdFactory::MakeServer("parent"),
- "child", false, BOOKMARKS, NULL);
+ "child", false, 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.
« no previous file with comments | « sync/engine/apply_control_data_updates_unittest.cc ('k') | sync/engine/build_commit_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698