| OLD | NEW |
| 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 "sync/util/cryptographer.h" | 5 #include "sync/util/cryptographer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "sync/protocol/password_specifics.pb.h" | 11 #include "sync/protocol/password_specifics.pb.h" |
| 12 #include "sync/test/fake_encryptor.h" | 12 #include "sync/test/fake_encryptor.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace syncer { | 16 namespace syncer { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 using ::testing::_; | 20 using ::testing::_; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 other_cryptographer.Bootstrap(token); | 195 other_cryptographer.Bootstrap(token); |
| 196 EXPECT_TRUE(other_cryptographer.is_ready()); | 196 EXPECT_TRUE(other_cryptographer.is_ready()); |
| 197 | 197 |
| 198 const char secret[] = "secret"; | 198 const char secret[] = "secret"; |
| 199 sync_pb::EncryptedData encrypted; | 199 sync_pb::EncryptedData encrypted; |
| 200 EXPECT_TRUE(other_cryptographer.EncryptString(secret, &encrypted)); | 200 EXPECT_TRUE(other_cryptographer.EncryptString(secret, &encrypted)); |
| 201 EXPECT_TRUE(cryptographer_.CanDecryptUsingDefaultKey(encrypted)); | 201 EXPECT_TRUE(cryptographer_.CanDecryptUsingDefaultKey(encrypted)); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace syncer | 204 } // namespace syncer |
| OLD | NEW |