mock_fast_pair_repository.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright 2021 The Chromium 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. #ifndef ASH_QUICK_PAIR_REPOSITORY_MOCK_FAST_PAIR_REPOSITORY_H_
  5. #define ASH_QUICK_PAIR_REPOSITORY_MOCK_FAST_PAIR_REPOSITORY_H_
  6. #include "ash/quick_pair/repository/fast_pair_repository.h"
  7. #include "base/memory/scoped_refptr.h"
  8. #include "testing/gmock/include/gmock/gmock.h"
  9. #include "third_party/abseil-cpp/absl/types/optional.h"
  10. namespace ash {
  11. namespace quick_pair {
  12. class MockFastPairRepository : public FastPairRepository {
  13. public:
  14. MockFastPairRepository();
  15. MockFastPairRepository(const MockFastPairRepository&) = delete;
  16. MockFastPairRepository& operator=(const MockFastPairRepository&) = delete;
  17. ~MockFastPairRepository() override;
  18. MOCK_METHOD(void,
  19. GetDeviceMetadata,
  20. (const std::string& hex_model_id,
  21. DeviceMetadataCallback callback),
  22. (override));
  23. MOCK_METHOD(void,
  24. CheckAccountKeys,
  25. (const AccountKeyFilter& account_key_filter,
  26. CheckAccountKeysCallback callback),
  27. (override));
  28. MOCK_METHOD(void,
  29. AssociateAccountKey,
  30. (scoped_refptr<Device> device,
  31. const std::vector<uint8_t>& account_key),
  32. (override));
  33. MOCK_METHOD(bool,
  34. AssociateAccountKeyLocally,
  35. (scoped_refptr<Device> device),
  36. (override));
  37. MOCK_METHOD(void,
  38. DeleteAssociatedDevice,
  39. (const std::string& mac_address,
  40. DeleteAssociatedDeviceCallback callback),
  41. (override));
  42. MOCK_METHOD(void,
  43. FetchDeviceImages,
  44. (scoped_refptr<Device> device),
  45. (override));
  46. MOCK_METHOD(bool,
  47. PersistDeviceImages,
  48. (scoped_refptr<Device> device),
  49. (override));
  50. MOCK_METHOD(bool,
  51. EvictDeviceImages,
  52. (const device::BluetoothDevice* device),
  53. (override));
  54. MOCK_METHOD(absl::optional<chromeos::bluetooth_config::DeviceImageInfo>,
  55. GetImagesForDevice,
  56. (const std::string& device_id),
  57. (override));
  58. MOCK_METHOD(void,
  59. CheckOptInStatus,
  60. (CheckOptInStatusCallback callback),
  61. (override));
  62. MOCK_METHOD(void,
  63. UpdateOptInStatus,
  64. (nearby::fastpair::OptInStatus opt_in_status,
  65. UpdateOptInStatusCallback callback),
  66. (override));
  67. MOCK_METHOD(void,
  68. DeleteAssociatedDeviceByAccountKey,
  69. (const std::vector<uint8_t>& account_key,
  70. DeleteAssociatedDeviceByAccountKeyCallback callback),
  71. (override));
  72. MOCK_METHOD(void,
  73. GetSavedDevices,
  74. (GetSavedDevicesCallback callback),
  75. (override));
  76. MOCK_METHOD(bool,
  77. IsAccountKeyPairedLocally,
  78. (const std::vector<uint8_t>& account_key),
  79. (override));
  80. };
  81. } // namespace quick_pair
  82. } // namespace ash
  83. #endif // ASH_QUICK_PAIR_REPOSITORY_MOCK_FAST_PAIR_REPOSITORY_H_