#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "device/bluetooth/floss/floss_adapter_client.h"
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_exported_object.h"
#include "dbus/mock_object_proxy.h"
#include "dbus/object_path.h"
#include "device/bluetooth/floss/floss_dbus_client.h"
#include "device/bluetooth/floss/floss_manager_client.h"
#include "device/bluetooth/floss/test_helpers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
_;
constexpr char kTestMethod0[] = …;
constexpr char kTestMethod1[] = …;
constexpr char kTestMethod2[] = …;
constexpr uint8_t kFakeU8Return = …;
constexpr uint32_t kFakeU32Return = …;
constexpr char kFakeStrReturn[] = …;
constexpr uint32_t kFakeU32Param = …;
constexpr char kFakeStrParam[] = …;
constexpr bool kFakeBoolParam = …;
constexpr uint32_t kFakeCallbackId = …;
constexpr uint32_t kFakeConnectionCallbackId = …;
constexpr char kFakeDeviceAddr[] = …;
constexpr char kFakeDeviceName[] = …;
constexpr uint8_t kFakeBytes[] = …;
constexpr uint8_t kFakeUuidByteArray[] = …;
constexpr char kFakeUuidStr[] = …;
constexpr floss::FlossAdapterClient::BluetoothDeviceType kFakeType = …;
}
namespace floss {
namespace {
class TestAdapterObserver : public FlossAdapterClient::Observer { … };
}
class FlossAdapterClientTest : public testing::Test { … };
TEST_F(FlossAdapterClientTest, InitializesCorrectly) { … }
TEST_F(FlossAdapterClientTest, HandlesAddressChanges) { … }
TEST_F(FlossAdapterClientTest, HandlesNameChanges) { … }
TEST_F(FlossAdapterClientTest, HandlesDiscoverableChanges) { … }
TEST_F(FlossAdapterClientTest, HandlesDiscoveryChanges) { … }
TEST_F(FlossAdapterClientTest, HandlesFoundDevices) { … }
TEST_F(FlossAdapterClientTest, HandlesClearedDevices) { … }
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
TEST_F(FlossAdapterClientTest, HandlesSsp) { … }
#endif
TEST_F(FlossAdapterClientTest, CreateBond) { … }
TEST_F(FlossAdapterClientTest, CallAdapterMethods) { … }
TEST_F(FlossAdapterClientTest, GenericMethodGetConnectionState) { … }
TEST_F(FlossAdapterClientTest,
GenericMethodConnectAndDisconnectAllEnabledProfiles) { … }
TEST_F(FlossAdapterClientTest, GenericMethodSetPairingConfirmation) { … }
TEST_F(FlossAdapterClientTest, GenericMethodSetPasskey) { … }
TEST_F(FlossAdapterClientTest, GenericMethodGetRemoteUuids) { … }
TEST_F(FlossAdapterClientTest, GenericMethodGetRemoteType) { … }
TEST_F(FlossAdapterClientTest, OnAdapterPropertyChanged) { … }
}