Telemetry & perf owners += marja
[chromium-blink-merge.git] / sync / util / data_encryption_win_unittest.cc
blob0510554654fbbf49e11bbf32c838268b26f8e156
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
3 // found in the LICENSE file.
5 #include "sync/util/data_encryption_win.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace syncer {
10 namespace {
12 TEST(SyncDataEncryption, TestEncryptDecryptOfSampleString) {
13 std::vector<uint8> example(EncryptData("example"));
14 ASSERT_FALSE(example.empty());
15 std::string result;
16 ASSERT_TRUE(DecryptData(example, &result));
17 ASSERT_TRUE(result == "example");
20 TEST(SyncDataEncryption, TestDecryptFailure) {
21 std::vector<uint8> example(0, 0);
22 std::string result;
23 ASSERT_FALSE(DecryptData(example, &result));
26 } // namespace
27 } // namespace syncer