| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 auto states = CreateAudioNetworkAdaptor(); | 175 auto states = CreateAudioNetworkAdaptor(); |
| 176 for (auto& mock_controller : states.mock_controllers) | 176 for (auto& mock_controller : states.mock_controllers) |
| 177 EXPECT_CALL(*mock_controller, MakeDecision(_)); | 177 EXPECT_CALL(*mock_controller, MakeDecision(_)); |
| 178 states.audio_network_adaptor->GetEncoderRuntimeConfig(); | 178 states.audio_network_adaptor->GetEncoderRuntimeConfig(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 TEST(AudioNetworkAdaptorImplTest, | 181 TEST(AudioNetworkAdaptorImplTest, |
| 182 DumpEncoderRuntimeConfigIsCalledOnGetEncoderRuntimeConfig) { | 182 DumpEncoderRuntimeConfigIsCalledOnGetEncoderRuntimeConfig) { |
| 183 auto states = CreateAudioNetworkAdaptor(); | 183 auto states = CreateAudioNetworkAdaptor(); |
| 184 | 184 |
| 185 AudioNetworkAdaptor::EncoderRuntimeConfig config; | 185 AudioEncoderRuntimeConfig config; |
| 186 config.bitrate_bps = rtc::Optional<int>(32000); | 186 config.bitrate_bps = rtc::Optional<int>(32000); |
| 187 config.enable_fec = rtc::Optional<bool>(true); | 187 config.enable_fec = rtc::Optional<bool>(true); |
| 188 | 188 |
| 189 EXPECT_CALL(*states.mock_controllers[0], MakeDecision(_)) | 189 EXPECT_CALL(*states.mock_controllers[0], MakeDecision(_)) |
| 190 .WillOnce(SetArgPointee<0>(config)); | 190 .WillOnce(SetArgPointee<0>(config)); |
| 191 | 191 |
| 192 EXPECT_CALL(*states.mock_debug_dump_writer, | 192 EXPECT_CALL(*states.mock_debug_dump_writer, |
| 193 DumpEncoderRuntimeConfig(EncoderRuntimeConfigIs(config), | 193 DumpEncoderRuntimeConfig(EncoderRuntimeConfigIs(config), |
| 194 kClockInitialTimeMs)); | 194 kClockInitialTimeMs)); |
| 195 states.audio_network_adaptor->GetEncoderRuntimeConfig(); | 195 states.audio_network_adaptor->GetEncoderRuntimeConfig(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 timestamp_check += 50; | 248 timestamp_check += 50; |
| 249 check.overhead_bytes_per_packet = rtc::Optional<size_t>(kOverhead); | 249 check.overhead_bytes_per_packet = rtc::Optional<size_t>(kOverhead); |
| 250 EXPECT_CALL(*states.mock_debug_dump_writer, | 250 EXPECT_CALL(*states.mock_debug_dump_writer, |
| 251 DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check)); | 251 DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check)); |
| 252 states.audio_network_adaptor->SetOverhead(kOverhead); | 252 states.audio_network_adaptor->SetOverhead(kOverhead); |
| 253 } | 253 } |
| 254 | 254 |
| 255 TEST(AudioNetworkAdaptorImplTest, LogRuntimeConfigOnGetEncoderRuntimeConfig) { | 255 TEST(AudioNetworkAdaptorImplTest, LogRuntimeConfigOnGetEncoderRuntimeConfig) { |
| 256 auto states = CreateAudioNetworkAdaptor(); | 256 auto states = CreateAudioNetworkAdaptor(); |
| 257 | 257 |
| 258 AudioNetworkAdaptor::EncoderRuntimeConfig config; | 258 AudioEncoderRuntimeConfig config; |
| 259 config.bitrate_bps = rtc::Optional<int>(32000); | 259 config.bitrate_bps = rtc::Optional<int>(32000); |
| 260 config.enable_fec = rtc::Optional<bool>(true); | 260 config.enable_fec = rtc::Optional<bool>(true); |
| 261 | 261 |
| 262 EXPECT_CALL(*states.mock_controllers[0], MakeDecision(_)) | 262 EXPECT_CALL(*states.mock_controllers[0], MakeDecision(_)) |
| 263 .WillOnce(SetArgPointee<0>(config)); | 263 .WillOnce(SetArgPointee<0>(config)); |
| 264 | 264 |
| 265 EXPECT_CALL(*states.event_log, | 265 EXPECT_CALL(*states.event_log, |
| 266 LogAudioNetworkAdaptation(EncoderRuntimeConfigIs(config))) | 266 LogAudioNetworkAdaptation(EncoderRuntimeConfigIs(config))) |
| 267 .Times(1); | 267 .Times(1); |
| 268 states.audio_network_adaptor->GetEncoderRuntimeConfig(); | 268 states.audio_network_adaptor->GetEncoderRuntimeConfig(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace webrtc | 271 } // namespace webrtc |
| OLD | NEW |