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

Unified Diff: webrtc/call/call_unittest.cc

Issue 2834663003: Allow mocking SendSideCongestionController for Call tests. (Closed)
Patch Set: rebase Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/call/fake_rtp_transport_controller_send.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call_unittest.cc
diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc
index 27d23298112f13b4f4fec673a6a5d54550366040..564f6bd0323e014771266f9ec432b099758ef18b 100644
--- a/webrtc/call/call_unittest.cc
+++ b/webrtc/call/call_unittest.cc
@@ -11,11 +11,15 @@
#include <list>
#include <map>
#include <memory>
+#include <utility>
+#include "webrtc/base/ptr_util.h"
#include "webrtc/call/audio_state.h"
#include "webrtc/call/call.h"
+#include "webrtc/call/fake_rtp_transport_controller_send.h"
#include "webrtc/logging/rtc_event_log/rtc_event_log.h"
#include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
+#include "webrtc/modules/congestion_controller/include/mock/mock_send_side_congestion_controller.h"
#include "webrtc/test/gtest.h"
#include "webrtc/test/mock_audio_decoder_factory.h"
#include "webrtc/test/mock_transport.h"
@@ -305,4 +309,28 @@ TEST(CallTest, MultipleFlexfecReceiveStreamsProtectingSingleVideoStream) {
}
}
+// TODO(zstein): This is just a motivating example for
+// MockSendSideCongestionController. It should be deleted once we have more
+// meaningful tests.
+TEST(CallTest, MockSendSideCongestionControllerExample) {
+ RtcEventLogNullImpl event_log;
+ Call::Config config(&event_log);
+
+ SimulatedClock clock(123456);
+ PacketRouter packet_router;
+ testing::NiceMock<test::MockSendSideCongestionController> mock_cc(
+ &clock, &event_log, &packet_router);
+ auto transport_send =
+ rtc::MakeUnique<FakeRtpTransportControllerSend>(&mock_cc);
+ std::unique_ptr<Call> call(Call::Create(config, std::move(transport_send)));
+
+ Call::Config::BitrateConfig bitrate_config;
+ bitrate_config.min_bitrate_bps = 1;
+ bitrate_config.start_bitrate_bps = 2;
+ bitrate_config.max_bitrate_bps = 3;
+
+ EXPECT_CALL(mock_cc, SetBweBitrates(1, 2, 3));
+ call->SetBitrateConfig(bitrate_config);
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/call/call.cc ('k') | webrtc/call/fake_rtp_transport_controller_send.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698