| OLD | NEW |
| 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" | 5 #include "components/sync/base/hash_util.h" |
| 6 | 6 |
| 7 #include "components/sync/base/model_type.h" | |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 8 |
| 10 namespace syncer { | 9 namespace syncer { |
| 11 | 10 |
| 12 // Tests that the hashing algorithm has not changed. | 11 // Tests that the hashing algorithm has not changed. |
| 13 TEST(SyncHashUtilTest, GenerateSyncableHash) { | 12 TEST(SyncHashUtilTest, GenerateSyncableHash) { |
| 14 EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=", | 13 EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=", |
| 15 GenerateSyncableHash(BOOKMARKS, "tag1")); | 14 GenerateSyncableHash(BOOKMARKS, "tag1")); |
| 16 EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=", | 15 EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=", |
| 17 GenerateSyncableHash(PREFERENCES, "tag1")); | 16 GenerateSyncableHash(PREFERENCES, "tag1")); |
| 18 EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=", | 17 EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=", |
| 19 GenerateSyncableHash(AUTOFILL, "tag1")); | 18 GenerateSyncableHash(AUTOFILL, "tag1")); |
| 20 | 19 |
| 21 EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=", | 20 EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=", |
| 22 GenerateSyncableHash(BOOKMARKS, "tag2")); | 21 GenerateSyncableHash(BOOKMARKS, "tag2")); |
| 23 EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=", | 22 EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=", |
| 24 GenerateSyncableHash(PREFERENCES, "tag2")); | 23 GenerateSyncableHash(PREFERENCES, "tag2")); |
| 25 EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=", | 24 EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=", |
| 26 GenerateSyncableHash(AUTOFILL, "tag2")); | 25 GenerateSyncableHash(AUTOFILL, "tag2")); |
| 27 } | 26 } |
| 28 | 27 |
| 29 } // namespace syncer | 28 } // namespace syncer |
| OLD | NEW |