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

Side by Side Diff: components/sync/base/hash_util_unittest.cc

Issue 2502253003: [Sync] Move GenerateSyncableHash to base. (Closed)
Patch Set: Keep full syncable/ DEP. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/base/hash_util.h"
6
5 #include "components/sync/base/model_type.h" 7 #include "components/sync/base/model_type.h"
6 #include "components/sync/syncable/syncable_util.h"
7 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
8 9
9 namespace syncer { 10 namespace syncer {
10 namespace syncable {
11 namespace {
12 11
13 // Tests that the hashing algorithm has not changed. 12 // Tests that the hashing algorithm has not changed.
14 TEST(SyncableUtilTest, GenerateSyncableHash) { 13 TEST(SyncHashUtilTest, GenerateSyncableHash) {
15 EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=", 14 EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=",
16 GenerateSyncableHash(BOOKMARKS, "tag1")); 15 GenerateSyncableHash(BOOKMARKS, "tag1"));
17 EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=", 16 EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=",
18 GenerateSyncableHash(PREFERENCES, "tag1")); 17 GenerateSyncableHash(PREFERENCES, "tag1"));
19 EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=", 18 EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=",
20 GenerateSyncableHash(AUTOFILL, "tag1")); 19 GenerateSyncableHash(AUTOFILL, "tag1"));
21 20
22 EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=", 21 EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=",
23 GenerateSyncableHash(BOOKMARKS, "tag2")); 22 GenerateSyncableHash(BOOKMARKS, "tag2"));
24 EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=", 23 EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=",
25 GenerateSyncableHash(PREFERENCES, "tag2")); 24 GenerateSyncableHash(PREFERENCES, "tag2"));
26 EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=", 25 EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=",
27 GenerateSyncableHash(AUTOFILL, "tag2")); 26 GenerateSyncableHash(AUTOFILL, "tag2"));
28 } 27 }
29 28
30 } // namespace
31 } // namespace syncable
32 } // namespace syncer 29 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/base/hash_util.cc ('k') | components/sync/engine_impl/loopback_server/persistent_unique_client_entity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698