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

Side by Side Diff: webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h

Issue 2553863003: Parse FlexFEC RTP headers in Call and add integration with BWE. (Closed)
Patch Set: Add basic CongestionController unit test, based on nisse's suggestion. Created 4 years 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) 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 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO LLER_H_ 11 #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_ 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CONTRO LLER_H_
13 13
14 #include "webrtc/base/constructormagic.h" 14 #include "webrtc/base/constructormagic.h"
15 #include "webrtc/base/socket.h" 15 #include "webrtc/base/socket.h"
16 #include "webrtc/common_types.h"
16 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" 17 #include "webrtc/modules/congestion_controller/include/congestion_controller.h"
17 #include "webrtc/test/gmock.h" 18 #include "webrtc/test/gmock.h"
18 19
19 namespace webrtc { 20 namespace webrtc {
20 namespace test { 21 namespace test {
21 22
22 class MockCongestionObserver : public CongestionController::Observer { 23 class MockCongestionObserver : public CongestionController::Observer {
23 public: 24 public:
24 // TODO(minyue): remove this when old OnNetworkChanged is deprecated. See 25 // TODO(minyue): remove this when old OnNetworkChanged is deprecated. See
25 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6796 26 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6796
(...skipping 11 matching lines...) Expand all
37 MockCongestionController(Clock* clock, 38 MockCongestionController(Clock* clock,
38 Observer* observer, 39 Observer* observer,
39 RemoteBitrateObserver* remote_bitrate_observer, 40 RemoteBitrateObserver* remote_bitrate_observer,
40 RtcEventLog* event_log, 41 RtcEventLog* event_log,
41 PacketRouter* packet_router) 42 PacketRouter* packet_router)
42 : CongestionController(clock, 43 : CongestionController(clock,
43 observer, 44 observer,
44 remote_bitrate_observer, 45 remote_bitrate_observer,
45 event_log, 46 event_log,
46 packet_router) {} 47 packet_router) {}
48 MOCK_METHOD3(OnReceivedPacket,
49 void(int64_t arrival_time_ms,
50 size_t payload_size,
51 const RTPHeader& header));
47 MOCK_METHOD3(SetBweBitrates, 52 MOCK_METHOD3(SetBweBitrates,
48 void(int min_bitrate_bps, 53 void(int min_bitrate_bps,
49 int start_bitrate_bps, 54 int start_bitrate_bps,
50 int max_bitrate_bps)); 55 int max_bitrate_bps));
51 MOCK_METHOD1(SignalNetworkState, void(NetworkState state)); 56 MOCK_METHOD1(SignalNetworkState, void(NetworkState state));
52 MOCK_CONST_METHOD0(GetBitrateController, BitrateController*()); 57 MOCK_CONST_METHOD0(GetBitrateController, BitrateController*());
53 MOCK_METHOD1(GetRemoteBitrateEstimator, 58 MOCK_METHOD1(GetRemoteBitrateEstimator,
54 RemoteBitrateEstimator*(bool send_side_bwe)); 59 RemoteBitrateEstimator*(bool send_side_bwe));
55 MOCK_CONST_METHOD0(GetPacerQueuingDelayMs, int64_t()); 60 MOCK_CONST_METHOD0(GetPacerQueuingDelayMs, int64_t());
56 MOCK_METHOD0(pacer, PacedSender*()); 61 MOCK_METHOD0(pacer, PacedSender*());
57 MOCK_METHOD0(GetTransportFeedbackObserver, TransportFeedbackObserver*()); 62 MOCK_METHOD0(GetTransportFeedbackObserver, TransportFeedbackObserver*());
58 MOCK_METHOD3(UpdatePacerBitrate, 63 MOCK_METHOD3(UpdatePacerBitrate,
59 void(int bitrate_kbps, 64 void(int bitrate_kbps,
60 int max_bitrate_kbps, 65 int max_bitrate_kbps,
61 int min_bitrate_kbps)); 66 int min_bitrate_kbps));
62 MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket& sent_packet)); 67 MOCK_METHOD1(OnSentPacket, void(const rtc::SentPacket& sent_packet));
63 68
64 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MockCongestionController); 69 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MockCongestionController);
65 }; 70 };
66 } // namespace test 71 } // namespace test
67 } // namespace webrtc 72 } // namespace webrtc
68 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CON TROLLER_H_ 73 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_CON TROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698