Chromium Code Reviews| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 void SimulateGattNotifySessionStartError( | 69 void SimulateGattNotifySessionStartError( |
| 70 BluetoothRemoteGattCharacteristic* characteristic, | 70 BluetoothRemoteGattCharacteristic* characteristic, |
| 71 BluetoothRemoteGattService::GattErrorCode error_code) override; | 71 BluetoothRemoteGattService::GattErrorCode error_code) override; |
| 72 void SimulateGattCharacteristicChanged( | 72 void SimulateGattCharacteristicChanged( |
| 73 BluetoothRemoteGattCharacteristic* characteristic, | 73 BluetoothRemoteGattCharacteristic* characteristic, |
| 74 const std::vector<uint8_t>& value) override; | 74 const std::vector<uint8_t>& value) override; |
| 75 void SimulateGattCharacteristicRemoved( | 75 void SimulateGattCharacteristicRemoved( |
| 76 BluetoothRemoteGattService* service, | 76 BluetoothRemoteGattService* service, |
| 77 BluetoothRemoteGattCharacteristic* characteristic) override; | 77 BluetoothRemoteGattCharacteristic* characteristic) override; |
| 78 | 78 |
| 79 // Simulates a connected low energy device. Used before starting a low energy | |
| 80 // discovey session. | |
| 81 void SimulateConnectedLowEnergyDevice( | |
|
ortuno
2016/10/31 04:30:51
Please add this function to bluetooth_test.h and a
jlebel
2016/11/07 01:43:18
Done.
| |
| 82 int device_ordinal, | |
| 83 const BluetoothDevice::UUIDSet& service_uuids); | |
|
ortuno
2016/10/31 04:30:51
I like the current pattern of just specifying a si
jlebel
2016/11/07 01:43:18
Done.
| |
| 84 | |
| 79 // Callback for the bluetooth central manager mock. | 85 // Callback for the bluetooth central manager mock. |
| 80 void OnFakeBluetoothDeviceConnectGattCalled(); | 86 void OnFakeBluetoothDeviceConnectGattCalled(); |
| 81 void OnFakeBluetoothGattDisconnect(); | 87 void OnFakeBluetoothGattDisconnect(); |
| 82 | 88 |
| 83 // Callback for the bluetooth peripheral mock. | 89 // Callback for the bluetooth peripheral mock. |
| 84 void OnFakeBluetoothServiceDiscovery(); | 90 void OnFakeBluetoothServiceDiscovery(); |
| 85 void OnFakeBluetoothCharacteristicReadValue(); | 91 void OnFakeBluetoothCharacteristicReadValue(); |
| 86 void OnFakeBluetoothCharacteristicWriteValue(std::vector<uint8_t> value); | 92 void OnFakeBluetoothCharacteristicWriteValue(std::vector<uint8_t> value); |
| 87 void OnFakeBluetoothGattSetCharacteristicNotification(); | 93 void OnFakeBluetoothGattSetCharacteristicNotification(); |
| 88 | 94 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 102 BluetoothAdapterMac* adapter_mac_ = nullptr; | 108 BluetoothAdapterMac* adapter_mac_ = nullptr; |
| 103 std::unique_ptr<ScopedMockCentralManager> mock_central_manager_; | 109 std::unique_ptr<ScopedMockCentralManager> mock_central_manager_; |
| 104 }; | 110 }; |
| 105 | 111 |
| 106 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 112 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
| 107 typedef BluetoothTestMac BluetoothTest; | 113 typedef BluetoothTestMac BluetoothTest; |
| 108 | 114 |
| 109 } // namespace device | 115 } // namespace device |
| 110 | 116 |
| 111 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ | 117 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ |
| OLD | NEW |