From bc4cf89d917f4005f4008f48ea280ddfb6b0b706 Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Tue, 13 Nov 2018 13:20:51 +0100 Subject: [PATCH] Run some peer connection end-to-end tests with an empty audio encoder factory Specifically, the tests that only use data channels shouldn't need any audio codec support; by using an audio encoder factory that supports no codecs, we ensure that this is the case. (The tests were already using empty *de*coder factories; however, it was only recently that it became possible to use empty *en*coder factories as well.) Bug: webrtc:7529 Change-Id: Ied84283fe88073704a66bc82007b0dfcd7bf377f Reviewed-on: https://webrtc-review.googlesource.com/c/110726 Reviewed-by: Steve Anton Commit-Queue: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#25625} --- pc/peerconnectionendtoend_unittest.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pc/peerconnectionendtoend_unittest.cc b/pc/peerconnectionendtoend_unittest.cc index 52c6bf2a75..dee253b7c7 100644 --- a/pc/peerconnectionendtoend_unittest.cc +++ b/pc/peerconnectionendtoend_unittest.cc @@ -31,6 +31,7 @@ #include "pc/test/mockpeerconnectionobservers.h" #include "test/mock_audio_decoder.h" #include "test/mock_audio_decoder_factory.h" +#include "test/mock_audio_encoder_factory.h" using testing::AtLeast; using testing::Invoke; @@ -481,7 +482,7 @@ TEST_P(PeerConnectionEndToEndTest, CallWithCustomCodec) { // Verifies that a DataChannel created before the negotiation can transition to // "OPEN" and transfer data. TEST_P(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -506,7 +507,7 @@ TEST_P(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) { // Verifies that a DataChannel created after the negotiation can transition to // "OPEN" and transfer data. TEST_P(PeerConnectionEndToEndTest, CreateDataChannelAfterNegotiate) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -538,7 +539,7 @@ TEST_P(PeerConnectionEndToEndTest, CreateDataChannelAfterNegotiate) { // Verifies that a DataChannel created can transfer large messages. TEST_P(PeerConnectionEndToEndTest, CreateDataChannelLargeTransfer) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -572,7 +573,7 @@ TEST_P(PeerConnectionEndToEndTest, CreateDataChannelLargeTransfer) { // Verifies that DataChannel IDs are even/odd based on the DTLS roles. TEST_P(PeerConnectionEndToEndTest, DataChannelIdAssignment) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -600,7 +601,7 @@ TEST_P(PeerConnectionEndToEndTest, DataChannelIdAssignment) { // there are multiple DataChannels. TEST_P(PeerConnectionEndToEndTest, MessageTransferBetweenTwoPairsOfDataChannels) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -640,7 +641,7 @@ TEST_P(PeerConnectionEndToEndTest, // channel, and the closed channel was incorrectly still assigned to the ID. TEST_P(PeerConnectionEndToEndTest, DataChannelFromOpenWorksAfterPreviousChannelClosed) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -673,7 +674,7 @@ TEST_P(PeerConnectionEndToEndTest, // closing before creating the second one. TEST_P(PeerConnectionEndToEndTest, DataChannelFromOpenWorksWhilePreviousChannelClosing) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init; @@ -704,7 +705,7 @@ TEST_P(PeerConnectionEndToEndTest, // reference count), no memory access violation will occur. // See: https://code.google.com/p/chromium/issues/detail?id=565048 TEST_P(PeerConnectionEndToEndTest, CloseDataChannelRemotelyWhileNotReferenced) { - CreatePcs(webrtc::CreateBuiltinAudioEncoderFactory(), + CreatePcs(webrtc::MockAudioEncoderFactory::CreateEmptyFactory(), webrtc::MockAudioDecoderFactory::CreateEmptyFactory()); webrtc::DataChannelInit init;