#include "services/device/serial/serial_port_manager_impl.h"
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "base/threading/thread.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/public/cpp/bluetooth_uuid.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "device/bluetooth/test/mock_bluetooth_socket.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "services/device/device_service_test_base.h"
#include "services/device/public/cpp/bluetooth/bluetooth_utils.h"
#include "services/device/public/cpp/device_features.h"
#include "services/device/public/cpp/test/fake_serial_port_client.h"
#include "services/device/public/mojom/serial.mojom.h"
#include "services/device/serial/bluetooth_serial_device_enumerator.h"
#include "services/device/serial/fake_serial_device_enumerator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
InvokeFuture;
RunOnceCallback;
TestFuture;
_;
Invoke;
Return;
const base::FilePath kFakeDevicePath1(FILE_PATH_LITERAL("/dev/fakeserialmojo"));
const base::FilePath kFakeDevicePath2(FILE_PATH_LITERAL("\\\\COM800\\"));
constexpr char kDeviceAddress[] = …;
class MockSerialPortManagerClient : public mojom::SerialPortManagerClient { … };
class TestingBluetoothAdapter : public device::MockBluetoothAdapter { … };
}
class SerialPortManagerImplTest : public DeviceServiceTestBase { … };
TEST_F(SerialPortManagerImplTest, SimpleEnumerationTest) { … }
TEST_F(SerialPortManagerImplTest, GetDevices) { … }
TEST_F(SerialPortManagerImplTest, OpenUnknownPort) { … }
TEST_F(SerialPortManagerImplTest, PortRemovedAndAdded) { … }
TEST_F(SerialPortManagerImplTest, OpenBluetoothDevicePort) { … }
TEST_F(SerialPortManagerImplTest, BluetoothPortRemovedAndAdded) { … }
TEST_F(SerialPortManagerImplTest, BluetoothDeviceChanged) { … }
TEST_F(SerialPortManagerImplTest, BluetoothDeviceConnectedStateChanged) { … }
TEST_F(SerialPortManagerImplTest,
BluetoothSerialDeviceEnumerator_DeleteBeforeAdapterInit) { … }
}