| 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 "base/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
| 9 #include "device/bluetooth/test/bluetooth_test.h" | 9 #include "device/bluetooth/test/bluetooth_test.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Test overrides: | 24 // Test overrides: |
| 25 void SetUp() override; | 25 void SetUp() override; |
| 26 | 26 |
| 27 // BluetoothTestBase overrides: | 27 // BluetoothTestBase overrides: |
| 28 bool PlatformSupportsLowEnergy() override; | 28 bool PlatformSupportsLowEnergy() override; |
| 29 void InitWithDefaultAdapter() override; | 29 void InitWithDefaultAdapter() override; |
| 30 void InitWithoutDefaultAdapter() override; | 30 void InitWithoutDefaultAdapter() override; |
| 31 void InitWithFakeAdapter() override; | 31 void InitWithFakeAdapter() override; |
| 32 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; | 32 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; |
| 33 void SimulateGattConnection(BluetoothDevice* device) override; | 33 void SimulateGattConnection(BluetoothDevice* device) override; |
| 34 void SimulateGattDisconnection(BluetoothDevice* device) override; | |
| 35 void SimulateGattConnectionError( | 34 void SimulateGattConnectionError( |
| 36 BluetoothDevice* device, | 35 BluetoothDevice* device, |
| 37 BluetoothDevice::ConnectErrorCode errorCode) override; | 36 BluetoothDevice::ConnectErrorCode errorCode) override; |
| 37 void SimulateGattDisconnection(BluetoothDevice* device) override; |
| 38 | 38 |
| 39 // Callback for the bluetooth central manager mock. | 39 // Callback for the bluetooth central manager mock. |
| 40 void OnFakeBluetoothDeviceConnectGattCalled(); | 40 void OnFakeBluetoothDeviceConnectGattCalled(); |
| 41 void OnFakeBluetoothGattDisconnect(); | 41 void OnFakeBluetoothGattDisconnect(); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 // Utility function for finding CBUUIDs with relatively nice SHA256 hashes. | 44 // Utility function for finding CBUUIDs with relatively nice SHA256 hashes. |
| 45 std::string FindCBUUIDForHashTarget(); | 45 std::string FindCBUUIDForHashTarget(); |
| 46 | 46 |
| 47 BluetoothAdapterMac* adapter_mac_ = NULL; | 47 BluetoothAdapterMac* adapter_mac_ = NULL; |
| 48 void* mock_central_manager_ = NULL; | 48 void* mock_central_manager_ = NULL; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 51 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
| 52 typedef BluetoothTestMac BluetoothTest; | 52 typedef BluetoothTestMac BluetoothTest; |
| 53 | 53 |
| 54 } // namespace device | 54 } // namespace device |
| 55 | 55 |
| 56 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ | 56 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_MAC_H_ |
| OLD | NEW |