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

Side by Side Diff: chrome/browser/sync/syncable/nigori_util_unittest.cc

Issue 6537027: Revert 75287 - [Sync] Initial support for encrypting any datatype (no UI hook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/syncable/nigori_util.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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
5 #include "chrome/browser/sync/syncable/nigori_util.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace syncable {
9
10 typedef testing::Test NigoriUtilTest;
11
12 TEST_F(NigoriUtilTest, NigoriEncryptionTypes) {
13 sync_pb::NigoriSpecifics nigori;
14 ModelTypeSet encrypted_types;
15 FillNigoriEncryptedTypes(encrypted_types, &nigori);
16 ModelTypeSet test_types = GetEncryptedDataTypesFromNigori(nigori);
17 EXPECT_EQ(encrypted_types, test_types);
18
19 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
20 encrypted_types.insert(ModelTypeFromInt(i));
21 }
22 FillNigoriEncryptedTypes(encrypted_types, &nigori);
23 test_types = GetEncryptedDataTypesFromNigori(nigori);
24 encrypted_types.erase(syncable::NIGORI); // Should not get set.
25 encrypted_types.erase(syncable::PASSWORDS); // Should not get set.
26 EXPECT_EQ(encrypted_types, test_types);
27
28 encrypted_types.erase(syncable::BOOKMARKS);
29 encrypted_types.erase(syncable::SESSIONS);
30 FillNigoriEncryptedTypes(encrypted_types, &nigori);
31 test_types = GetEncryptedDataTypesFromNigori(nigori);
32 EXPECT_EQ(encrypted_types, test_types);
33 }
34
35 // ProcessUnsyncedChangesForEncryption and other methods that rely on the syncer
36 // are tested in apply_updates_command_unittest.cc
37
38 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/nigori_util.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698