#include "content/browser/bluetooth/web_bluetooth_pairing_manager_impl.h"
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/notreached.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "content/browser/bluetooth/web_bluetooth_pairing_manager.h"
#include "content/browser/bluetooth/web_bluetooth_pairing_manager_delegate.h"
#include "content/public/browser/bluetooth_delegate.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
SingleThreadTaskEnvironment;
TestFuture;
WebBluetoothDeviceId;
WebBluetoothResult;
WebBluetoothService;
WebBluetoothWriteType;
BluetoothDevice;
MockBluetoothDevice;
Return;
PairPromptResult;
struct TestData { … };
const TestData kValidTestData = …;
const TestData kValidNonTestData = …;
const TestData kInvalidTestData;
}
class BluetoothPairingManagerTest : public testing::Test,
public WebBluetoothPairingManagerDelegate { … };
TEST_F(BluetoothPairingManagerTest, ReadSuccessfulAuthFirstSuccess) { … }
TEST_F(BluetoothPairingManagerTest, ReadSuccessfulAuthSecondSuccess) { … }
TEST_F(BluetoothPairingManagerTest, ReadFailAllAuthsFail) { … }
TEST_F(BluetoothPairingManagerTest, ReadInvalidCharacteristicId) { … }
TEST_F(BluetoothPairingManagerTest, ReadCharacteristicDeleteDelegate) { … }
TEST_F(BluetoothPairingManagerTest, ReadCharacteristicDoublePair) { … }
TEST_F(BluetoothPairingManagerTest,
WriteCharacteristicSuccessfulAuthFirstSuccess) { … }
TEST_F(BluetoothPairingManagerTest,
WriteCharacteristicSuccessfulAuthSecondSuccess) { … }
TEST_F(BluetoothPairingManagerTest, WriteCharacteristicFailAllAuthsFail) { … }
TEST_F(BluetoothPairingManagerTest, WriteCharacteristicInvalidID) { … }
TEST_F(BluetoothPairingManagerTest, WriteCharacteristicDeleteDelegate) { … }
TEST_F(BluetoothPairingManagerTest, WriteCharacteristicDoublePair) { … }
TEST_F(BluetoothPairingManagerTest, DescriptorReadSuccessfulAuthFirstSuccess) { … }
TEST_F(BluetoothPairingManagerTest, DescriptorReadSuccessfulAuthSecondSuccess) { … }
TEST_F(BluetoothPairingManagerTest, DescriptorReadFailAllAuthsFail) { … }
TEST_F(BluetoothPairingManagerTest, DescriptorReadInvalidDescriptorId) { … }
TEST_F(BluetoothPairingManagerTest, ReadDescriptorDeleteDelegate) { … }
TEST_F(BluetoothPairingManagerTest, ReadDescriptorDoublePair) { … }
TEST_F(BluetoothPairingManagerTest, WriteDescriptorSuccessfulAuthFirstSuccess) { … }
TEST_F(BluetoothPairingManagerTest,
WriteDescriptorSuccessfulAuthSecondSuccess) { … }
TEST_F(BluetoothPairingManagerTest, WriteDescriptorFailAllAuthsFail) { … }
TEST_F(BluetoothPairingManagerTest, WriteDescriptorInvalidID) { … }
TEST_F(BluetoothPairingManagerTest, WriteDescriptorDeleteDelegate) { … }
TEST_F(BluetoothPairingManagerTest, WriteDescriptorDoublePair) { … }
TEST_F(BluetoothPairingManagerTest, CredentialPromptPINSuccess) { … }
TEST_F(BluetoothPairingManagerTest, CredentialPromptPINCancelled) { … }
TEST_F(BluetoothPairingManagerTest, CredentialPromptPasskeyCancelled) { … }
TEST_F(BluetoothPairingManagerTest, PairConfirmPromptSuccess) { … }
TEST_F(BluetoothPairingManagerTest, PairConfirmPromptCancelled) { … }
TEST_F(BluetoothPairingManagerTest, PairConfirmPinPromptSuccess) { … }
TEST_F(BluetoothPairingManagerTest, PairConfirmPinPromptCancelled) { … }
TEST_F(BluetoothPairingManagerTest, StartNotificationsAllAuthsSuccess) { … }
TEST_F(BluetoothPairingManagerTest, StartNotificationsAuthSecondSuccess) { … }
TEST_F(BluetoothPairingManagerTest, StartNotificationsAllAuthsFail) { … }
}