Loading system/gd/hci/acl_manager_mock.h +4 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,10 @@ class MockAclConnection : public AclConnection { (common::OnceCallback<void(ErrorCode)> on_disconnect, os::Handler* handler), (override)); MOCK_METHOD(bool, Disconnect, (DisconnectReason reason), (override)); MOCK_METHOD(void, Finish, (), (override)); MOCK_METHOD(QueueUpEnd*, GetAclQueueEnd, (), (const, override)); QueueUpEnd* GetAclQueueEnd() const override { return acl_queue_.GetUpEnd(); } mutable common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder> acl_queue_{10}; }; class MockAclManager : public AclManager { Loading system/gd/l2cap/classic/internal/link_manager_test.cc +0 −8 Original line number Diff line number Diff line Loading @@ -119,8 +119,6 @@ TEST_F(L2capClassicLinkManagerTest, connect_fixed_channel_service_without_acl) { // Step 3: ACL connection success event should trigger channel creation for all registered services std::unique_ptr<MockAclConnection> acl_connection = std::make_unique<MockAclConnection>(); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, RegisterDisconnectCallback(_, l2cap_handler_)).Times(1); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -279,8 +277,6 @@ TEST_F(L2capClassicLinkManagerTest, not_acquiring_channels_should_disconnect_acl // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading Loading @@ -349,8 +345,6 @@ TEST_F(L2capClassicLinkManagerTest, acquiring_channels_should_not_disconnect_acl // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading Loading @@ -421,8 +415,6 @@ TEST_F(L2capClassicLinkManagerTest, acquiring_and_releasing_channels_should_even // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading system/gd/l2cap/le/internal/link_manager_test.cc +0 −8 Original line number Diff line number Diff line Loading @@ -117,8 +117,6 @@ TEST_F(L2capLeLinkManagerTest, connect_fixed_channel_service_without_acl) { // Step 3: ACL connection success event should trigger channel creation for all registered services std::unique_ptr<MockAclConnection> acl_connection = std::make_unique<MockAclConnection>(); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, RegisterDisconnectCallback(_, l2cap_handler_)).Times(1); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); Loading Loading @@ -282,8 +280,6 @@ TEST_F(L2capLeLinkManagerTest, not_acquiring_channels_should_disconnect_acl_afte // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -355,8 +351,6 @@ TEST_F(L2capLeLinkManagerTest, acquiring_channels_should_not_disconnect_acl_afte // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -430,8 +424,6 @@ TEST_F(L2capLeLinkManagerTest, acquiring_and_releasing_channels_should_eventuall // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading
system/gd/hci/acl_manager_mock.h +4 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,10 @@ class MockAclConnection : public AclConnection { (common::OnceCallback<void(ErrorCode)> on_disconnect, os::Handler* handler), (override)); MOCK_METHOD(bool, Disconnect, (DisconnectReason reason), (override)); MOCK_METHOD(void, Finish, (), (override)); MOCK_METHOD(QueueUpEnd*, GetAclQueueEnd, (), (const, override)); QueueUpEnd* GetAclQueueEnd() const override { return acl_queue_.GetUpEnd(); } mutable common::BidiQueue<PacketView<kLittleEndian>, BasePacketBuilder> acl_queue_{10}; }; class MockAclManager : public AclManager { Loading
system/gd/l2cap/classic/internal/link_manager_test.cc +0 −8 Original line number Diff line number Diff line Loading @@ -119,8 +119,6 @@ TEST_F(L2capClassicLinkManagerTest, connect_fixed_channel_service_without_acl) { // Step 3: ACL connection success event should trigger channel creation for all registered services std::unique_ptr<MockAclConnection> acl_connection = std::make_unique<MockAclConnection>(); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, RegisterDisconnectCallback(_, l2cap_handler_)).Times(1); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -279,8 +277,6 @@ TEST_F(L2capClassicLinkManagerTest, not_acquiring_channels_should_disconnect_acl // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading Loading @@ -349,8 +345,6 @@ TEST_F(L2capClassicLinkManagerTest, acquiring_channels_should_not_disconnect_acl // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading Loading @@ -421,8 +415,6 @@ TEST_F(L2capClassicLinkManagerTest, acquiring_and_releasing_channels_should_even // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(device)); std::unique_ptr<FixedChannel> channel_1, channel_2; EXPECT_CALL(mock_service_1, NotifyChannelCreation(_)).WillOnce([&channel_1](std::unique_ptr<FixedChannel> channel) { Loading
system/gd/l2cap/le/internal/link_manager_test.cc +0 −8 Original line number Diff line number Diff line Loading @@ -117,8 +117,6 @@ TEST_F(L2capLeLinkManagerTest, connect_fixed_channel_service_without_acl) { // Step 3: ACL connection success event should trigger channel creation for all registered services std::unique_ptr<MockAclConnection> acl_connection = std::make_unique<MockAclConnection>(); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, RegisterDisconnectCallback(_, l2cap_handler_)).Times(1); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); Loading Loading @@ -282,8 +280,6 @@ TEST_F(L2capLeLinkManagerTest, not_acquiring_channels_should_disconnect_acl_afte // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -355,8 +351,6 @@ TEST_F(L2capLeLinkManagerTest, acquiring_channels_should_not_disconnect_acl_afte // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading Loading @@ -430,8 +424,6 @@ TEST_F(L2capLeLinkManagerTest, acquiring_and_releasing_channels_should_eventuall // Step 3: ACL connection success event should trigger channel creation for all registered services auto* raw_acl_connection = new MockAclConnection(); std::unique_ptr<MockAclConnection> acl_connection(raw_acl_connection); hci::AclConnection::Queue link_queue{10}; EXPECT_CALL(*acl_connection, GetAclQueueEnd()).WillRepeatedly((Return(link_queue.GetUpEnd()))); EXPECT_CALL(*acl_connection, GetAddress()).WillRepeatedly(Return(address_with_type.GetAddress())); EXPECT_CALL(*acl_connection, GetAddressType()).WillRepeatedly(Return(address_with_type.GetAddressType())); std::unique_ptr<FixedChannel> channel_1, channel_2; Loading