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

Side by Side Diff: sync/util/data_encryption_win_unittest.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 | « sync/util/data_encryption_win.cc ('k') | sync/util/data_type_histogram.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/sync/util/data_encryption.h" 5 #include "sync/util/data_encryption_win.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using std::string; 12 using std::string;
13 using std::vector; 13 using std::vector;
14 14
15 namespace { 15 namespace {
16 16
17 TEST(SyncDataEncryption, TestEncryptDecryptOfSampleString) { 17 TEST(SyncDataEncryption, TestEncryptDecryptOfSampleString) {
18 vector<uint8> example(EncryptData("example")); 18 vector<uint8> example(EncryptData("example"));
19 ASSERT_FALSE(example.empty()); 19 ASSERT_FALSE(example.empty());
20 string result; 20 string result;
21 ASSERT_TRUE(DecryptData(example, &result)); 21 ASSERT_TRUE(DecryptData(example, &result));
22 ASSERT_TRUE(result == "example"); 22 ASSERT_TRUE(result == "example");
23 } 23 }
24 24
25 TEST(SyncDataEncryption, TestDecryptFailure) { 25 TEST(SyncDataEncryption, TestDecryptFailure) {
26 vector<uint8> example(0, 0); 26 vector<uint8> example(0, 0);
27 string result; 27 string result;
28 ASSERT_FALSE(DecryptData(example, &result)); 28 ASSERT_FALSE(DecryptData(example, &result));
29 } 29 }
30 30
31 } // namespace 31 } // namespace
OLDNEW
« no previous file with comments | « sync/util/data_encryption_win.cc ('k') | sync/util/data_type_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698