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 { |