• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Chromium Authors
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 NET_DEVICE_BOUND_SESSIONS_MOCK_SESSION_STORE_H_
6 #define NET_DEVICE_BOUND_SESSIONS_MOCK_SESSION_STORE_H_
7 
8 #include <string>
9 #include <utility>
10 
11 #include "base/functional/callback.h"
12 #include "net/base/schemeful_site.h"
13 #include "net/device_bound_sessions/session.h"
14 #include "net/device_bound_sessions/session_store.h"
15 #include "testing/gmock/include/gmock/gmock.h"
16 
17 namespace net::device_bound_sessions {
18 
19 class SessionStoreMock : public SessionStore {
20  public:
21   SessionStoreMock();
22   ~SessionStoreMock() override;
23 
24   MOCK_METHOD(void, LoadSessions, (LoadSessionsCallback callback), (override));
25   MOCK_METHOD(void,
26               SaveSession,
27               (const SchemefulSite& site, const Session& session),
28               (override));
29   MOCK_METHOD(void,
30               DeleteSession,
31               (const SchemefulSite& site, const Session::Id& session_id),
32               (override));
33   MOCK_METHOD(SessionStore::SessionsMap, GetAllSessions, (), (const, override));
34   MOCK_METHOD(void,
35               RestoreSessionBindingKey,
36               (const SchemefulSite& site,
37                const Session::Id& session_id,
38                RestoreSessionBindingKeyCallback callback),
39               (override));
40 };
41 
42 }  // namespace net::device_bound_sessions
43 
44 #endif  // NET_DEVICE_BOUND_SESSIONS_MOCK_SESSION_STORE_H_
45