forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync: Move unique_client_tag hashing code
This is one of many changes that will lead up to the introduction of the bookmark UniquePosition algorithm. We eventually want to use the hashing code to create a unique tag for bookmarks. This tag will be initialized at bookmark creation time in MutableEntry. This patch moves the hashing code out of BaseNode and into syncable_util so it can be accessed from the syncable layer. BUG=145412,126505 Review URL: https://chromiumcodereview.appspot.com/11571092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174449 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
rlarocque@chromium.org
committed
Dec 21, 2012
1 parent
859566a
commit b2bf91a
Showing
9 changed files
with
74 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |