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 <memory> |
| 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "device/bluetooth/bluetooth_adapter_factory.h" | 10 #include "device/bluetooth/bluetooth_adapter_factory.h" |
9 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" | 11 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "device/bluetooth/test/fake_central.h" |
11 | 13 |
12 namespace bluetooth { | 14 namespace bluetooth { |
13 | 15 |
14 // Implementation of FakeBluetooth in | 16 // Implementation of FakeBluetooth in |
15 // src/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom. | 17 // src/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom. |
16 // Implemented on top of the C++ device/bluetooth API. | 18 // Implemented on top of the C++ device/bluetooth API, mainly |
| 19 // device/bluetooth/bluetooth_adapter_factory.h. |
17 class FakeBluetooth : NON_EXPORTED_BASE(public mojom::FakeBluetooth) { | 20 class FakeBluetooth : NON_EXPORTED_BASE(public mojom::FakeBluetooth) { |
18 public: | 21 public: |
19 FakeBluetooth(); | 22 FakeBluetooth(); |
20 ~FakeBluetooth() override; | 23 ~FakeBluetooth() override; |
21 | 24 |
22 static void Create(mojom::FakeBluetoothRequest request); | 25 static void Create(mojom::FakeBluetoothRequest request); |
23 | 26 |
24 void SetLESupported(bool available, | 27 void SetLESupported(bool available, |
25 const SetLESupportedCallback& callback) override; | 28 const SetLESupportedCallback& callback) override; |
| 29 void SimulateCentral(mojom::CentralState state, |
| 30 const SimulateCentralCallback& callback) override; |
26 | 31 |
27 private: | 32 private: |
28 std::unique_ptr<device::BluetoothAdapterFactory::GlobalValuesForTesting> | 33 std::unique_ptr<device::BluetoothAdapterFactory::GlobalValuesForTesting> |
29 global_factory_values_; | 34 global_factory_values_; |
| 35 scoped_refptr<FakeCentral> fake_central_; |
30 }; | 36 }; |
31 | 37 |
32 } // namespace bluetooth | 38 } // namespace bluetooth |
33 | 39 |
34 #endif // DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ | 40 #endif // DEVICE_BLUETOOTH_TEST_FAKE_BLUETOOTH_H_ |
OLD | NEW |