fake_bluetooth_adapter.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_FEATURE_STATUS_TRACKER_FAKE_BLUETOOTH_ADAPTER_H_
  5. #define ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_FAKE_BLUETOOTH_ADAPTER_H_
  6. #include "device/bluetooth/test/mock_bluetooth_adapter.h"
  7. #include "testing/gtest/include/gtest/gtest.h"
  8. namespace ash {
  9. namespace quick_pair {
  10. class FakeBluetoothAdapter
  11. : public testing::NiceMock<device::MockBluetoothAdapter> {
  12. public:
  13. void NotifyPoweredChanged(bool powered);
  14. bool IsPowered() const override;
  15. bool IsPresent() const override;
  16. void SetBluetoothIsPowered(bool powered);
  17. void SetBluetoothIsPresent(bool present);
  18. device::BluetoothAdapter::LowEnergyScanSessionHardwareOffloadingStatus
  19. GetLowEnergyScanSessionHardwareOffloadingStatus() override;
  20. void SetHardwareOffloadingStatus(
  21. device::BluetoothAdapter::LowEnergyScanSessionHardwareOffloadingStatus
  22. hardware_offloading_status);
  23. private:
  24. ~FakeBluetoothAdapter() = default;
  25. bool is_bluetooth_powered_ = false;
  26. bool is_bluetooth_present_ = true;
  27. device::BluetoothAdapter::LowEnergyScanSessionHardwareOffloadingStatus
  28. hardware_offloading_status_ = device::BluetoothAdapter::
  29. LowEnergyScanSessionHardwareOffloadingStatus::kSupported;
  30. };
  31. } // namespace quick_pair
  32. } // namespace ash
  33. #endif // ASH_QUICK_PAIR_FEATURE_STATUS_TRACKER_FAKE_BLUETOOTH_ADAPTER_H_