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/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" |
| 19 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
19 #include "webrtc/test/gtest.h" | 20 #include "webrtc/test/gtest.h" |
20 #include "webrtc/test/testsupport/fileutils.h" | 21 #include "webrtc/test/testsupport/fileutils.h" |
21 | 22 |
22 // Files generated at build-time by the protobuf compiler. | 23 // Files generated at build-time by the protobuf compiler. |
23 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 24 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
24 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 25 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
25 #else | 26 #else |
26 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 27 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
27 #endif | 28 #endif |
28 | 29 |
(...skipping 12 matching lines...) Expand all Loading... |
41 return MediaType::DATA; | 42 return MediaType::DATA; |
42 } | 43 } |
43 RTC_NOTREACHED(); | 44 RTC_NOTREACHED(); |
44 return MediaType::ANY; | 45 return MediaType::ANY; |
45 } | 46 } |
46 | 47 |
47 BandwidthUsage GetRuntimeDetectorState( | 48 BandwidthUsage GetRuntimeDetectorState( |
48 rtclog::DelayBasedBweUpdate::DetectorState detector_state) { | 49 rtclog::DelayBasedBweUpdate::DetectorState detector_state) { |
49 switch (detector_state) { | 50 switch (detector_state) { |
50 case rtclog::DelayBasedBweUpdate::BWE_NORMAL: | 51 case rtclog::DelayBasedBweUpdate::BWE_NORMAL: |
51 return kBwNormal; | 52 return BandwidthUsage::kBwNormal; |
52 case rtclog::DelayBasedBweUpdate::BWE_UNDERUSING: | 53 case rtclog::DelayBasedBweUpdate::BWE_UNDERUSING: |
53 return kBwUnderusing; | 54 return BandwidthUsage::kBwUnderusing; |
54 case rtclog::DelayBasedBweUpdate::BWE_OVERUSING: | 55 case rtclog::DelayBasedBweUpdate::BWE_OVERUSING: |
55 return kBwOverusing; | 56 return BandwidthUsage::kBwOverusing; |
56 } | 57 } |
57 RTC_NOTREACHED(); | 58 RTC_NOTREACHED(); |
58 return kBwNormal; | 59 return BandwidthUsage::kBwNormal; |
59 } | 60 } |
60 | 61 |
61 rtclog::BweProbeResult::ResultType GetProbeResultType( | 62 rtclog::BweProbeResult::ResultType GetProbeResultType( |
62 ProbeFailureReason failure_reason) { | 63 ProbeFailureReason failure_reason) { |
63 switch (failure_reason) { | 64 switch (failure_reason) { |
64 case kInvalidSendReceiveInterval: | 65 case kInvalidSendReceiveInterval: |
65 return rtclog::BweProbeResult::INVALID_SEND_RECEIVE_INTERVAL; | 66 return rtclog::BweProbeResult::INVALID_SEND_RECEIVE_INTERVAL; |
66 case kInvalidSendReceiveRatio: | 67 case kInvalidSendReceiveRatio: |
67 return rtclog::BweProbeResult::INVALID_SEND_RECEIVE_RATIO; | 68 return rtclog::BweProbeResult::INVALID_SEND_RECEIVE_RATIO; |
68 case kTimeout: | 69 case kTimeout: |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 ASSERT_TRUE(bwe_event.has_id()); | 635 ASSERT_TRUE(bwe_event.has_id()); |
635 EXPECT_EQ(id, bwe_event.id()); | 636 EXPECT_EQ(id, bwe_event.id()); |
636 ASSERT_TRUE(bwe_event.has_result()); | 637 ASSERT_TRUE(bwe_event.has_result()); |
637 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result()); | 638 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result()); |
638 ASSERT_FALSE(bwe_event.has_bitrate_bps()); | 639 ASSERT_FALSE(bwe_event.has_bitrate_bps()); |
639 | 640 |
640 // TODO(philipel): Verify the parser when parsing has been implemented. | 641 // TODO(philipel): Verify the parser when parsing has been implemented. |
641 } | 642 } |
642 | 643 |
643 } // namespace webrtc | 644 } // namespace webrtc |
OLD | NEW |