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

Unified Diff: media/cast/sender/video_sender_unittest.cc

Issue 387933005: Cast: Refactor RTCP handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 | « media/cast/sender/video_sender.cc ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/video_sender_unittest.cc
diff --git a/media/cast/sender/video_sender_unittest.cc b/media/cast/sender/video_sender_unittest.cc
index bccc248680be29057f218d3187f2597cabdaa72c..8ae3ca3515504d508037ec64562a87162efff791 100644
--- a/media/cast/sender/video_sender_unittest.cc
+++ b/media/cast/sender/video_sender_unittest.cc
@@ -15,6 +15,7 @@
#include "media/cast/net/cast_transport_config.h"
#include "media/cast/net/cast_transport_sender_impl.h"
#include "media/cast/net/pacing/paced_sender.h"
+#include "media/cast/net/rtcp/rtcp_receiver.h"
#include "media/cast/sender/video_sender.h"
#include "media/cast/test/fake_single_thread_task_runner.h"
#include "media/cast/test/fake_video_encode_accelerator.h"
@@ -66,7 +67,7 @@ class TestPacketSender : public PacketSender {
callback_ = cb;
return false;
}
- if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) {
+ if (RtcpReceiver::IsRtcpPacket(&packet->data[0], packet->data.size())) {
++number_of_rtcp_packets_;
} else {
// Check that at least one RTCP packet was sent before the first RTP
@@ -272,8 +273,8 @@ TEST_F(VideoSenderTest, RtcpTimer) {
EXPECT_LE(1, transport_.number_of_rtcp_packets());
// Build Cast msg and expect RTCP packet.
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(cast_feedback);
RunTasks(max_rtcp_timeout.InMilliseconds());
EXPECT_LE(1, transport_.number_of_rtcp_packets());
@@ -289,8 +290,8 @@ TEST_F(VideoSenderTest, ResendTimer) {
// ACK the key frame.
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(cast_feedback);
video_frame = GetNewVideoFrame();
@@ -324,7 +325,7 @@ TEST_F(VideoSenderTest, LogAckReceivedEvent) {
task_runner_->RunTasks();
RtcpCastMessage cast_feedback(1);
- cast_feedback.ack_frame_id_ = num_frames - 1;
+ cast_feedback.ack_frame_id = num_frames - 1;
video_sender_->OnReceivedCastFeedback(cast_feedback);
@@ -370,8 +371,8 @@ TEST_F(VideoSenderTest, StopSendingInTheAbsenceOfAck) {
// Start acking and make sure we're back to steady-state.
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(cast_feedback);
EXPECT_LE(
4,
@@ -391,8 +392,8 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmit) {
video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks());
RunTasks(33);
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
// Send 3 more frames but don't ACK.
for (int i = 0; i < 3; ++i) {
@@ -405,11 +406,11 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmit) {
// Send duplicated ACKs and mix some invalid NACKs.
for (int i = 0; i < 10; ++i) {
RtcpCastMessage ack_feedback(1);
- ack_feedback.media_ssrc_ = 2;
- ack_feedback.ack_frame_id_ = 0;
+ ack_feedback.media_ssrc = 2;
+ ack_feedback.ack_frame_id = 0;
RtcpCastMessage nack_feedback(1);
- nack_feedback.media_ssrc_ = 2;
- nack_feedback.missing_frames_and_packets_[255] = PacketIdSet();
+ nack_feedback.media_ssrc = 2;
+ nack_feedback.missing_frames_and_packets[255] = PacketIdSet();
video_sender_->OnReceivedCastFeedback(ack_feedback);
video_sender_->OnReceivedCastFeedback(nack_feedback);
}
@@ -418,8 +419,8 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmit) {
// Re-transmit one packet because of duplicated ACKs.
for (int i = 0; i < 3; ++i) {
RtcpCastMessage ack_feedback(1);
- ack_feedback.media_ssrc_ = 2;
- ack_feedback.ack_frame_id_ = 0;
+ ack_feedback.media_ssrc = 2;
+ ack_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(ack_feedback);
}
EXPECT_EQ(number_of_packets_sent + 1, transport_.number_of_rtp_packets());
@@ -431,8 +432,8 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmitDoesNotCancelRetransmits) {
video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks());
RunTasks(33);
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
// Send 2 more frames but don't ACK.
for (int i = 0; i < 2; ++i) {
@@ -453,11 +454,11 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmitDoesNotCancelRetransmits) {
// Send duplicated ACKs and mix some invalid NACKs.
for (int i = 0; i < 10; ++i) {
RtcpCastMessage ack_feedback(1);
- ack_feedback.media_ssrc_ = 2;
- ack_feedback.ack_frame_id_ = 0;
+ ack_feedback.media_ssrc = 2;
+ ack_feedback.ack_frame_id = 0;
RtcpCastMessage nack_feedback(1);
- nack_feedback.media_ssrc_ = 2;
- nack_feedback.missing_frames_and_packets_[255] = PacketIdSet();
+ nack_feedback.media_ssrc = 2;
+ nack_feedback.missing_frames_and_packets[255] = PacketIdSet();
video_sender_->OnReceivedCastFeedback(ack_feedback);
video_sender_->OnReceivedCastFeedback(nack_feedback);
}
@@ -466,8 +467,8 @@ TEST_F(VideoSenderTest, DuplicateAckRetransmitDoesNotCancelRetransmits) {
// Re-transmit one packet because of duplicated ACKs.
for (int i = 0; i < 3; ++i) {
RtcpCastMessage ack_feedback(1);
- ack_feedback.media_ssrc_ = 2;
- ack_feedback.ack_frame_id_ = 0;
+ ack_feedback.media_ssrc = 2;
+ ack_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(ack_feedback);
}
@@ -485,8 +486,8 @@ TEST_F(VideoSenderTest, AcksCancelRetransmits) {
// Frame should be in buffer, waiting. Now let's ack it.
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
video_sender_->OnReceivedCastFeedback(cast_feedback);
transport_.SetPause(false);
@@ -508,11 +509,11 @@ TEST_F(VideoSenderTest, NAcksCancelRetransmits) {
// Frames should be in buffer, waiting. Now let's ack the first one and nack
// one packet in the second one.
RtcpCastMessage cast_feedback(1);
- cast_feedback.media_ssrc_ = 2;
- cast_feedback.ack_frame_id_ = 0;
+ cast_feedback.media_ssrc = 2;
+ cast_feedback.ack_frame_id = 0;
PacketIdSet missing_packets;
missing_packets.insert(0);
- cast_feedback.missing_frames_and_packets_[1] = missing_packets;
+ cast_feedback.missing_frames_and_packets[1] = missing_packets;
video_sender_->OnReceivedCastFeedback(cast_feedback);
transport_.SetPause(false);
« no previous file with comments | « media/cast/sender/video_sender.cc ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698