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

Unified Diff: webrtc/pc/peerconnectioninterface_unittest.cc

Issue 2793913008: Add PeerConnectionInterface::UpdateCallBitrate. (Closed)
Patch Set: Force update if current bitrate is set. Remove big lambda. Improve parameter validation. Created 3 years, 8 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
« webrtc/call/call.cc ('K') | « webrtc/pc/peerconnection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnectioninterface_unittest.cc
diff --git a/webrtc/pc/peerconnectioninterface_unittest.cc b/webrtc/pc/peerconnectioninterface_unittest.cc
index 05d53ad1a153fdcacc66f240d706c88f69d51f64..4b8232ffeb3d4b611adda21e8a3f8401b20a7dbe 100644
--- a/webrtc/pc/peerconnectioninterface_unittest.cc
+++ b/webrtc/pc/peerconnectioninterface_unittest.cc
@@ -3286,6 +3286,61 @@ TEST_F(PeerConnectionInterfaceTest,
EXPECT_TRUE(DoSetLocalDescription(answer.release()));
}
+TEST_F(PeerConnectionInterfaceTest, SetBitrateWithoutMinSucceeds) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.current_bitrate_bps = rtc::Optional<int>(100000);
+ EXPECT_TRUE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateNegativeMinFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.min_bitrate_bps = rtc::Optional<int>(-1);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateCurrentLtMinFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.min_bitrate_bps = rtc::Optional<int>(5);
+ bitrate.current_bitrate_bps = rtc::Optional<int>(3);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateCurrentNegativeFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.current_bitrate_bps = rtc::Optional<int>(-1);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateMaxLtCurrentFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.current_bitrate_bps = rtc::Optional<int>(10);
+ bitrate.max_bitrate_bps = rtc::Optional<int>(8);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateMaxLtMinFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.min_bitrate_bps = rtc::Optional<int>(10);
+ bitrate.max_bitrate_bps = rtc::Optional<int>(8);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+TEST_F(PeerConnectionInterfaceTest, SetBitrateMaxNegativeFails) {
+ CreatePeerConnection();
+ PeerConnectionInterface::BitrateParameters bitrate;
+ bitrate.max_bitrate_bps = rtc::Optional<int>(-1);
+ EXPECT_FALSE(pc_->SetBitrate(bitrate).ok());
+}
+
+// TODO(zstein): Test PeerConnectionInterface::SetBitrate's interaction with
+// Call::SetBitrateConfig
+
class PeerConnectionMediaConfigTest : public testing::Test {
protected:
void SetUp() override {
« webrtc/call/call.cc ('K') | « webrtc/pc/peerconnection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698