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_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "device/bluetooth/bluetooth_adapter.h" | 17 #include "device/bluetooth/bluetooth_adapter.h" |
18 #include "device/bluetooth/bluetooth_device.h" | 18 #include "device/bluetooth/bluetooth_device.h" |
19 #include "device/bluetooth/bluetooth_discovery_session.h" | 19 #include "device/bluetooth/bluetooth_discovery_session.h" |
20 #include "device/bluetooth/bluetooth_gatt_connection.h" | 20 #include "device/bluetooth/bluetooth_gatt_connection.h" |
21 #include "device/bluetooth/bluetooth_gatt_notify_session.h" | 21 #include "device/bluetooth/bluetooth_gatt_notify_session.h" |
| 22 #include "device/bluetooth/bluetooth_local_gatt_service.h" |
22 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" | 23 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
23 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" | 24 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" |
24 #include "device/bluetooth/bluetooth_remote_gatt_service.h" | 25 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
26 | 27 |
27 namespace device { | 28 namespace device { |
28 | 29 |
29 class BluetoothAdapter; | 30 class BluetoothAdapter; |
30 class BluetoothDevice; | 31 class BluetoothDevice; |
| 32 class BluetoothLocalGattCharacteristic; |
| 33 class BluetoothLocalGattDescriptor; |
31 | 34 |
32 // A test fixture for Bluetooth that abstracts platform specifics for creating | 35 // A test fixture for Bluetooth that abstracts platform specifics for creating |
33 // and controlling fake low level objects. | 36 // and controlling fake low level objects. |
34 // | 37 // |
35 // Subclasses on each platform implement this, and are then typedef-ed to | 38 // Subclasses on each platform implement this, and are then typedef-ed to |
36 // BluetoothTest. | 39 // BluetoothTest. |
37 class BluetoothTestBase : public testing::Test { | 40 class BluetoothTestBase : public testing::Test { |
38 public: | 41 public: |
39 enum class Call { EXPECTED, NOT_EXPECTED }; | 42 enum class Call { EXPECTED, NOT_EXPECTED }; |
40 | 43 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 int actual_error_callback_calls_ = 0; | 382 int actual_error_callback_calls_ = 0; |
380 bool unexpected_success_callback_ = false; | 383 bool unexpected_success_callback_ = false; |
381 bool unexpected_error_callback_ = false; | 384 bool unexpected_error_callback_ = false; |
382 | 385 |
383 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; | 386 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; |
384 }; | 387 }; |
385 | 388 |
386 } // namespace device | 389 } // namespace device |
387 | 390 |
388 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 391 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
OLD | NEW |