Commit 2c50fa52 authored by Omar Morsi's avatar Omar Morsi Committed by Commit Bot

Accept only OnceCallbacks in PlatformKeysService interface

Bug: 1130594
Change-Id: I815675d485a40f7131e48908cd1f25d8f20c74d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421459Reviewed-by: default avatarPavol Marko <pmarko@chromium.org>
Commit-Queue: Omar Morsi <omorsi@google.com>
Cr-Commit-Position: refs/heads/master@{#809232}
parent 6b2a0e0d
...@@ -57,7 +57,7 @@ CertificateHelperForTesting::~CertificateHelperForTesting() = default; ...@@ -57,7 +57,7 @@ CertificateHelperForTesting::~CertificateHelperForTesting() = default;
void CertificateHelperForTesting::GetCertificates( void CertificateHelperForTesting::GetCertificates(
platform_keys::TokenId token_id, platform_keys::TokenId token_id,
const platform_keys::GetCertificatesCallback& callback) { platform_keys::GetCertificatesCallback callback) {
auto result = std::make_unique<net::CertificateList>(); auto result = std::make_unique<net::CertificateList>();
*result = cert_list_; *result = cert_list_;
std::move(callback).Run(std::move(result), platform_keys::Status::kSuccess); std::move(callback).Run(std::move(result), platform_keys::Status::kSuccess);
......
...@@ -63,7 +63,7 @@ struct CertificateHelperForTesting { ...@@ -63,7 +63,7 @@ struct CertificateHelperForTesting {
private: private:
void GetCertificates(platform_keys::TokenId token_id, void GetCertificates(platform_keys::TokenId token_id,
const platform_keys::GetCertificatesCallback& callback); platform_keys::GetCertificatesCallback callback);
platform_keys::MockPlatformKeysService* platform_keys_service_ = nullptr; platform_keys::MockPlatformKeysService* platform_keys_service_ = nullptr;
scoped_refptr<net::X509Certificate> template_cert_; scoped_refptr<net::X509Certificate> template_cert_;
......
...@@ -39,14 +39,14 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -39,14 +39,14 @@ class MockPlatformKeysService : public PlatformKeysService {
GenerateRSAKey, GenerateRSAKey,
(TokenId token_id, (TokenId token_id,
unsigned int modulus_length_bits, unsigned int modulus_length_bits,
const GenerateKeyCallback& callback), GenerateKeyCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
GenerateECKey, GenerateECKey,
(TokenId token_id, (TokenId token_id,
const std::string& named_curve, const std::string& named_curve,
const GenerateKeyCallback& callback), GenerateKeyCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -55,7 +55,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -55,7 +55,7 @@ class MockPlatformKeysService : public PlatformKeysService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -63,7 +63,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -63,7 +63,7 @@ class MockPlatformKeysService : public PlatformKeysService {
(base::Optional<TokenId> token_id, (base::Optional<TokenId> token_id,
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -72,18 +72,18 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -72,18 +72,18 @@ class MockPlatformKeysService : public PlatformKeysService {
const std::string& data, const std::string& data,
const std::string& public_key_spki_der, const std::string& public_key_spki_der,
HashAlgorithm hash_algorithm, HashAlgorithm hash_algorithm,
const SignCallback& callback), SignCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
SelectClientCertificates, SelectClientCertificates,
(const std::vector<std::string>& certificate_authorities, (const std::vector<std::string>& certificate_authorities,
const SelectCertificatesCallback& callback), SelectCertificatesCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
GetCertificates, GetCertificates,
(TokenId token_id, const GetCertificatesCallback& callback), (TokenId token_id, GetCertificatesCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -95,14 +95,14 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -95,14 +95,14 @@ class MockPlatformKeysService : public PlatformKeysService {
ImportCertificate, ImportCertificate,
(TokenId token_id, (TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const ImportCertificateCallback& callback), ImportCertificateCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
RemoveCertificate, RemoveCertificate,
(TokenId token_id, (TokenId token_id,
const scoped_refptr<net::X509Certificate>& certificate, const scoped_refptr<net::X509Certificate>& certificate,
const RemoveCertificateCallback& callback), RemoveCertificateCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
...@@ -117,7 +117,7 @@ class MockPlatformKeysService : public PlatformKeysService { ...@@ -117,7 +117,7 @@ class MockPlatformKeysService : public PlatformKeysService {
MOCK_METHOD(void, MOCK_METHOD(void,
GetKeyLocations, GetKeyLocations,
(const std::string& public_key_spki_der, (const std::string& public_key_spki_der,
const GetKeyLocationsCallback& callback), GetKeyLocationsCallback callback),
(override)); (override));
MOCK_METHOD(void, MOCK_METHOD(void,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment