#include "content/browser/bluetooth/frame_connected_bluetooth_devices.h"
#include <tuple>
#include "base/memory/raw_ptr.h"
#include "content/browser/bluetooth/web_bluetooth_service_impl.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "device/bluetooth/bluetooth_gatt_connection.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "device/bluetooth/test/mock_bluetooth_gatt_connection.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/bluetooth/web_bluetooth.mojom.h"
namespace content {
NiceMockBluetoothAdapter;
NiceMockBluetoothDevice;
NiceMockBluetoothGattConnection;
_;
Return;
StrEq;
namespace {
const blink::WebBluetoothDeviceId kDeviceId0("000000000000000000000A==");
constexpr char kDeviceAddress0[] = …;
constexpr char kDeviceName0[] = …;
const blink::WebBluetoothDeviceId kDeviceId1("111111111111111111111A==");
constexpr char kDeviceAddress1[] = …;
constexpr char kDeviceName1[] = …;
mojo::AssociatedRemote<blink::mojom::WebBluetoothServerClient>
CreateServerClient() { … }
}
class FrameConnectedBluetoothDevicesTest
: public RenderViewHostImplTestHarness { … };
TEST_F(FrameConnectedBluetoothDevicesTest, Insert_Once) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, Insert_Twice) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoDevices) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, Insert_TwoMaps) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionId_OneDevice_AddOnce_RemoveOnce) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionId_OneDevice_AddOnce_RemoveTwice) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionId_OneDevice_AddTwice_RemoveOnce) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionId_OneDevice_AddTwice_RemoveTwice) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoDevices) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionId_TwoMaps) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionAddress_OneDevice_AddOnce_RemoveOnce) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionAddress_OneDevice_AddOnce_RemoveTwice) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionAddress_OneDevice_AddTwice_RemoveOnce) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
CloseConnectionAddress_OneDevice_AddTwice_RemoveTwice) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoDevices) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, CloseConnectionAddress_TwoMaps) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleDevices) { … }
TEST_F(FrameConnectedBluetoothDevicesTest, Destruction_MultipleMaps) { … }
TEST_F(FrameConnectedBluetoothDevicesTest,
DestroyedByWebContentsImplDestruction) { … }
}