OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_GATT_SERVER_TEST_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_GATT_SERVER_TEST_H_ |
| 7 |
| 8 #include <device/bluetooth/test/test_bluetooth_local_gatt_service_delegate.h> |
| 9 #include <cstdint> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "device/bluetooth/bluetooth_local_gatt_service.h" |
| 14 |
| 15 #if defined(OS_ANDROID) |
| 16 #include "device/bluetooth/test/bluetooth_test_android.h" |
| 17 #elif defined(OS_MACOSX) |
| 18 #include "device/bluetooth/test/bluetooth_test_mac.h" |
| 19 #elif defined(OS_WIN) |
| 20 #include "device/bluetooth/test/bluetooth_test_win.h" |
| 21 #elif defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 22 #include "device/bluetooth/test/bluetooth_test_bluez.h" |
| 23 #endif |
| 24 |
| 25 namespace device { |
| 26 |
| 27 // Base class for BlueZ GATT server unit tests. |
| 28 class BluetoothGattServerTest : public BluetoothTest { |
| 29 public: |
| 30 BluetoothGattServerTest(); |
| 31 ~BluetoothGattServerTest() override; |
| 32 |
| 33 // Start and complete boilerplate setup steps. |
| 34 void StartGattSetup(); |
| 35 void CompleteGattSetup(); |
| 36 |
| 37 // BluetoothTest overrides: |
| 38 void SetUp() override; |
| 39 void TearDown() override; |
| 40 |
| 41 // Utility methods to deal with values. |
| 42 static uint64_t GetInteger(const std::vector<uint8_t>& value); |
| 43 static std::vector<uint8_t> GetValue(uint64_t int_value); |
| 44 |
| 45 protected: |
| 46 base::WeakPtr<BluetoothLocalGattService> service_; |
| 47 |
| 48 std::unique_ptr<TestBluetoothLocalGattServiceDelegate> delegate_; |
| 49 }; |
| 50 |
| 51 } // namespace device |
| 52 |
| 53 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_GATT_SERVER_TEST_H_ |
OLD | NEW |