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

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

Issue 281453003: Cast: Simplify code path for RTCP sender report (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 6 years, 7 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/video_sender/video_sender.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // We need to run the task to cleanup the GPU instance. 233 // We need to run the task to cleanup the GPU instance.
234 video_sender_.reset(NULL); 234 video_sender_.reset(NULL);
235 task_runner_->RunTasks(); 235 task_runner_->RunTasks();
236 } 236 }
237 237
238 TEST_F(VideoSenderTest, RtcpTimer) { 238 TEST_F(VideoSenderTest, RtcpTimer) {
239 InitEncoder(false); 239 InitEncoder(false);
240 240
241 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame(); 241 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame();
242 242
243 base::TimeTicks capture_time; 243 base::TimeTicks capture_time = testing_clock_->NowTicks();
244 video_sender_->InsertRawVideoFrame(video_frame, capture_time); 244 video_sender_->InsertRawVideoFrame(video_frame, capture_time);
245 245
246 // Make sure that we send at least one RTCP packet. 246 // Make sure that we send at least one RTCP packet.
247 base::TimeDelta max_rtcp_timeout = 247 base::TimeDelta max_rtcp_timeout =
248 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); 248 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2);
249 249
250 RunTasks(max_rtcp_timeout.InMilliseconds()); 250 RunTasks(max_rtcp_timeout.InMilliseconds());
251 EXPECT_GE(transport_.number_of_rtp_packets(), 1); 251 EXPECT_GE(transport_.number_of_rtp_packets(), 1);
252 // Don't send RTCP prior to receiving an ACK. 252 // Don't send RTCP prior to receiving an ACK.
253 EXPECT_GE(transport_.number_of_rtcp_packets(), 0); 253 EXPECT_GE(transport_.number_of_rtcp_packets(), 0);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // Empty the pipeline. 363 // Empty the pipeline.
364 RunTasks(100); 364 RunTasks(100);
365 // Should have sent at least 7 packets. 365 // Should have sent at least 7 packets.
366 EXPECT_GE( 366 EXPECT_GE(
367 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), 367 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(),
368 7); 368 7);
369 } 369 }
370 370
371 } // namespace cast 371 } // namespace cast
372 } // namespace media 372 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_sender/video_sender.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698