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 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ | 11 #ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ |
12 #define WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ | 12 #define WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 16 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
17 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" | 17 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor.h" |
| 18 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 19 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" |
18 #include "webrtc/test/gmock.h" | 20 #include "webrtc/test/gmock.h" |
19 | 21 |
20 namespace webrtc { | 22 namespace webrtc { |
21 | 23 |
22 class MockRtcEventLog : public RtcEventLog { | 24 class MockRtcEventLog : public RtcEventLog { |
23 public: | 25 public: |
24 MOCK_METHOD2(StartLogging, | 26 MOCK_METHOD2(StartLogging, |
25 bool(const std::string& file_name, int64_t max_size_bytes)); | 27 bool(const std::string& file_name, int64_t max_size_bytes)); |
26 | 28 |
27 MOCK_METHOD2(StartLogging, | 29 MOCK_METHOD2(StartLogging, |
28 bool(rtc::PlatformFile log_file, int64_t max_size_bytes)); | 30 bool(rtc::PlatformFile log_file, int64_t max_size_bytes)); |
29 | 31 |
30 MOCK_METHOD0(StopLogging, void()); | 32 MOCK_METHOD0(StopLogging, void()); |
31 | 33 |
32 MOCK_METHOD1(LogVideoReceiveStreamConfig, | 34 MOCK_METHOD1(LogVideoReceiveStreamConfig, |
33 void(const rtclog::StreamConfig& config)); | 35 void(const rtclog::StreamConfig& config)); |
34 | 36 |
35 MOCK_METHOD1(LogVideoSendStreamConfig, | 37 MOCK_METHOD1(LogVideoSendStreamConfig, |
36 void(const rtclog::StreamConfig& config)); | 38 void(const rtclog::StreamConfig& config)); |
37 | 39 |
38 MOCK_METHOD1(LogAudioReceiveStreamConfig, | 40 MOCK_METHOD1(LogAudioReceiveStreamConfig, |
39 void(const rtclog::StreamConfig& config)); | 41 void(const rtclog::StreamConfig& config)); |
40 | 42 |
41 MOCK_METHOD1(LogAudioSendStreamConfig, | 43 MOCK_METHOD1(LogAudioSendStreamConfig, |
42 void(const rtclog::StreamConfig& config)); | 44 void(const rtclog::StreamConfig& config)); |
43 | 45 |
44 MOCK_METHOD3(LogRtpHeader, | 46 MOCK_METHOD1(LogIncomingRtpHeader, void(const RtpPacketReceived& packet)); |
45 void(PacketDirection direction, | |
46 const uint8_t* header, | |
47 size_t packet_length)); | |
48 | 47 |
49 MOCK_METHOD4(LogRtpHeader, | 48 MOCK_METHOD2(LogOutgoingRtpHeader, |
50 void(PacketDirection direction, | 49 void(const RtpPacketToSend& packet, int probe_cluster_id)); |
51 const uint8_t* header, | |
52 size_t packet_length, | |
53 int probe_cluster_id)); | |
54 | 50 |
55 MOCK_METHOD3(LogRtcpPacket, | 51 MOCK_METHOD1(LogIncomingRtcpPacket, |
56 void(PacketDirection direction, | 52 void(rtc::ArrayView<const uint8_t> packet)); |
57 const uint8_t* packet, | 53 |
58 size_t length)); | 54 MOCK_METHOD1(LogOutgoingRtcpPacket, |
| 55 void(rtc::ArrayView<const uint8_t> packet)); |
59 | 56 |
60 MOCK_METHOD1(LogAudioPlayout, void(uint32_t ssrc)); | 57 MOCK_METHOD1(LogAudioPlayout, void(uint32_t ssrc)); |
61 | 58 |
62 MOCK_METHOD3(LogLossBasedBweUpdate, | 59 MOCK_METHOD3(LogLossBasedBweUpdate, |
63 void(int32_t bitrate_bps, | 60 void(int32_t bitrate_bps, |
64 uint8_t fraction_loss, | 61 uint8_t fraction_loss, |
65 int32_t total_packets)); | 62 int32_t total_packets)); |
66 | 63 |
67 MOCK_METHOD2(LogDelayBasedBweUpdate, | 64 MOCK_METHOD2(LogDelayBasedBweUpdate, |
68 void(int32_t bitrate_bps, BandwidthUsage detector_state)); | 65 void(int32_t bitrate_bps, BandwidthUsage detector_state)); |
69 | 66 |
70 MOCK_METHOD1(LogAudioNetworkAdaptation, | 67 MOCK_METHOD1(LogAudioNetworkAdaptation, |
71 void(const AudioEncoderRuntimeConfig& config)); | 68 void(const AudioEncoderRuntimeConfig& config)); |
72 | 69 |
73 MOCK_METHOD4(LogProbeClusterCreated, | 70 MOCK_METHOD4(LogProbeClusterCreated, |
74 void(int id, int bitrate_bps, int min_probes, int min_bytes)); | 71 void(int id, int bitrate_bps, int min_probes, int min_bytes)); |
75 | 72 |
76 MOCK_METHOD2(LogProbeResultSuccess, void(int id, int bitrate_bps)); | 73 MOCK_METHOD2(LogProbeResultSuccess, void(int id, int bitrate_bps)); |
77 MOCK_METHOD2(LogProbeResultFailure, | 74 MOCK_METHOD2(LogProbeResultFailure, |
78 void(int id, ProbeFailureReason failure_reason)); | 75 void(int id, ProbeFailureReason failure_reason)); |
79 }; | 76 }; |
80 | 77 |
81 } // namespace webrtc | 78 } // namespace webrtc |
82 | 79 |
83 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ | 80 #endif // WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ |
OLD | NEW |