OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string> | 5 #include <string> |
6 | 6 |
| 7 #include "base/logging.h" |
7 #include "base/macros.h" | 8 #include "base/macros.h" |
8 #include "components/os_crypt/key_storage_libsecret.h" | 9 #include "components/os_crypt/key_storage_libsecret.h" |
9 #include "components/os_crypt/libsecret_util_linux.h" | 10 #include "components/os_crypt/libsecret_util_linux.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 // Mock functions use MockSecretValue, where SecretValue would appear, and are | 15 // Mock functions use MockSecretValue, where SecretValue would appear, and are |
15 // cast to the correct signature. We can reduce SecretValue to an std::string, | 16 // cast to the correct signature. We can reduce SecretValue to an std::string, |
16 // because we don't use anything else from it. | 17 // because we don't use anything else from it. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 235 |
235 TEST_F(LibsecretTest, LibsecretMigratesFromSchemaV1ToV2) { | 236 TEST_F(LibsecretTest, LibsecretMigratesFromSchemaV1ToV2) { |
236 KeyStorageLibsecret libsecret; | 237 KeyStorageLibsecret libsecret; |
237 MockLibsecretLoader::ResetForOSCrypt(); | 238 MockLibsecretLoader::ResetForOSCrypt(); |
238 MockLibsecretLoader::SetDeprecatedOSCryptPassword("swallow"); | 239 MockLibsecretLoader::SetDeprecatedOSCryptPassword("swallow"); |
239 std::string password = libsecret.GetKey(); | 240 std::string password = libsecret.GetKey(); |
240 EXPECT_EQ("swallow", password); | 241 EXPECT_EQ("swallow", password); |
241 } | 242 } |
242 | 243 |
243 } // namespace | 244 } // namespace |
OLD | NEW |