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

Unified Diff: sync/syncable/syncable_util_unittest.cc

Issue 11571092: sync: Move unique_client_tag hashing code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo some changes and move a test to syncable_util_unittest 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/syncable/syncable_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/syncable_util_unittest.cc
diff --git a/sync/syncable/syncable_util_unittest.cc b/sync/syncable/syncable_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8f818f0a134ad60050facf2bba019e1439a212b9
--- /dev/null
+++ b/sync/syncable/syncable_util_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright 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.
+
+#include "sync/internal_api/public/base/model_type.h"
+#include "sync/syncable/syncable_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace syncer {
+namespace syncable {
+namespace {
+
+// Tests that the hashing algorithm has not changed.
+TEST(SyncableUtilTest, GenerateSyncableHash) {
+ EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=",
+ GenerateSyncableHash(BOOKMARKS, "tag1"));
+ EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=",
+ GenerateSyncableHash(PREFERENCES, "tag1"));
+ EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=",
+ GenerateSyncableHash(AUTOFILL, "tag1"));
+
+ EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=",
+ GenerateSyncableHash(BOOKMARKS, "tag2"));
+ EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=",
+ GenerateSyncableHash(PREFERENCES, "tag2"));
+ EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=",
+ GenerateSyncableHash(AUTOFILL, "tag2"));
+}
+
+} // namespace
+} // namespace syncer
+} // namespace syncable
« no previous file with comments | « sync/syncable/syncable_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698