| Index: chrome/browser/sync/syncable/nigori_util_unittest.cc
|
| diff --git a/chrome/browser/sync/syncable/nigori_util_unittest.cc b/chrome/browser/sync/syncable/nigori_util_unittest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3cc367de3a7beb8ad3c6840572332d4549c17fb9
|
| --- /dev/null
|
| +++ b/chrome/browser/sync/syncable/nigori_util_unittest.cc
|
| @@ -0,0 +1,37 @@
|
| +// Copyright (c) 2011 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 "chrome/browser/sync/syncable/nigori_util.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace syncable {
|
| +
|
| +typedef testing::Test NigoriUtilTest;
|
| +
|
| +TEST_F(NigoriUtilTest, NigoriEncryptionTypes) {
|
| + sync_pb::NigoriSpecifics nigori;
|
| + ModelTypeSet encrypted_types;
|
| + FillNigoriEncryptedTypes(encrypted_types, &nigori);
|
| + ModelTypeSet test_types = GetEncryptedDataTypesFromNigori(nigori);
|
| + EXPECT_EQ(encrypted_types, test_types);
|
| +
|
| + for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
|
| + encrypted_types.insert(ModelTypeFromInt(i));
|
| + }
|
| + FillNigoriEncryptedTypes(encrypted_types, &nigori);
|
| + test_types = GetEncryptedDataTypesFromNigori(nigori);
|
| + encrypted_types.erase(syncable::NIGORI); // Should not get set.
|
| + EXPECT_EQ(encrypted_types, test_types);
|
| +
|
| + encrypted_types.erase(syncable::BOOKMARKS);
|
| + encrypted_types.erase(syncable::SESSIONS);
|
| + FillNigoriEncryptedTypes(encrypted_types, &nigori);
|
| + test_types = GetEncryptedDataTypesFromNigori(nigori);
|
| + EXPECT_EQ(encrypted_types, test_types);
|
| +}
|
| +
|
| +// ProcessUnsyncedChangesForEncryption and other methods that rely on the syncer
|
| +// are tested in apply_updates_command_unittest.cc
|
| +
|
| +} // namespace syncable
|
|
|