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

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

Issue 1663413003: Clean up of CongestionController. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 | webrtc/audio/audio_send_stream_unittest.cc » ('j') | webrtc/call/call.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 const CodecInst kCodecInst = { 60 const CodecInst kCodecInst = {
61 123, "codec_name_recv", 96000, -187, 0, -103}; 61 123, "codec_name_recv", 96000, -187, 0, -103};
62 const NetworkStatistics kNetworkStats = { 62 const NetworkStatistics kNetworkStats = {
63 123, 456, false, 0, 0, 789, 12, 345, 678, 901, -1, -1, -1, -1, -1, 0}; 63 123, 456, false, 0, 0, 789, 12, 345, 678, 901, -1, -1, -1, -1, -1, 0};
64 const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest(); 64 const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
65 65
66 struct ConfigHelper { 66 struct ConfigHelper {
67 ConfigHelper() 67 ConfigHelper()
68 : simulated_clock_(123456), 68 : simulated_clock_(123456),
69 call_stats_(&simulated_clock_), 69 call_stats_(&simulated_clock_),
70 congestion_controller_(&process_thread_, 70 congestion_controller_(&simulated_clock_,
71 &process_thread_,
71 &call_stats_, 72 &call_stats_,
72 &bitrate_observer_) { 73 &bitrate_observer_,
74 &remote_bitrate_observer_) {
73 using testing::Invoke; 75 using testing::Invoke;
74 76
75 EXPECT_CALL(voice_engine_, 77 EXPECT_CALL(voice_engine_,
76 RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); 78 RegisterVoiceEngineObserver(_)).WillOnce(Return(0));
77 EXPECT_CALL(voice_engine_, 79 EXPECT_CALL(voice_engine_,
78 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); 80 DeRegisterVoiceEngineObserver()).WillOnce(Return(0));
79 AudioState::Config config; 81 AudioState::Config config;
80 config.voice_engine = &voice_engine_; 82 config.voice_engine = &voice_engine_;
81 audio_state_ = AudioState::Create(config); 83 audio_state_ = AudioState::Create(config);
82 84
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 152
151 EXPECT_CALL(voice_engine_, GetRecCodec(kChannelId, _)) 153 EXPECT_CALL(voice_engine_, GetRecCodec(kChannelId, _))
152 .WillOnce(DoAll(SetArgReferee<1>(kCodecInst), Return(0))); 154 .WillOnce(DoAll(SetArgReferee<1>(kCodecInst), Return(0)));
153 } 155 }
154 156
155 private: 157 private:
156 SimulatedClock simulated_clock_; 158 SimulatedClock simulated_clock_;
157 CallStats call_stats_; 159 CallStats call_stats_;
158 PacketRouter packet_router_; 160 PacketRouter packet_router_;
159 testing::NiceMock<MockBitrateObserver> bitrate_observer_; 161 testing::NiceMock<MockBitrateObserver> bitrate_observer_;
162 testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
160 testing::NiceMock<MockProcessThread> process_thread_; 163 testing::NiceMock<MockProcessThread> process_thread_;
161 MockCongestionController congestion_controller_; 164 MockCongestionController congestion_controller_;
162 MockRemoteBitrateEstimator remote_bitrate_estimator_; 165 MockRemoteBitrateEstimator remote_bitrate_estimator_;
163 testing::StrictMock<MockVoiceEngine> voice_engine_; 166 testing::StrictMock<MockVoiceEngine> voice_engine_;
164 rtc::scoped_refptr<AudioState> audio_state_; 167 rtc::scoped_refptr<AudioState> audio_state_;
165 AudioReceiveStream::Config stream_config_; 168 AudioReceiveStream::Config stream_config_;
166 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; 169 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr;
167 }; 170 };
168 171
169 void BuildOneByteExtension(std::vector<uint8_t>::iterator it, 172 void BuildOneByteExtension(std::vector<uint8_t>::iterator it,
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); 301 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq);
299 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal); 302 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal);
300 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc); 303 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc);
301 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng); 304 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng);
302 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng); 305 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng);
303 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_, 306 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
304 stats.capture_start_ntp_time_ms); 307 stats.capture_start_ntp_time_ms);
305 } 308 }
306 } // namespace test 309 } // namespace test
307 } // namespace webrtc 310 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/audio/audio_send_stream_unittest.cc » ('j') | webrtc/call/call.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698