message: peerconnection: add test for createOffer({voiceActivityDetection: true})
  and fix other tests to actually include CN in supported codecs.
  Cr-Commit-Position: refs/heads/master@{#34033}
diff: @@ -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()));
  