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

Unified Diff: components/sync/core_impl/test/test_entry_factory.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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: components/sync/core_impl/test/test_entry_factory.cc
diff --git a/sync/internal_api/test/test_entry_factory.cc b/components/sync/core_impl/test/test_entry_factory.cc
similarity index 89%
rename from sync/internal_api/test/test_entry_factory.cc
rename to components/sync/core_impl/test/test_entry_factory.cc
index 7f5c20f91613f1f79eacca96000b4aff2b321ccb..79b17f5419513974b87f6e95ae8aaffe8b1b6a35 100644
--- a/sync/internal_api/test/test_entry_factory.cc
+++ b/components/sync/core_impl/test/test_entry_factory.cc
@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/internal_api/public/test/test_entry_factory.h"
+#include "components/sync/core/test/test_entry_factory.h"
#include <stdint.h>
-#include "sync/syncable/directory.h"
-#include "sync/syncable/entry.h"
-#include "sync/syncable/mutable_entry.h"
-#include "sync/syncable/syncable_id.h"
-#include "sync/syncable/syncable_read_transaction.h"
-#include "sync/syncable/syncable_util.h"
-#include "sync/syncable/syncable_write_transaction.h"
-#include "sync/test/engine/test_id_factory.h"
+#include "components/sync/syncable/directory.h"
+#include "components/sync/syncable/entry.h"
+#include "components/sync/syncable/mutable_entry.h"
+#include "components/sync/syncable/syncable_id.h"
+#include "components/sync/syncable/syncable_read_transaction.h"
+#include "components/sync/syncable/syncable_util.h"
+#include "components/sync/syncable/syncable_write_transaction.h"
+#include "components/sync/test/engine/test_id_factory.h"
using std::string;
@@ -24,11 +24,10 @@ using syncable::MutableEntry;
using syncable::UNITTEST;
using syncable::WriteTransaction;
-TestEntryFactory::TestEntryFactory(syncable::Directory *dir)
- : directory_(dir), next_revision_(1) {
-}
+TestEntryFactory::TestEntryFactory(syncable::Directory* dir)
+ : directory_(dir), next_revision_(1) {}
-TestEntryFactory::~TestEntryFactory() { }
+TestEntryFactory::~TestEntryFactory() {}
int64_t TestEntryFactory::CreateUnappliedNewItemWithParent(
const string& item_id,
@@ -36,7 +35,7 @@ int64_t TestEntryFactory::CreateUnappliedNewItemWithParent(
const string& parent_id) {
WriteTransaction trans(FROM_HERE, UNITTEST, directory_);
MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
- Id::CreateFromServerId(item_id));
+ Id::CreateFromServerId(item_id));
DCHECK(entry.good());
entry.PutServerVersion(GetNextRevision());
entry.PutIsUnappliedUpdate(true);
@@ -54,7 +53,7 @@ int64_t TestEntryFactory::CreateUnappliedNewBookmarkItemWithParent(
const string& parent_id) {
WriteTransaction trans(FROM_HERE, UNITTEST, directory_);
MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
- Id::CreateFromServerId(item_id));
+ Id::CreateFromServerId(item_id));
DCHECK(entry.good());
entry.PutServerVersion(GetNextRevision());
entry.PutIsUnappliedUpdate(true);
@@ -73,7 +72,7 @@ int64_t TestEntryFactory::CreateUnappliedNewItem(
bool is_unique) {
WriteTransaction trans(FROM_HERE, UNITTEST, directory_);
MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
- Id::CreateFromServerId(item_id));
+ Id::CreateFromServerId(item_id));
DCHECK(entry.good());
entry.PutServerVersion(GetNextRevision());
entry.PutIsUnappliedUpdate(true);
@@ -83,7 +82,7 @@ int64_t TestEntryFactory::CreateUnappliedNewItem(
entry.PutServerSpecifics(specifics);
if (is_unique) { // For top-level nodes.
entry.PutUniqueServerTag(
- ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics)));
+ ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics)));
}
return entry.GetMetahandle();
}
@@ -103,8 +102,7 @@ void TestEntryFactory::CreateUnsyncedItem(const Id& item_id,
MutableEntry entry(&trans, syncable::CREATE, model_type, parent_id, name);
DCHECK(entry.good());
entry.PutId(item_id);
- entry.PutBaseVersion(
- item_id.ServerKnows() ? GetNextRevision() : 0);
+ entry.PutBaseVersion(item_id.ServerKnows() ? GetNextRevision() : 0);
entry.PutIsUnsynced(true);
entry.PutIsDir(is_folder);
entry.PutIsDel(false);
@@ -126,9 +124,8 @@ void TestEntryFactory::CreateUnsyncedItem(const Id& item_id,
int64_t TestEntryFactory::CreateUnappliedAndUnsyncedBookmarkItem(
const string& name) {
int64_t metahandle = 0;
- CreateUnsyncedItem(
- TestIdFactory::MakeServer(name), TestIdFactory::root(),
- name, false, BOOKMARKS, &metahandle);
+ CreateUnsyncedItem(TestIdFactory::MakeServer(name), TestIdFactory::root(),
+ name, false, BOOKMARKS, &metahandle);
WriteTransaction trans(FROM_HERE, UNITTEST, directory_);
MutableEntry entry(&trans, syncable::GET_BY_HANDLE, metahandle);

Powered by Google App Engine
This is Rietveld 408576698