#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
#include <stdint.h>
#include <functional>
#include <utility>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "device/bluetooth/bluetooth_remote_gatt_service.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/test_bluetooth_adapter_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_ANDROID)
#include "device/bluetooth/test/bluetooth_test_android.h"
#elif BUILDFLAG(IS_APPLE)
#include "device/bluetooth/test/bluetooth_test_mac.h"
#elif BUILDFLAG(IS_WIN)
#include "device/bluetooth/test/bluetooth_test_win.h"
#elif defined(USE_CAST_BLUETOOTH_ADAPTER)
#include "device/bluetooth/test/bluetooth_test_cast.h"
#elif BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
#include "device/bluetooth/test/bluetooth_test_bluez.h"
#elif BUILDFLAG(IS_FUCHSIA)
#include "device/bluetooth/test/bluetooth_test_fuchsia.h"
#endif
_;
Invoke;
WriteType;
namespace device {
class BluetoothRemoteGattCharacteristicTest :
#if BUILDFLAG(IS_WIN)
public BluetoothTestWinrt { … };
#if BUILDFLAG(IS_WIN)
using BluetoothRemoteGattCharacteristicTestWinrt =
BluetoothRemoteGattCharacteristicTest;
#endif
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GetIdentifier …
#else
#define MAYBE_GetIdentifier …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetIdentifier) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetIdentifier) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GetUUID …
#else
#define MAYBE_GetUUID …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetUUID) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetUUID) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GetProperties …
#else
#define MAYBE_GetProperties …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetProperties) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetProperties) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GetService …
#else
#define MAYBE_GetService …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetService) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetService) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_Empty …
#else
#define MAYBE_ReadRemoteCharacteristic_Empty …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_Empty) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_Empty) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_Empty …
#else
#define MAYBE_WriteRemoteCharacteristic_Empty …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_Empty) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_Empty) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Empty …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Empty …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_Empty) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_Empty) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Retry_ReadRemoteCharacteristic_DuringDestruction_Fails …
#else
#define MAYBE_Retry_ReadRemoteCharacteristic_DuringDestruction_Fails …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Retry_ReadRemoteCharacteristic_DuringDestruction_Fails) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_Retry_ReadRemoteCharacteristic_DuringDestruction_Fails) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Retry_WriteRemoteCharacteristic_DuringDestruction_Fails …
#else
#define MAYBE_Retry_WriteRemoteCharacteristic_DuringDestruction_Fails …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Retry_WriteRemoteCharacteristic_DuringDestruction_Fails) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_Retry_WriteRemoteCharacteristic_DuringDestruction_Fails) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Retry_DeprecatedWriteRemoteCharacteristic_DuringDestruction_Fails …
#else
#define MAYBE_Retry_DeprecatedWriteRemoteCharacteristic_DuringDestruction_Fails …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Retry_DeprecatedWriteRemoteCharacteristic_DuringDestruction_Fails) {
#else
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_Retry_DeprecatedWriteRemoteCharacteristic_DuringDestruction_Fails) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ReadRemoteCharacteristic_AfterDeleted …
#else
#define MAYBE_ReadRemoteCharacteristic_AfterDeleted …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_Disconnected …
#else
#define MAYBE_ReadRemoteCharacteristic_Disconnected …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_Disconnected) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_Disconnected) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_WriteRemoteCharacteristic_AfterDeleted …
#else
#define MAYBE_WriteRemoteCharacteristic_AfterDeleted …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_AfterDeleted …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_AfterDeleted …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_Disconnected …
#else
#define MAYBE_WriteRemoteCharacteristic_Disconnected …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_Disconnected) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_Disconnected) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Disconnected …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Disconnected …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_Disconnected) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_Disconnected) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic …
#else
#define MAYBE_ReadRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, ReadRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_ReadRemoteCharacteristic) { … }
static void TestCallback(
BluetoothRemoteGattCharacteristic::ValueCallback callback,
const TestBluetoothAdapterObserver& callback_observer,
std::optional<BluetoothGattService::GattErrorCode> error_code,
const std::vector<uint8_t>& value) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_GattCharacteristicValueChangedNotCalled …
#else
#define MAYBE_ReadRemoteCharacteristic_GattCharacteristicValueChangedNotCalled …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_GattCharacteristicValueChangedNotCalled) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_GattCharacteristicValueChangedNotCalled) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic …
#else
#define MAYBE_WriteRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, WriteRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_WriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_Twice …
#else
#define MAYBE_ReadRemoteCharacteristic_Twice …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_Twice) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_Twice) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_Twice …
#else
#define MAYBE_WriteRemoteCharacteristic_Twice …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_Twice) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_Twice) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Twice …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_Twice …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_Twice) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_Twice) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_MultipleCharacteristics …
#else
#define MAYBE_ReadRemoteCharacteristic_MultipleCharacteristics …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_MultipleCharacteristics) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_MultipleCharacteristics) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_MultipleCharacteristics …
#else
#define MAYBE_WriteRemoteCharacteristic_MultipleCharacteristics …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_MultipleCharacteristics) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_MultipleCharacteristics) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_MultipleCharacteristics …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_MultipleCharacteristics …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_MultipleCharacteristics) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_MultipleCharacteristics) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_Read_Read …
#else
#define MAYBE_RemoteCharacteristic_Nested_Read_Read …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_Read_Read) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_Read_Read) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_Write_Write …
#else
#define MAYBE_RemoteCharacteristic_Nested_Write_Write …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_Write_Write) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_Write_Write) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_DeprecatedWrite …
#else
#define MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_DeprecatedWrite …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_DeprecatedWrite_DeprecatedWrite) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_DeprecatedWrite) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_Read_Write …
#else
#define MAYBE_RemoteCharacteristic_Nested_Read_Write …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_Read_Write) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_Read_Write) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_Read_DeprecatedWrite …
#else
#define MAYBE_RemoteCharacteristic_Nested_Read_DeprecatedWrite …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_Read_DeprecatedWrite) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_Read_DeprecatedWrite) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_Write_Read …
#else
#define MAYBE_RemoteCharacteristic_Nested_Write_Read …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_Write_Read) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_Write_Read) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_Read …
#else
#define MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_Read …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
RemoteCharacteristic_Nested_DeprecatedWrite_Read) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_RemoteCharacteristic_Nested_DeprecatedWrite_Read) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadError …
#else
#define MAYBE_ReadError …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, ReadError) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_ReadError) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteError …
#else
#define MAYBE_WriteError …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, WriteError) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_WriteError) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteError …
#else
#define MAYBE_DeprecatedWriteError …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, DeprecatedWriteError) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_DeprecatedWriteError) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ReadSynchronousError …
#else
#define MAYBE_ReadSynchronousError …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_ReadSynchronousError) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_WriteSynchronousError …
#else
#define MAYBE_WriteSynchronousError …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_WriteSynchronousError) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DeprecatedWriteSynchronousError …
#else
#define MAYBE_DeprecatedWriteSynchronousError …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteSynchronousError) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_ReadPending …
#else
#define MAYBE_ReadRemoteCharacteristic_ReadPending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_ReadPending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_ReadPending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_WritePending …
#else
#define MAYBE_WriteRemoteCharacteristic_WritePending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_WritePending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_WritePending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_WritePending …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_WritePending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_WritePending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_WritePending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_WritePending …
#else
#define MAYBE_ReadRemoteCharacteristic_WritePending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_WritePending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_WritePending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_ReadRemoteCharacteristic_DeprecatedWritePending …
#else
#define MAYBE_ReadRemoteCharacteristic_DeprecatedWritePending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
ReadRemoteCharacteristic_DeprecatedWritePending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_ReadRemoteCharacteristic_DeprecatedWritePending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteRemoteCharacteristic_ReadPending …
#else
#define MAYBE_WriteRemoteCharacteristic_ReadPending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteRemoteCharacteristic_ReadPending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteRemoteCharacteristic_ReadPending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteRemoteCharacteristic_ReadPending …
#else
#define MAYBE_DeprecatedWriteRemoteCharacteristic_ReadPending …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteRemoteCharacteristic_ReadPending) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteRemoteCharacteristic_ReadPending) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Notification_During_ReadRemoteCharacteristic …
#else
#define MAYBE_Notification_During_ReadRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Notification_During_ReadRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_Notification_During_ReadRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Notification_During_WriteRemoteCharacteristic …
#else
#define MAYBE_Notification_During_WriteRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Notification_During_WriteRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_Notification_During_WriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_Notification_During_DeprecatedWriteRemoteCharacteristic …
#else
#define MAYBE_Notification_During_DeprecatedWriteRemoteCharacteristic …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
Notification_During_DeprecatedWriteRemoteCharacteristic) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_Notification_During_DeprecatedWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_NoNotifyOrIndicate …
#else
#define MAYBE_StartNotifySession_NoNotifyOrIndicate …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_NoNotifyOrIndicate) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_NoNotifyOrIndicate) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_NoConfigDescriptor …
#else
#define MAYBE_StartNotifySession_NoConfigDescriptor …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_NoConfigDescriptor) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_NoConfigDescriptor) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_MultipleConfigDescriptor …
#else
#define MAYBE_StartNotifySession_MultipleConfigDescriptor …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_MultipleConfigDescriptor) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_MultipleConfigDescriptor) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StartNotifySession_FailToSetCharacteristicNotification …
#else
#define MAYBE_StartNotifySession_FailToSetCharacteristicNotification …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_FailToSetCharacteristicNotification) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StartNotifySession_WriteDescriptorSynchronousError …
#else
#define MAYBE_StartNotifySession_WriteDescriptorSynchronousError …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_WriteDescriptorSynchronousError) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession …
#else
#define MAYBE_StartNotifySession …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, StartNotifySession) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_StartNotifySession) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_OnIndicate …
#else
#define MAYBE_StartNotifySession_OnIndicate …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_OnIndicate) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_OnIndicate) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_OnNotifyAndIndicate …
#else
#define MAYBE_StartNotifySession_OnNotifyAndIndicate …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_OnNotifyAndIndicate) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_OnNotifyAndIndicate) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_Multiple …
#else
#define MAYBE_StartNotifySession_Multiple …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_Multiple) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_Multiple) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySessionError_Multiple …
#else
#define MAYBE_StartNotifySessionError_Multiple …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySessionError_Multiple) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySessionError_Multiple) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySessionDisconnectOnError …
#else
#define MAYBE_StartNotifySessionDisconnectOnError …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySessionDisconnectOnError) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySessionDisconnectOnError) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StartNotifySession_AfterDeleted …
#else
#define MAYBE_StartNotifySession_AfterDeleted …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_BeforeDeleted …
#else
#define MAYBE_StartNotifySession_BeforeDeleted …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_BeforeDeleted) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_BeforeDeleted) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_StartNotifySession_Reentrant_Success_Success …
#else
#define MAYBE_StartNotifySession_Reentrant_Success_Success …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StartNotifySession_Reentrant_Success_Success) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySession_Reentrant_Success_Success) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession …
#else
#define MAYBE_StopNotifySession …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, StopNotifySession) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_StopNotifySession) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_SessionDeleted …
#else
#define MAYBE_StopNotifySession_SessionDeleted …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_SessionDeleted) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_SessionDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_SessionDeleted2 …
#else
#define MAYBE_StopNotifySession_SessionDeleted2 …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_SessionDeleted2) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_SessionDeleted2) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Cancelled …
#else
#define MAYBE_StopNotifySession_Cancelled …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Cancelled) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Cancelled) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_AfterDeleted …
#else
#define MAYBE_StopNotifySession_AfterDeleted …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_AfterDeleted) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_OnIndicate …
#else
#define MAYBE_StopNotifySession_OnIndicate …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_OnIndicate) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_OnIndicate) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_OnNotifyAndIndicate …
#else
#define MAYBE_StopNotifySession_OnNotifyAndIndicate …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_OnNotifyAndIndicate) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_OnNotifyAndIndicate) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Error …
#else
#define MAYBE_StopNotifySession_Error …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, StopNotifySession_Error) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_StopNotifySession_Error) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Multiple1 …
#else
#define MAYBE_StopNotifySession_Multiple1 …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Multiple1) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Multiple1) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Multiple2 …
#else
#define MAYBE_StopNotifySession_Multiple2 …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Multiple2) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Multiple2) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_StopStart …
#else
#define MAYBE_StopNotifySession_StopStart …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_StopStart) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_StopStart) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_StartStopStart …
#else
#define MAYBE_StopNotifySession_StartStopStart …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_StartStopStart) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_StartStopStart) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_StopStopStart …
#else
#define MAYBE_StopNotifySession_StopStopStart …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_StopStopStart) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_StopStopStart) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Reentrant_Success_Stop …
#else
#define MAYBE_StopNotifySession_Reentrant_Success_Stop …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Reentrant_Success_Stop) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Reentrant_Success_Stop) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Reentrant_Stop_StartSuccess …
#else
#define MAYBE_StopNotifySession_Reentrant_Stop_StartSuccess …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Reentrant_Stop_StartSuccess) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Reentrant_Stop_StartSuccess) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_StopNotifySession_Reentrant_Stop_StartError …
#else
#define MAYBE_StopNotifySession_Reentrant_Stop_StartError …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
StopNotifySession_Reentrant_Stop_StartError) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySession_Reentrant_Stop_StartError) { … }
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
#define MAYBE_GattCharacteristicAdded …
#else
#define MAYBE_GattCharacteristicAdded …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GattCharacteristicAdded) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GattCharacteristicAdded) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GattCharacteristicValueChanged …
#else
#define MAYBE_GattCharacteristicValueChanged …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
GattCharacteristicValueChanged) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_GattCharacteristicValueChanged) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_TwoGattCharacteristicValueChanges …
#else
#define MAYBE_TwoGattCharacteristicValueChanges …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_TwoGattCharacteristicValueChanges) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_GattCharacteristicValueChanged_AfterDeleted …
#else
#define MAYBE_GattCharacteristicValueChanged_AfterDeleted …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_GattCharacteristicValueChanged_AfterDeleted) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_GattCharacteristicValueChanged_DisconnectDuring …
#else
#define MAYBE_GattCharacteristicValueChanged_DisconnectDuring …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
GattCharacteristicValueChanged_DisconnectDuring) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_GattCharacteristicValueChanged_DisconnectDuring) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_GetDescriptors_FindNone …
#else
#define MAYBE_GetDescriptors_FindNone …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetDescriptors_FindNone) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetDescriptors_FindNone) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_GetDescriptors_and_GetDescriptor …
#else
#define MAYBE_GetDescriptors_and_GetDescriptor …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
GetDescriptors_and_GetDescriptor) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_GetDescriptors_and_GetDescriptor) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_GetDescriptorsByUUID …
#else
#define MAYBE_GetDescriptorsByUUID …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt, GetDescriptorsByUUID) {
#else
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_GetDescriptorsByUUID) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ReadDuringDisconnect …
#else
#define MAYBE_ReadDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_ReadDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_WriteDuringDisconnect …
#else
#define MAYBE_WriteDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest, MAYBE_WriteDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DeprecatedWriteDuringDisconnect …
#else
#define MAYBE_DeprecatedWriteDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteDuringDisconnect) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_WriteRemoteCharacteristicDuringDisconnect …
#else
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_WriteRemoteCharacteristicDuringDisconnect …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(
BluetoothRemoteGattCharacteristicTestWinrt,
WriteWithoutResponseOnlyCharacteristic_WriteRemoteCharacteristicDuringDisconnect) {
#else
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteWithoutResponseOnlyCharacteristic_WriteRemoteCharacteristicDuringDisconnect) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DeprecatedWriteRemoteCharacteristicDuringDisconnect …
#else
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DeprecatedWriteRemoteCharacteristicDuringDisconnect …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(
BluetoothRemoteGattCharacteristicTestWinrt,
WriteWithoutResponseOnlyCharacteristic_DeprecatedWriteRemoteCharacteristicDuringDisconnect) {
#else
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteWithoutResponseOnlyCharacteristic_DeprecatedWriteRemoteCharacteristicDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect …
#else
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(BluetoothRemoteGattCharacteristicTestWinrt,
WriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect) {
#else
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect …
#else
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect …
#endif
#if BUILDFLAG(IS_WIN)
TEST_P(
BluetoothRemoteGattCharacteristicTestWinrt,
DeprecatedWriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect) {
#else
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_CloseConnectionDuringDisconnect) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic …
#else
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic …
#endif
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic …
#else
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic …
#endif
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledDuringWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic …
#else
#define MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic …
#endif
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_WriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic …
#else
#define MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic …
#endif
TEST_F(
BluetoothRemoteGattCharacteristicTest,
MAYBE_DeprecatedWriteWithoutResponseOnlyCharacteristic_DisconnectCalledBeforeWriteRemoteCharacteristic) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StartNotifySessionDuringDisconnect …
#else
#define MAYBE_StartNotifySessionDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StartNotifySessionDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_StopNotifySessionDuringDisconnect …
#else
#define MAYBE_StopNotifySessionDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_StopNotifySessionDuringDisconnect) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DeleteNotifySessionDuringDisconnect …
#else
#define MAYBE_DeleteNotifySessionDuringDisconnect …
#endif
TEST_F(BluetoothRemoteGattCharacteristicTest,
MAYBE_DeleteNotifySessionDuringDisconnect) { … }
#if BUILDFLAG(IS_APPLE)
TEST_F(BluetoothRemoteGattCharacteristicTest,
SimulateDeviceModificationWhileDiscoveringDescriptors) {
InitWithFakeAdapter();
StartLowEnergyDiscoverySession();
BluetoothDevice* device = SimulateLowEnergyDevice(3);
device->CreateGattConnection(
GetGattConnectionCallback(Call::EXPECTED, Result::SUCCESS));
TestBluetoothAdapterObserver observer(adapter_);
SimulateGattConnection(device);
EXPECT_EQ(1, observer.device_changed_count());
AddServicesToDeviceMac(device, {kTestUUIDHeartRate});
SimulateDidDiscoverServicesMac(device);
EXPECT_EQ(1u, device->GetGattServices().size());
BluetoothRemoteGattService* service = device->GetGattServices()[0];
std::string characteristic_uuid = "11111111-0000-1000-8000-00805f9b34fb";
AddCharacteristicToServiceMac(service, characteristic_uuid,
0);
SimulateDidDiscoverCharacteristicsMac(service);
EXPECT_EQ(1u, service->GetCharacteristics().size());
BluetoothRemoteGattCharacteristic* characteristic =
service->GetCharacteristics()[0];
std::string descriptor_uuid = "22222222-0000-1000-8000-00805f9b34fb";
AddDescriptorToCharacteristicMac(characteristic, descriptor_uuid);
SimulateGattServicesChanged(device);
EXPECT_EQ(2, observer.device_changed_count());
SimulateDidDiscoverServicesMac(device);
SimulateDidDiscoverCharacteristicsMac(service);
SimulateDidDiscoverDescriptorsMac(characteristic);
EXPECT_EQ(0, observer.gatt_service_changed_count());
EXPECT_EQ(1u, service->GetCharacteristics().size());
EXPECT_EQ(1u, characteristic->GetDescriptors().size());
EXPECT_EQ(2, observer.device_changed_count());
observer.Reset();
SimulateDidDiscoverDescriptorsMac(characteristic);
EXPECT_EQ(1, observer.gatt_service_changed_count());
EXPECT_EQ(1, observer.device_changed_count());
}
#endif
#if BUILDFLAG(IS_APPLE)
TEST_F(BluetoothRemoteGattCharacteristicTest, ExtraDidDiscoverDescriptorsCall) {
InitWithFakeAdapter();
StartLowEnergyDiscoverySession();
BluetoothDevice* device = SimulateLowEnergyDevice(3);
device->CreateGattConnection(
GetGattConnectionCallback(Call::EXPECTED, Result::SUCCESS));
TestBluetoothAdapterObserver observer(adapter_);
SimulateGattConnection(device);
AddServicesToDeviceMac(device, {kTestUUIDHeartRate});
SimulateDidDiscoverServicesMac(device);
EXPECT_EQ(1u, device->GetGattServices().size());
BluetoothRemoteGattService* service = device->GetGattServices()[0];
std::string characteristic_uuid = "11111111-0000-1000-8000-00805f9b34fb";
AddCharacteristicToServiceMac(service, characteristic_uuid,
0);
SimulateDidDiscoverCharacteristicsMac(service);
EXPECT_EQ(1u, service->GetCharacteristics().size());
BluetoothRemoteGattCharacteristic* characteristic =
service->GetCharacteristics()[0];
std::string descriptor_uuid = "22222222-0000-1000-8000-00805f9b34fb";
AddDescriptorToCharacteristicMac(characteristic, descriptor_uuid);
SimulateDidDiscoverDescriptorsMac(characteristic);
EXPECT_EQ(1, observer.gatt_service_changed_count());
EXPECT_EQ(1u, service->GetCharacteristics().size());
EXPECT_EQ(1u, characteristic->GetDescriptors().size());
observer.Reset();
SimulateDidDiscoverDescriptorsMac(characteristic);
SimulateGattServicesChanged(device);
SimulateDidDiscoverDescriptorsMac(characteristic);
SimulateDidDiscoverServicesMac(device);
SimulateDidDiscoverDescriptorsMac(characteristic);
SimulateDidDiscoverCharacteristicsMac(service);
SimulateDidDiscoverDescriptorsMac(characteristic);
SimulateDidDiscoverDescriptorsMac(characteristic);
EXPECT_EQ(2, observer.device_changed_count());
}
#endif
#if BUILDFLAG(IS_WIN)
INSTANTIATE_TEST_SUITE_P(All,
BluetoothRemoteGattCharacteristicTestWinrt,
::testing::ValuesIn(kBluetoothTestWinrtParam));
#endif
}