client_tag_hash_unittest.cc 873 B

123456789101112131415161718192021222324
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/sync/base/client_tag_hash.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. namespace syncer {
  7. // Tests that the hashing algorithm has not changed.
  8. TEST(ClientTagHashTest, ShouldGenerateFromUnhashed) {
  9. EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=",
  10. ClientTagHash::FromUnhashed(PREFERENCES, "tag1").value());
  11. EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=",
  12. ClientTagHash::FromUnhashed(AUTOFILL, "tag1").value());
  13. EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=",
  14. ClientTagHash::FromUnhashed(PREFERENCES, "tag2").value());
  15. EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=",
  16. ClientTagHash::FromUnhashed(AUTOFILL, "tag2").value());
  17. }
  18. } // namespace syncer