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

Side by Side Diff: components/os_crypt/os_crypt.h

Issue 2104943002: Fix guard for UseMockKeyStorageForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 5 #ifndef COMPONENTS_OS_CRYPT_OS_CRYPT_H_
6 #define COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 6 #define COMPONENTS_OS_CRYPT_OS_CRYPT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #if defined(OS_MACOSX) 45 #if defined(OS_MACOSX)
46 // For unit testing purposes we instruct the Encryptor to use a mock Keychain 46 // For unit testing purposes we instruct the Encryptor to use a mock Keychain
47 // on the Mac. The default is to use the real Keychain. 47 // on the Mac. The default is to use the real Keychain.
48 static void UseMockKeychain(bool use_mock); 48 static void UseMockKeychain(bool use_mock);
49 #endif 49 #endif
50 50
51 private: 51 private:
52 DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt); 52 DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt);
53 }; 53 };
54 54
55 #if defined(USE_LIBSECRET) && defined(UNIT_TEST) 55 #if (defined(USE_LIBSECRET) || defined(USE_KWALLET)) && defined(UNIT_TEST)
56 // For unit testing purposes, inject methods to be used. 56 // For unit testing purposes, inject methods to be used.
57 // |get_key_storage_mock| provides the desired |KeyStorage| implementation. 57 // |get_key_storage_mock| provides the desired |KeyStorage| implementation.
58 // If the provider returns |nullptr|, a hardcoded password will be used. 58 // If the provider returns |nullptr|, a hardcoded password will be used.
59 // |get_password_v11_mock| provides a password to derive the encryption key from 59 // |get_password_v11_mock| provides a password to derive the encryption key from
60 // If both parameters are |nullptr|, the real implementation is restored. 60 // If both parameters are |nullptr|, the real implementation is restored.
61 void UseMockKeyStorageForTesting(KeyStorageLinux* (*get_key_storage_mock)(), 61 void UseMockKeyStorageForTesting(KeyStorageLinux* (*get_key_storage_mock)(),
62 std::string* (*get_password_v11_mock)()); 62 std::string* (*get_password_v11_mock)());
63 #endif // defined(USE_LIBSECRET) && defined(UNIT_TEST) 63 #endif // (defined(USE_LIBSECRET) || defined(USE_KWALLET)) &&
64 // defined(UNIT_TEST)
64 65
65 #endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 66 #endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698