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 | 4 |
5 #include "device/bluetooth/test/fake_bluetooth.h" | 5 #include "device/bluetooth/test/fake_bluetooth.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "device/bluetooth/bluetooth_adapter_factory.h" | 10 #include "device/bluetooth/bluetooth_adapter_factory.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 mojo::MakeStrongBinding(base::MakeUnique<FakeBluetooth>(), | 25 mojo::MakeStrongBinding(base::MakeUnique<FakeBluetooth>(), |
26 std::move(request)); | 26 std::move(request)); |
27 } | 27 } |
28 | 28 |
29 void FakeBluetooth::SetLESupported(bool supported, | 29 void FakeBluetooth::SetLESupported(bool supported, |
30 const SetLESupportedCallback& callback) { | 30 const SetLESupportedCallback& callback) { |
31 global_factory_values_->SetLESupported(supported); | 31 global_factory_values_->SetLESupported(supported); |
32 callback.Run(); | 32 callback.Run(); |
33 } | 33 } |
34 | 34 |
| 35 void FakeBluetooth::SimulateCentral(mojom::CentralState state, |
| 36 const SimulateCentralCallback& callback) { |
| 37 mojom::FakeCentralPtr fake_central_ptr; |
| 38 fake_central_ = base::MakeShared<FakeCentral>( |
| 39 state, mojo::MakeRequest(&fake_central_ptr)); |
| 40 device::BluetoothAdapterFactory::SetAdapterForTesting(fake_central_); |
| 41 callback.Run(std::move(fake_central_ptr)); |
| 42 } |
| 43 |
35 } // namespace bluetooth | 44 } // namespace bluetooth |
OLD | NEW |