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

Side by Side Diff: webrtc/modules/audio_coding/audio_network_adaptor/event_log_writer_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 25 matching lines...) Expand all
36 arg.uplink_packet_loss_fraction == 36 arg.uplink_packet_loss_fraction ==
37 config.uplink_packet_loss_fraction && 37 config.uplink_packet_loss_fraction &&
38 arg.enable_fec == config.enable_fec && 38 arg.enable_fec == config.enable_fec &&
39 arg.enable_dtx == config.enable_dtx && 39 arg.enable_dtx == config.enable_dtx &&
40 arg.num_channels == config.num_channels; 40 arg.num_channels == config.num_channels;
41 } 41 }
42 42
43 struct EventLogWriterStates { 43 struct EventLogWriterStates {
44 std::unique_ptr<EventLogWriter> event_log_writer; 44 std::unique_ptr<EventLogWriter> event_log_writer;
45 std::unique_ptr<testing::StrictMock<MockRtcEventLog>> event_log; 45 std::unique_ptr<testing::StrictMock<MockRtcEventLog>> event_log;
46 AudioNetworkAdaptor::EncoderRuntimeConfig runtime_config; 46 AudioEncoderRuntimeConfig runtime_config;
47 }; 47 };
48 48
49 EventLogWriterStates CreateEventLogWriter() { 49 EventLogWriterStates CreateEventLogWriter() {
50 EventLogWriterStates state; 50 EventLogWriterStates state;
51 state.event_log.reset(new testing::StrictMock<MockRtcEventLog>()); 51 state.event_log.reset(new testing::StrictMock<MockRtcEventLog>());
52 state.event_log_writer.reset(new EventLogWriter( 52 state.event_log_writer.reset(new EventLogWriter(
53 state.event_log.get(), kMinBitrateChangeBps, kMinBitrateChangeFraction, 53 state.event_log.get(), kMinBitrateChangeBps, kMinBitrateChangeFraction,
54 kMinPacketLossChangeFraction)); 54 kMinPacketLossChangeFraction));
55 state.runtime_config.bitrate_bps = rtc::Optional<int>(kHighBitrateBps); 55 state.runtime_config.bitrate_bps = rtc::Optional<int>(kHighBitrateBps);
56 state.runtime_config.frame_length_ms = rtc::Optional<int>(kFrameLengthMs); 56 state.runtime_config.frame_length_ms = rtc::Optional<int>(kFrameLengthMs);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 *state.event_log, 256 *state.event_log,
257 LogAudioNetworkAdaptation(EncoderRuntimeConfigIs(state.runtime_config))) 257 LogAudioNetworkAdaptation(EncoderRuntimeConfigIs(state.runtime_config)))
258 .Times(1); 258 .Times(1);
259 for (int bitrate_bps = kHighBitrateBps; 259 for (int bitrate_bps = kHighBitrateBps;
260 bitrate_bps <= kHighBitrateBps + kMinBitrateChangeBps; bitrate_bps++) { 260 bitrate_bps <= kHighBitrateBps + kMinBitrateChangeBps; bitrate_bps++) {
261 state.runtime_config.bitrate_bps = rtc::Optional<int>(bitrate_bps); 261 state.runtime_config.bitrate_bps = rtc::Optional<int>(bitrate_bps);
262 state.event_log_writer->MaybeLogEncoderConfig(state.runtime_config); 262 state.event_log_writer->MaybeLogEncoderConfig(state.runtime_config);
263 } 263 }
264 } 264 }
265 } // namespace webrtc 265 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698