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

Side by Side Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 1984983002: Remove use of RtpHeaderExtension and clean up (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed nit Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) 92 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr))
93 .Times(1); 93 .Times(1);
94 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) 94 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport())
95 .Times(1); 95 .Times(1);
96 return channel_proxy_; 96 return channel_proxy_;
97 })); 97 }));
98 stream_config_.voe_channel_id = kChannelId; 98 stream_config_.voe_channel_id = kChannelId;
99 stream_config_.rtp.ssrc = kSsrc; 99 stream_config_.rtp.ssrc = kSsrc;
100 stream_config_.rtp.c_name = kCName; 100 stream_config_.rtp.c_name = kCName;
101 stream_config_.rtp.extensions.push_back( 101 stream_config_.rtp.extensions.push_back(
102 RtpExtension(RtpExtension::kAudioLevel, kAudioLevelId)); 102 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
103 stream_config_.rtp.extensions.push_back( 103 stream_config_.rtp.extensions.push_back(
104 RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeId)); 104 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
105 stream_config_.rtp.extensions.push_back(RtpExtension( 105 stream_config_.rtp.extensions.push_back(RtpExtension(
106 RtpExtension::kTransportSequenceNumber, kTransportSequenceNumberId)); 106 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
107 } 107 }
108 108
109 AudioSendStream::Config& config() { return stream_config_; } 109 AudioSendStream::Config& config() { return stream_config_; }
110 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } 110 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
111 CongestionController* congestion_controller() { 111 CongestionController* congestion_controller() {
112 return &congestion_controller_; 112 return &congestion_controller_;
113 } 113 }
114 114
115 void SetupMockForSendTelephoneEvent() { 115 void SetupMockForSendTelephoneEvent() {
116 EXPECT_TRUE(channel_proxy_); 116 EXPECT_TRUE(channel_proxy_);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 testing::NiceMock<MockCongestionObserver> bitrate_observer_; 164 testing::NiceMock<MockCongestionObserver> bitrate_observer_;
165 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_; 165 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
166 CongestionController congestion_controller_; 166 CongestionController congestion_controller_;
167 }; 167 };
168 } // namespace 168 } // namespace
169 169
170 TEST(AudioSendStreamTest, ConfigToString) { 170 TEST(AudioSendStreamTest, ConfigToString) {
171 AudioSendStream::Config config(nullptr); 171 AudioSendStream::Config config(nullptr);
172 config.rtp.ssrc = kSsrc; 172 config.rtp.ssrc = kSsrc;
173 config.rtp.extensions.push_back( 173 config.rtp.extensions.push_back(
174 RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeId)); 174 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
175 config.rtp.c_name = kCName; 175 config.rtp.c_name = kCName;
176 config.voe_channel_id = kChannelId; 176 config.voe_channel_id = kChannelId;
177 config.cng_payload_type = 42; 177 config.cng_payload_type = 42;
178 config.red_payload_type = 17; 178 config.red_payload_type = 17;
179 EXPECT_EQ( 179 EXPECT_EQ(
180 "{rtp: {ssrc: 1234, extensions: [{name: " 180 "{rtp: {ssrc: 1234, extensions: [{uri: "
181 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], " 181 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], "
182 "c_name: foo_name}, voe_channel_id: 1, cng_payload_type: 42, " 182 "c_name: foo_name}, voe_channel_id: 1, cng_payload_type: 42, "
183 "red_payload_type: 17}", 183 "red_payload_type: 17}",
184 config.ToString()); 184 config.ToString());
185 } 185 }
186 186
187 TEST(AudioSendStreamTest, ConstructDestruct) { 187 TEST(AudioSendStreamTest, ConstructDestruct) {
188 ConfigHelper helper; 188 ConfigHelper helper;
189 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), 189 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(),
190 helper.congestion_controller()); 190 helper.congestion_controller());
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 static_cast<internal::AudioState*>(helper.audio_state().get()); 238 static_cast<internal::AudioState*>(helper.audio_state().get());
239 VoiceEngineObserver* voe_observer = 239 VoiceEngineObserver* voe_observer =
240 static_cast<VoiceEngineObserver*>(internal_audio_state); 240 static_cast<VoiceEngineObserver*>(internal_audio_state);
241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); 241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING);
242 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); 242 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected);
243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); 243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING);
244 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); 244 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
245 } 245 }
246 } // namespace test 246 } // namespace test
247 } // namespace webrtc 247 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698