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 |
11 #include "webrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.h" | 11 #include "webrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.h" |
12 | 12 |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 18 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" |
18 #include "webrtc/test/gtest.h" | 19 #include "webrtc/test/gtest.h" |
19 #include "webrtc/test/testsupport/fileutils.h" | 20 #include "webrtc/test/testsupport/fileutils.h" |
20 | 21 |
21 // Files generated at build-time by the protobuf compiler. | 22 // Files generated at build-time by the protobuf compiler. |
22 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 23 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
23 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 24 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
24 #else | 25 #else |
25 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 26 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
26 #endif | 27 #endif |
27 | 28 |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 BandwidthUsage parsed_detector_state; | 542 BandwidthUsage parsed_detector_state; |
542 parsed_log.GetDelayBasedBweUpdate(index, &parsed_bitrate, | 543 parsed_log.GetDelayBasedBweUpdate(index, &parsed_bitrate, |
543 &parsed_detector_state); | 544 &parsed_detector_state); |
544 EXPECT_EQ(bitrate, parsed_bitrate); | 545 EXPECT_EQ(bitrate, parsed_bitrate); |
545 EXPECT_EQ(detector_state, parsed_detector_state); | 546 EXPECT_EQ(detector_state, parsed_detector_state); |
546 } | 547 } |
547 | 548 |
548 void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation( | 549 void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation( |
549 const ParsedRtcEventLog& parsed_log, | 550 const ParsedRtcEventLog& parsed_log, |
550 size_t index, | 551 size_t index, |
551 const AudioNetworkAdaptor::EncoderRuntimeConfig& config) { | 552 const AudioEncoderRuntimeConfig& config) { |
552 AudioNetworkAdaptor::EncoderRuntimeConfig parsed_config; | 553 AudioEncoderRuntimeConfig parsed_config; |
553 parsed_log.GetAudioNetworkAdaptation(index, &parsed_config); | 554 parsed_log.GetAudioNetworkAdaptation(index, &parsed_config); |
554 EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps); | 555 EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps); |
555 EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx); | 556 EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx); |
556 EXPECT_EQ(config.enable_fec, parsed_config.enable_fec); | 557 EXPECT_EQ(config.enable_fec, parsed_config.enable_fec); |
557 EXPECT_EQ(config.frame_length_ms, parsed_config.frame_length_ms); | 558 EXPECT_EQ(config.frame_length_ms, parsed_config.frame_length_ms); |
558 EXPECT_EQ(config.num_channels, parsed_config.num_channels); | 559 EXPECT_EQ(config.num_channels, parsed_config.num_channels); |
559 EXPECT_EQ(config.uplink_packet_loss_fraction, | 560 EXPECT_EQ(config.uplink_packet_loss_fraction, |
560 parsed_config.uplink_packet_loss_fraction); | 561 parsed_config.uplink_packet_loss_fraction); |
561 } | 562 } |
562 | 563 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 ASSERT_TRUE(bwe_event.has_id()); | 634 ASSERT_TRUE(bwe_event.has_id()); |
634 EXPECT_EQ(id, bwe_event.id()); | 635 EXPECT_EQ(id, bwe_event.id()); |
635 ASSERT_TRUE(bwe_event.has_result()); | 636 ASSERT_TRUE(bwe_event.has_result()); |
636 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result()); | 637 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result()); |
637 ASSERT_FALSE(bwe_event.has_bitrate_bps()); | 638 ASSERT_FALSE(bwe_event.has_bitrate_bps()); |
638 | 639 |
639 // TODO(philipel): Verify the parser when parsing has been implemented. | 640 // TODO(philipel): Verify the parser when parsing has been implemented. |
640 } | 641 } |
641 | 642 |
642 } // namespace webrtc | 643 } // namespace webrtc |
OLD | NEW |