Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: webrtc/call/rtx_receive_stream_unittest.cc

Issue 3005793002: Fix setting of recovered flag in RtxReceiveStream. (Closed)
Patch Set: Drop static. git cl format. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/call/rtx_receive_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/rtx_receive_stream_unittest.cc
diff --git a/webrtc/call/rtx_receive_stream_unittest.cc b/webrtc/call/rtx_receive_stream_unittest.cc
index e9c82105212adec197b49f6298c1e345b5df3be5..2b2625d73638e0c73f10a9022d3b8cc0a861da7c 100644
--- a/webrtc/call/rtx_receive_stream_unittest.cc
+++ b/webrtc/call/rtx_receive_stream_unittest.cc
@@ -25,6 +25,7 @@ using ::testing::StrictMock;
constexpr int kMediaPayloadType = 100;
constexpr int kRtxPayloadType = 98;
+constexpr int kUnknownPayloadType = 90;
constexpr uint32_t kMediaSSRC = 0x3333333;
constexpr uint16_t kMediaSeqno = 0x5657;
@@ -55,8 +56,7 @@ constexpr uint8_t kRtxPacketWithCVO[] = {
};
std::map<int, int> PayloadTypeMapping() {
- std::map<int, int> m;
- m[kRtxPayloadType] = kMediaPayloadType;
+ const std::map<int, int> m = {{kRtxPayloadType, kMediaPayloadType}};
return m;
}
@@ -84,9 +84,26 @@ TEST(RtxReceiveStreamTest, RestoresPacketPayload) {
rtx_sink.OnRtpPacket(rtx_packet);
}
+TEST(RtxReceiveStreamTest, SetsRecoveredFlag) {
+ StrictMock<MockRtpPacketSink> media_sink;
+ RtxReceiveStream rtx_sink(&media_sink, PayloadTypeMapping(), kMediaSSRC);
+ RtpPacketReceived rtx_packet;
+ EXPECT_TRUE(rtx_packet.Parse(rtc::ArrayView<const uint8_t>(kRtxPacket)));
+ EXPECT_FALSE(rtx_packet.recovered());
+ EXPECT_CALL(media_sink, OnRtpPacket(_))
+ .WillOnce(testing::Invoke([](const RtpPacketReceived& packet) {
+ EXPECT_TRUE(packet.recovered());
+ }));
+
+ rtx_sink.OnRtpPacket(rtx_packet);
+}
+
TEST(RtxReceiveStreamTest, IgnoresUnknownPayloadType) {
StrictMock<MockRtpPacketSink> media_sink;
- RtxReceiveStream rtx_sink(&media_sink, std::map<int, int>(), kMediaSSRC);
+ const std::map<int, int> payload_type_mapping = {
+ {kUnknownPayloadType, kMediaPayloadType}};
+
+ RtxReceiveStream rtx_sink(&media_sink, payload_type_mapping, kMediaSSRC);
RtpPacketReceived rtx_packet;
EXPECT_TRUE(rtx_packet.Parse(rtc::ArrayView<const uint8_t>(kRtxPacket)));
rtx_sink.OnRtpPacket(rtx_packet);
« no previous file with comments | « webrtc/call/rtx_receive_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698