1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- // Copyright 2022 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef ASH_COMPONENTS_HID_DETECTION_FAKE_BLUETOOTH_HID_DETECTOR_H_
- #define ASH_COMPONENTS_HID_DETECTION_FAKE_BLUETOOTH_HID_DETECTOR_H_
- #include "ash/components/hid_detection/bluetooth_hid_detector.h"
- #include "third_party/abseil-cpp/absl/types/optional.h"
- namespace ash::hid_detection {
- class FakeBluetoothHidDetector : public BluetoothHidDetector {
- public:
- FakeBluetoothHidDetector();
- ~FakeBluetoothHidDetector() override;
- // BluetoothHidDetector:
- void SetInputDevicesStatus(InputDevicesStatus input_devices_status) override;
- const BluetoothHidDetectionStatus GetBluetoothHidDetectionStatus() override;
- void SimulatePairingStarted(
- BluetoothHidDetector::BluetoothHidMetadata pairing_device);
- void SetPairingState(absl::optional<BluetoothHidPairingState> pairing_state);
- void SimulatePairingSessionEnded();
- const InputDevicesStatus& input_devices_status() {
- return input_devices_status_;
- }
- size_t num_set_input_devices_status_calls() {
- return num_set_input_devices_status_calls_;
- }
- bool is_bluetooth_hid_detection_active() {
- return is_bluetooth_hid_detection_active_;
- }
- bool is_using_bluetooth() { return is_using_bluetooth_; }
- private:
- // BluetoothHidDetector:
- void PerformStartBluetoothHidDetection(
- InputDevicesStatus input_devices_status) override;
- void PerformStopBluetoothHidDetection(bool is_using_bluetooth) override;
- InputDevicesStatus input_devices_status_;
- size_t num_set_input_devices_status_calls_ = 0;
- absl::optional<BluetoothHidMetadata> current_pairing_device_;
- absl::optional<BluetoothHidPairingState> current_pairing_state_;
- bool is_bluetooth_hid_detection_active_ = false;
- bool is_using_bluetooth_ = false;
- };
- } // namespace ash::hid_detection
- #endif // ASH_COMPONENTS_HID_DETECTION_FAKE_BLUETOOTH_HID_DETECTOR_H_
|