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

Side by Side Diff: media/cast/sender/video_sender_unittest.cc

Issue 445933002: Cast: Move retransmission to the transport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test compile Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/cast/sender/video_sender.cc ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 RtcpCastMessage cast_feedback(1); 496 RtcpCastMessage cast_feedback(1);
497 cast_feedback.media_ssrc = 2; 497 cast_feedback.media_ssrc = 2;
498 cast_feedback.ack_frame_id = 0; 498 cast_feedback.ack_frame_id = 0;
499 video_sender_->OnReceivedCastFeedback(cast_feedback); 499 video_sender_->OnReceivedCastFeedback(cast_feedback);
500 500
501 transport_.SetPause(false); 501 transport_.SetPause(false);
502 RunTasks(33); 502 RunTasks(33);
503 EXPECT_EQ(0, transport_.number_of_rtp_packets()); 503 EXPECT_EQ(0, transport_.number_of_rtp_packets());
504 } 504 }
505 505
506 TEST_F(VideoSenderTest, NAcksCancelRetransmits) {
507 InitEncoder(false);
508 transport_.SetPause(true);
509 // Send two video frames.
510 scoped_refptr<media::VideoFrame> video_frame = GetLargeNewVideoFrame();
511 video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks());
512 RunTasks(33);
513 video_frame = GetLargeNewVideoFrame();
514 video_sender_->InsertRawVideoFrame(video_frame, testing_clock_->NowTicks());
515 RunTasks(33);
516
517 // Frames should be in buffer, waiting. Now let's ack the first one and nack
518 // one packet in the second one.
519 RtcpCastMessage cast_feedback(1);
520 cast_feedback.media_ssrc = 2;
521 cast_feedback.ack_frame_id = 0;
522 PacketIdSet missing_packets;
523 missing_packets.insert(0);
524 cast_feedback.missing_frames_and_packets[1] = missing_packets;
525 video_sender_->OnReceivedCastFeedback(cast_feedback);
526
527 transport_.SetPause(false);
528 RunTasks(33);
529 // Only one packet should be retransmitted.
530 EXPECT_EQ(1, transport_.number_of_rtp_packets());
531 }
532
533 } // namespace cast 506 } // namespace cast
534 } // namespace media 507 } // namespace media
OLDNEW
« 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