| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 bool PlatformSupportsLowEnergy() override; | 30 bool PlatformSupportsLowEnergy() override; |
| 31 void InitWithDefaultAdapter() override; | 31 void InitWithDefaultAdapter() override; |
| 32 void InitWithoutDefaultAdapter() override; | 32 void InitWithoutDefaultAdapter() override; |
| 33 void InitWithFakeAdapter() override; | 33 void InitWithFakeAdapter() override; |
| 34 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; | 34 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; |
| 35 void SimulateGattConnection(BluetoothDevice* device) override; | 35 void SimulateGattConnection(BluetoothDevice* device) override; |
| 36 void SimulateGattConnectionError( | 36 void SimulateGattConnectionError( |
| 37 BluetoothDevice* device, | 37 BluetoothDevice* device, |
| 38 BluetoothDevice::ConnectErrorCode errorCode) override; | 38 BluetoothDevice::ConnectErrorCode errorCode) override; |
| 39 void SimulateGattDisconnection(BluetoothDevice* device) override; | 39 void SimulateGattDisconnection(BluetoothDevice* device) override; |
| 40 void SimulateGattServicesDiscovered( |
| 41 BluetoothDevice* device, |
| 42 const std::vector<std::string>& uuids) override; |
| 43 void SimulateGattServiceRemoved(BluetoothRemoteGattService* service) override; |
| 40 | 44 |
| 41 // Callback for the bluetooth central manager mock. | 45 // Callback for the bluetooth central manager mock. |
| 42 void OnFakeBluetoothDeviceConnectGattCalled(); | 46 void OnFakeBluetoothDeviceConnectGattCalled(); |
| 43 void OnFakeBluetoothGattDisconnect(); | 47 void OnFakeBluetoothGattDisconnect(); |
| 44 | 48 |
| 49 // Callback for the bluetooth peripheral mock. |
| 50 void OnFakeBluetoothServiceDiscovery(); |
| 51 |
| 45 protected: | 52 protected: |
| 46 class ScopedMockCentralManager; | 53 class ScopedMockCentralManager; |
| 47 | 54 |
| 48 // Utility function for finding CBUUIDs with relatively nice SHA256 hashes. | 55 // Utility function for finding CBUUIDs with relatively nice SHA256 hashes. |
| 49 std::string FindCBUUIDForHashTarget(); | 56 std::string FindCBUUIDForHashTarget(); |
| 50 | 57 |
| 51 BluetoothAdapterMac* adapter_mac_ = NULL; | 58 BluetoothAdapterMac* adapter_mac_ = NULL; |
| 52 std::unique_ptr<ScopedMockCentralManager> mock_central_manager_; | 59 std::unique_ptr<ScopedMockCentralManager> mock_central_manager_; |
| 53 }; | 60 }; |
| 54 | 61 |
| 55 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 62 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
| 56 typedef BluetoothTestMac BluetoothTest; | 63 typedef BluetoothTestMac BluetoothTest; |
| 57 | 64 |
| 58 } // namespace device | 65 } // namespace device |
| 59 | 66 |
| 60 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ | 67 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ |
| OLD | NEW |