summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc43
1 files changed, 0 insertions, 43 deletions
diff --git a/third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc b/third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc
index 6cd4f09459..1d66821958 100644
--- a/third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc
+++ b/third_party/libwebrtc/rtc_base/async_packet_socket_unittest.cc
@@ -63,48 +63,5 @@ TEST(AsyncPacketSocket, RegisteredCallbackReceivePacketsFromNotify) {
mock_socket.NotifyPacketReceived();
}
-TEST(AsyncPacketSocket, RegisteredCallbackReceivePacketsFromSignalReadPacket) {
- MockAsyncPacketSocket mock_socket;
- MockFunction<void(AsyncPacketSocket*, const rtc::ReceivedPacket&)>
- received_packet;
-
- EXPECT_CALL(received_packet, Call);
- mock_socket.RegisterReceivedPacketCallback(received_packet.AsStdFunction());
- char data[1] = {'a'};
- mock_socket.SignalReadPacket(&mock_socket, data, 1, SocketAddress(), -1);
-}
-
-TEST(AsyncPacketSocket, SignalReadPacketTriggeredByNotifyPacketReceived) {
- class SigslotPacketReceiver : public sigslot::has_slots<> {
- public:
- explicit SigslotPacketReceiver(rtc::AsyncPacketSocket& socket) {
- socket.SignalReadPacket.connect(this,
- &SigslotPacketReceiver::OnPacketReceived);
- }
-
- bool packet_received() const { return packet_received_; }
-
- private:
- void OnPacketReceived(AsyncPacketSocket*,
- const char*,
- size_t,
- const SocketAddress&,
- // TODO(bugs.webrtc.org/9584): Change to passing the
- // int64_t timestamp by value.
- const int64_t&) {
- packet_received_ = true;
- }
-
- bool packet_received_ = false;
- };
-
- MockAsyncPacketSocket mock_socket;
- SigslotPacketReceiver receiver(mock_socket);
- ASSERT_FALSE(receiver.packet_received());
-
- mock_socket.NotifyPacketReceived();
- EXPECT_TRUE(receiver.packet_received());
-}
-
} // namespace
} // namespace rtc