blob: a83746cef9a78f9737e5f5d0362e85e6f5fabb68 [file] [log] [blame]
Yicheng Li1090c902020-11-10 11:31:43 -08001// Copyright 2020 The Chromium OS 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.
4
5#ifndef U2FD_MOCK_WEBAUTHN_STORAGE_H_
6#define U2FD_MOCK_WEBAUTHN_STORAGE_H_
7
8#include "u2fd/webauthn_storage.h"
9
10#include <string>
11
12#include <base/optional.h>
13#include <brillo/secure_blob.h>
14#include <gmock/gmock.h>
15
16namespace u2f {
17
18class MockWebAuthnStorage : public WebAuthnStorage {
19 public:
20 MockWebAuthnStorage() = default;
21 ~MockWebAuthnStorage() override = default;
22
23 MOCK_METHOD(bool, WriteRecord, (const WebAuthnRecord& record), (override));
24
25 MOCK_METHOD(bool, LoadRecords, (), (override));
26
Yicheng Lie7a26252021-02-03 12:18:37 -080027 MOCK_METHOD(bool,
28 SendRecordCountToUMA,
29 (MetricsLibraryInterface*),
30 (override));
31
Yicheng Li1090c902020-11-10 11:31:43 -080032 MOCK_METHOD(void, Reset, (), (override));
33
Yicheng Li4d27fa72020-12-10 11:09:21 -080034 MOCK_METHOD(base::Optional<brillo::Blob>,
Yicheng Li1090c902020-11-10 11:31:43 -080035 GetSecretByCredentialId,
36 (const std::string& credential_id),
37 (override));
38
39 MOCK_METHOD(base::Optional<WebAuthnRecord>,
40 GetRecordByCredentialId,
41 (const std::string& credential_id),
42 (override));
43};
44
45} // namespace u2f
46
47#endif // U2FD_MOCK_WEBAUTHN_STORAGE_H_