OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 // TODO(nisse): Old include file kept temporarily, to not break |
| 12 // downstream applications. Delete as soon as downstrem is updated. |
| 13 |
11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO
LLER_H_ | 14 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO
LLER_H_ |
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO
LLER_H_ | 15 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO
LLER_H_ |
13 | 16 |
14 #include "webrtc/base/constructormagic.h" | 17 #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_obse
rver.h" |
15 #include "webrtc/base/socket.h" | |
16 #include "webrtc/common_types.h" | |
17 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | |
18 #include "webrtc/test/gmock.h" | |
19 | 18 |
20 namespace webrtc { | |
21 namespace test { | |
22 | |
23 class MockCongestionObserver : public CongestionController::Observer { | |
24 public: | |
25 // TODO(minyue): remove this when old OnNetworkChanged is deprecated. See | |
26 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6796 | |
27 using CongestionController::Observer::OnNetworkChanged; | |
28 | |
29 MOCK_METHOD4(OnNetworkChanged, | |
30 void(uint32_t bitrate_bps, | |
31 uint8_t fraction_loss, | |
32 int64_t rtt_ms, | |
33 int64_t probing_interval_ms)); | |
34 }; | |
35 | |
36 class MockCongestionController : public CongestionController { | |
37 public: | |
38 MockCongestionController(Clock* clock, | |
39 Observer* observer, | |
40 RemoteBitrateObserver* remote_bitrate_observer, | |
41 RtcEventLog* event_log, | |
42 PacketRouter* packet_router) | |
43 : CongestionController(clock, | |
44 observer, | |
45 remote_bitrate_observer, | |
46 event_log, | |
47 packet_router) {} | |
48 MOCK_METHOD3(OnReceivedPacket, | |
49 void(int64_t arrival_time_ms, | |
50 size_t payload_size, | |
51 const RTPHeader& header)); | |
52 MOCK_METHOD3(SetBweBitrates, | |
53 void(int min_bitrate_bps, | |
54 int start_bitrate_bps, | |
55 int max_bitrate_bps)); | |
56 MOCK_METHOD1(SignalNetworkState, void(NetworkState state)); | |
57 MOCK_CONST_METHOD0(GetBitrateController, BitrateController*()); | |
58 MOCK_METHOD1(GetRemoteBitrateEstimator, | |
59 RemoteBitrateEstimator*(bool send_side_bwe)); | |
60 MOCK_CONST_METHOD0(GetPacerQueuingDelayMs, int64_t()); | |
61 MOCK_METHOD0(pacer, PacedSender*()); | |
62 MOCK_METHOD0(GetTransportFeedbackObserver, TransportFeedbackObserver*()); | |
63 MOCK_METHOD3(UpdatePacerBitrate, | |
64 void(int bitrate_kbps, | |
65 int max_bitrate_kbps, | |
66 int min_bitrate_kbps)); | |
67 MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket& sent_packet)); | |
68 | |
69 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MockCongestionController); | |
70 }; | |
71 } // namespace test | |
72 } // namespace webrtc | |
73 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CON
TROLLER_H_ | 19 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CON
TROLLER_H_ |
OLD | NEW |