OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 #ifndef DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ | 4 #ifndef DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ |
5 #define DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ | 5 #define DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "device/bluetooth/bluetooth_adapter_factory.h" | 8 #include "device/bluetooth/bluetooth_adapter_factory.h" |
9 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" | 9 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "device/bluetooth/test/fake_central.h" |
11 | 11 |
12 namespace bluetooth { | 12 namespace bluetooth { |
13 | 13 |
14 // Implementation of FakeBluetooth in | 14 // Implementation of FakeBluetooth in |
15 // src/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom. | 15 // src/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom. |
16 // Implemented on top of the C++ device/bluetooth API. | 16 // Implemented on top of the C++ device/bluetooth API, mainly |
| 17 // device/bluetooth/bluetooth_adapter_factory.h. |
17 class FakeBluetooth : NON_EXPORTED_BASE(public mojom::FakeBluetooth) { | 18 class FakeBluetooth : NON_EXPORTED_BASE(public mojom::FakeBluetooth) { |
18 public: | 19 public: |
19 FakeBluetooth(); | 20 FakeBluetooth(); |
20 ~FakeBluetooth() override; | 21 ~FakeBluetooth() override; |
21 | 22 |
22 static void Create(mojom::FakeBluetoothRequest request); | 23 static void Create(mojom::FakeBluetoothRequest request); |
23 | 24 |
24 void SetLESupported(bool available, | 25 void SetLESupported(bool available, |
25 const SetLESupportedCallback& callback) override; | 26 const SetLESupportedCallback& callback) override; |
| 27 void SimulateCentral(mojom::CentralState state, |
| 28 const SimulateCentralCallback& callback) override; |
26 | 29 |
27 private: | 30 private: |
28 std::unique_ptr<device::BluetoothAdapterFactory::GlobalValuesForTesting> | 31 std::unique_ptr<device::BluetoothAdapterFactory::GlobalValuesForTesting> |
29 global_factory_values_; | 32 global_factory_values_; |
| 33 scoped_refptr<FakeCentral> fake_central_; |
30 }; | 34 }; |
31 | 35 |
32 } // namespace bluetooth | 36 } // namespace bluetooth |
33 | 37 |
34 #endif // DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ | 38 #endif // DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ |
OLD | NEW |