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

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

Issue 2068133005: Refactoring: Use enum for RtpPayloadType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to Patch 2. Created 4 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 unified diff | Download patch
« no previous file with comments | « media/cast/receiver/frame_receiver.cc ('k') | media/cast/test/end2end_unittest.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 "media/cast/sender/audio_sender.h" 5 #include "media/cast/sender/audio_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); 99 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks());
100 task_runner_ = new FakeSingleThreadTaskRunner(testing_clock_); 100 task_runner_ = new FakeSingleThreadTaskRunner(testing_clock_);
101 cast_environment_ = 101 cast_environment_ =
102 new CastEnvironment(std::unique_ptr<base::TickClock>(testing_clock_), 102 new CastEnvironment(std::unique_ptr<base::TickClock>(testing_clock_),
103 task_runner_, task_runner_, task_runner_); 103 task_runner_, task_runner_, task_runner_);
104 audio_config_.codec = CODEC_AUDIO_OPUS; 104 audio_config_.codec = CODEC_AUDIO_OPUS;
105 audio_config_.use_external_encoder = false; 105 audio_config_.use_external_encoder = false;
106 audio_config_.frequency = kDefaultAudioSamplingRate; 106 audio_config_.frequency = kDefaultAudioSamplingRate;
107 audio_config_.channels = 2; 107 audio_config_.channels = 2;
108 audio_config_.bitrate = kDefaultAudioEncoderBitrate; 108 audio_config_.bitrate = kDefaultAudioEncoderBitrate;
109 audio_config_.rtp_payload_type = 127; 109 audio_config_.rtp_payload_type = RtpPayloadType::AUDIO_OPUS;
110 110
111 transport_ = new TestPacketSender(); 111 transport_ = new TestPacketSender();
112 transport_sender_.reset( 112 transport_sender_.reset(
113 new CastTransportImpl(testing_clock_, base::TimeDelta(), 113 new CastTransportImpl(testing_clock_, base::TimeDelta(),
114 base::WrapUnique(new TransportClient()), 114 base::WrapUnique(new TransportClient()),
115 base::WrapUnique(transport_), task_runner_)); 115 base::WrapUnique(transport_), task_runner_));
116 OperationalStatus operational_status = STATUS_UNINITIALIZED; 116 OperationalStatus operational_status = STATUS_UNINITIALIZED;
117 audio_sender_.reset(new AudioSender( 117 audio_sender_.reset(new AudioSender(
118 cast_environment_, 118 cast_environment_,
119 audio_config_, 119 audio_config_,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 base::TimeDelta max_rtcp_timeout = 161 base::TimeDelta max_rtcp_timeout =
162 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2); 162 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2);
163 testing_clock_->Advance(max_rtcp_timeout); 163 testing_clock_->Advance(max_rtcp_timeout);
164 task_runner_->RunTasks(); 164 task_runner_->RunTasks();
165 EXPECT_LE(1, transport_->number_of_rtp_packets()); 165 EXPECT_LE(1, transport_->number_of_rtp_packets());
166 EXPECT_LE(1, transport_->number_of_rtcp_packets()); 166 EXPECT_LE(1, transport_->number_of_rtcp_packets());
167 } 167 }
168 168
169 } // namespace cast 169 } // namespace cast
170 } // namespace media 170 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/receiver/frame_receiver.cc ('k') | media/cast/test/end2end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698