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

Side by Side Diff: media/cast/audio_sender/audio_sender_unittest.cc

Issue 131233007: Cast: Clean up injection of transport into PacedPacketSender (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merged Created 6 years, 10 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
« no previous file with comments | « no previous file | media/cast/cast_receiver_impl.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 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 #include "media/base/media.h" 9 #include "media/base/media.h"
10 #include "media/cast/audio_sender/audio_sender.h" 10 #include "media/cast/audio_sender/audio_sender.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 audio_config_.bitrate = kDefaultAudioEncoderBitrate; 77 audio_config_.bitrate = kDefaultAudioEncoderBitrate;
78 audio_config_.rtp_config.payload_type = 127; 78 audio_config_.rtp_config.payload_type = 127;
79 79
80 transport::CastTransportConfig transport_config; 80 transport::CastTransportConfig transport_config;
81 transport_config.audio_rtp_config.payload_type = 127; 81 transport_config.audio_rtp_config.payload_type = 127;
82 transport_config.audio_channels = 2; 82 transport_config.audio_channels = 2;
83 transport_sender_.reset(new transport::CastTransportSenderImpl( 83 transport_sender_.reset(new transport::CastTransportSenderImpl(
84 testing_clock_, 84 testing_clock_,
85 transport_config, 85 transport_config,
86 base::Bind(&UpdateCastTransportStatus), 86 base::Bind(&UpdateCastTransportStatus),
87 task_runner_)); 87 task_runner_,
88 transport_sender_->InsertFakeTransportForTesting(&transport_); 88 &transport_));
89 audio_sender_.reset(new AudioSender( 89 audio_sender_.reset(new AudioSender(
90 cast_environment_, audio_config_, transport_sender_.get())); 90 cast_environment_, audio_config_, transport_sender_.get()));
91 task_runner_->RunTasks(); 91 task_runner_->RunTasks();
92 } 92 }
93 93
94 virtual ~AudioSenderTest() {} 94 virtual ~AudioSenderTest() {}
95 95
96 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { 96 static void UpdateCastTransportStatus(transport::CastTransportStatus status) {
97 EXPECT_EQ(status, transport::TRANSPORT_INITIALIZED); 97 EXPECT_EQ(status, transport::TRANSPORT_INITIALIZED);
98 } 98 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 base::TimeDelta max_rtcp_timeout = 148 base::TimeDelta max_rtcp_timeout =
149 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); 149 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2);
150 testing_clock_->Advance(max_rtcp_timeout); 150 testing_clock_->Advance(max_rtcp_timeout);
151 task_runner_->RunTasks(); 151 task_runner_->RunTasks();
152 EXPECT_GE(transport_.number_of_rtp_packets(), 1); 152 EXPECT_GE(transport_.number_of_rtp_packets(), 1);
153 EXPECT_EQ(transport_.number_of_rtcp_packets(), 1); 153 EXPECT_EQ(transport_.number_of_rtcp_packets(), 1);
154 } 154 }
155 155
156 } // namespace cast 156 } // namespace cast
157 } // namespace media 157 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/cast/cast_receiver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698