peerconnection: add test for createOffer({voiceActivityDetection: true})
and fix other tests to actually include CN in supported codecs. BUG=webrtc:12365 Change-Id: I7154dd0046497604a6fc825ce81e85c1b9cadcef Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218601 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <phancke@nvidia.com> Cr-Commit-Position: refs/heads/master@{#34033}
This commit is contained in:
parent
4e9442dfe0
commit
718acf6c1d
@ -848,8 +848,9 @@ bool HasAnyComfortNoiseCodecs(const cricket::SessionDescription* desc) {
|
||||
|
||||
TEST_P(PeerConnectionMediaTest,
|
||||
CreateOfferWithNoVoiceActivityDetectionIncludesNoComfortNoiseCodecs) {
|
||||
auto caller = CreatePeerConnectionWithAudioVideo();
|
||||
AddComfortNoiseCodecsToSend(caller->media_engine());
|
||||
auto fake_engine = std::make_unique<FakeMediaEngine>();
|
||||
AddComfortNoiseCodecsToSend(fake_engine.get());
|
||||
auto caller = CreatePeerConnectionWithAudioVideo(std::move(fake_engine));
|
||||
|
||||
RTCOfferAnswerOptions options;
|
||||
options.voice_activity_detection = false;
|
||||
@ -859,11 +860,47 @@ TEST_P(PeerConnectionMediaTest,
|
||||
}
|
||||
|
||||
TEST_P(PeerConnectionMediaTest,
|
||||
CreateAnswerWithNoVoiceActivityDetectionIncludesNoComfortNoiseCodecs) {
|
||||
CreateOfferWithVoiceActivityDetectionIncludesComfortNoiseCodecs) {
|
||||
auto fake_engine = std::make_unique<FakeMediaEngine>();
|
||||
AddComfortNoiseCodecsToSend(fake_engine.get());
|
||||
auto caller = CreatePeerConnectionWithAudioVideo(std::move(fake_engine));
|
||||
|
||||
RTCOfferAnswerOptions options;
|
||||
options.voice_activity_detection = true;
|
||||
auto offer = caller->CreateOffer(options);
|
||||
|
||||
EXPECT_TRUE(HasAnyComfortNoiseCodecs(offer->description()));
|
||||
}
|
||||
|
||||
TEST_P(PeerConnectionMediaTest,
|
||||
CreateAnswerWithVoiceActivityDetectionIncludesNoComfortNoiseCodecs) {
|
||||
auto caller = CreatePeerConnectionWithAudioVideo();
|
||||
AddComfortNoiseCodecsToSend(caller->media_engine());
|
||||
auto callee = CreatePeerConnectionWithAudioVideo();
|
||||
AddComfortNoiseCodecsToSend(callee->media_engine());
|
||||
|
||||
auto callee_fake_engine = std::make_unique<FakeMediaEngine>();
|
||||
AddComfortNoiseCodecsToSend(callee_fake_engine.get());
|
||||
auto callee =
|
||||
CreatePeerConnectionWithAudioVideo(std::move(callee_fake_engine));
|
||||
|
||||
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
|
||||
|
||||
RTCOfferAnswerOptions options;
|
||||
options.voice_activity_detection = true;
|
||||
auto answer = callee->CreateAnswer(options);
|
||||
|
||||
EXPECT_FALSE(HasAnyComfortNoiseCodecs(answer->description()));
|
||||
}
|
||||
|
||||
TEST_P(PeerConnectionMediaTest,
|
||||
CreateAnswerWithNoVoiceActivityDetectionIncludesNoComfortNoiseCodecs) {
|
||||
auto caller_fake_engine = std::make_unique<FakeMediaEngine>();
|
||||
AddComfortNoiseCodecsToSend(caller_fake_engine.get());
|
||||
auto caller =
|
||||
CreatePeerConnectionWithAudioVideo(std::move(caller_fake_engine));
|
||||
|
||||
auto callee_fake_engine = std::make_unique<FakeMediaEngine>();
|
||||
AddComfortNoiseCodecsToSend(callee_fake_engine.get());
|
||||
auto callee =
|
||||
CreatePeerConnectionWithAudioVideo(std::move(callee_fake_engine));
|
||||
|
||||
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user