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

Side by Side Diff: webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc

Issue 2745473003: Resolve cyclic dependency between audio network adaptor and event log api (Closed)
Patch Set: Revert "Activated checks for rtc_event_log_api" Created 3 years, 8 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) 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 21 matching lines...) Expand all
32 if (overhead_bytes_per_packet) { 32 if (overhead_bytes_per_packet) {
33 Controller::NetworkMetrics network_metrics; 33 Controller::NetworkMetrics network_metrics;
34 network_metrics.overhead_bytes_per_packet = overhead_bytes_per_packet; 34 network_metrics.overhead_bytes_per_packet = overhead_bytes_per_packet;
35 controller->UpdateNetworkMetrics(network_metrics); 35 controller->UpdateNetworkMetrics(network_metrics);
36 } 36 }
37 } 37 }
38 38
39 void CheckDecision(BitrateController* controller, 39 void CheckDecision(BitrateController* controller,
40 const rtc::Optional<int>& frame_length_ms, 40 const rtc::Optional<int>& frame_length_ms,
41 int expected_bitrate_bps) { 41 int expected_bitrate_bps) {
42 AudioNetworkAdaptor::EncoderRuntimeConfig config; 42 AudioEncoderRuntimeConfig config;
43 config.frame_length_ms = frame_length_ms; 43 config.frame_length_ms = frame_length_ms;
44 controller->MakeDecision(&config); 44 controller->MakeDecision(&config);
45 EXPECT_EQ(rtc::Optional<int>(expected_bitrate_bps), config.bitrate_bps); 45 EXPECT_EQ(rtc::Optional<int>(expected_bitrate_bps), config.bitrate_bps);
46 } 46 }
47 47
48 } // namespace 48 } // namespace
49 49
50 // These tests are named AnaBitrateControllerTest to distinguish from 50 // These tests are named AnaBitrateControllerTest to distinguish from
51 // BitrateControllerTest in 51 // BitrateControllerTest in
52 // modules/bitrate_controller/bitrate_controller_unittest.cc. 52 // modules/bitrate_controller/bitrate_controller_unittest.cc.
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 overhead_bytes_per_packet * 8 * 1000 / 60; 263 overhead_bytes_per_packet * 8 * 1000 / 60;
264 264
265 UpdateNetworkMetrics(&controller, rtc::Optional<int>(overall_bitrate), 265 UpdateNetworkMetrics(&controller, rtc::Optional<int>(overall_bitrate),
266 rtc::Optional<size_t>(overhead_bytes_per_packet)); 266 rtc::Optional<size_t>(overhead_bytes_per_packet));
267 CheckDecision(&controller, rtc::Optional<int>(frame_length_ms), 267 CheckDecision(&controller, rtc::Optional<int>(frame_length_ms),
268 current_bitrate); 268 current_bitrate);
269 } 269 }
270 270
271 } // namespace audio_network_adaptor 271 } // namespace audio_network_adaptor
272 } // namespace webrtc 272 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698