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

Unified Diff: sync/test/engine/test_id_factory.h

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
« no previous file with comments | « sync/test/engine/test_directory_setter_upper.cc ('k') | sync/test/engine/test_syncable_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/engine/test_id_factory.h
diff --git a/sync/test/engine/test_id_factory.h b/sync/test/engine/test_id_factory.h
deleted file mode 100644
index 705575af6c2979ad7135d9047347795b272da736..0000000000000000000000000000000000000000
--- a/sync/test/engine/test_id_factory.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// A tool making it easier to create IDs for unit testing.
-
-#ifndef SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_
-#define SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_
-
-#include <stdint.h>
-
-#include <string>
-
-#include "base/strings/string_number_conversions.h"
-#include "sync/syncable/syncable_id.h"
-
-namespace syncer {
-
-class TestIdFactory {
- public:
- TestIdFactory() : next_value_(1337000) {}
- ~TestIdFactory() {}
-
- // Get the root ID.
- static syncable::Id root() { return syncable::Id::GetRoot(); }
-
- // Make an ID from a number. If the number is zero, return the root ID.
- // If the number is positive, create a server ID based on the value. If
- // the number is negative, create a local ID based on the value. This
- // is deterministic, and [FromNumber(X) == FromNumber(Y)] iff [X == Y].
- static syncable::Id FromNumber(int64_t value) {
- if (value == 0)
- return root();
- else if (value < 0)
- return syncable::Id::CreateFromClientString(base::Int64ToString(value));
- else
- return syncable::Id::CreateFromServerId(base::Int64ToString(value));
- }
-
- // Create a local ID from a name.
- static syncable::Id MakeLocal(const std::string& name) {
- return syncable::Id::CreateFromClientString(std::string("lient ") + name);
- }
-
- // Create a server ID from a string name.
- static syncable::Id MakeServer(const std::string& name) {
- return syncable::Id::CreateFromServerId(std::string("erver ") + name);
- }
-
- // Autogenerate a fresh local ID.
- syncable::Id NewLocalId() {
- return syncable::Id::CreateFromClientString(
- std::string("_auto ") + base::IntToString(-next_value()));
- }
-
- // Autogenerate a fresh server ID.
- syncable::Id NewServerId() {
- return syncable::Id::CreateFromServerId(
- std::string("_auto ") + base::IntToString(next_value()));
- }
-
- private:
- int next_value() {
- return next_value_++;
- }
- int next_value_;
-};
-
-} // namespace syncer
-
-#endif // SYNC_TEST_ENGINE_TEST_ID_FACTORY_H_
-
« no previous file with comments | « sync/test/engine/test_directory_setter_upper.cc ('k') | sync/test/engine/test_syncable_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698