diff options
Diffstat (limited to 'audio/voip/test/voip_core_unittest.cc')
-rw-r--r-- | audio/voip/test/voip_core_unittest.cc | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/audio/voip/test/voip_core_unittest.cc b/audio/voip/test/voip_core_unittest.cc index 0d407601a3..896d0d98bb 100644 --- a/audio/voip/test/voip_core_unittest.cc +++ b/audio/voip/test/voip_core_unittest.cc @@ -14,7 +14,6 @@ #include "api/task_queue/default_task_queue_factory.h" #include "modules/audio_device/include/mock_audio_device.h" #include "modules/audio_processing/include/mock_audio_processing.h" -#include "modules/utility/include/mock/mock_process_thread.h" #include "test/gtest.h" #include "test/mock_transport.h" @@ -41,20 +40,15 @@ class VoipCoreTest : public ::testing::Test { rtc::scoped_refptr<AudioProcessing> audio_processing = rtc::make_ref_counted<NiceMock<test::MockAudioProcessing>>(); - auto process_thread = std::make_unique<NiceMock<MockProcessThread>>(); - // Hold the pointer to use for testing. - process_thread_ = process_thread.get(); - voip_core_ = std::make_unique<VoipCore>( std::move(encoder_factory), std::move(decoder_factory), CreateDefaultTaskQueueFactory(), audio_device_, - std::move(audio_processing), std::move(process_thread)); + std::move(audio_processing)); } std::unique_ptr<VoipCore> voip_core_; NiceMock<MockTransport> transport_; rtc::scoped_refptr<test::MockAudioDeviceModule> audio_device_; - NiceMock<MockProcessThread>* process_thread_; }; // Validate expected API calls that involves with VoipCore. Some verification is @@ -192,31 +186,5 @@ TEST_F(VoipCoreTest, StopSendAndPlayoutWithoutStarting) { EXPECT_EQ(voip_core_->ReleaseChannel(channel), VoipResult::kOk); } -// This tests correctness on ProcessThread usage where we expect the first/last -// channel creation/release triggers its Start/Stop method once only. -TEST_F(VoipCoreTest, TestProcessThreadOperation) { - EXPECT_CALL(*process_thread_, Start); - EXPECT_CALL(*process_thread_, RegisterModule).Times(2); - - auto channel_one = voip_core_->CreateChannel(&transport_, 0xdeadc0de); - auto channel_two = voip_core_->CreateChannel(&transport_, 0xdeadbeef); - - EXPECT_CALL(*process_thread_, Stop); - EXPECT_CALL(*process_thread_, DeRegisterModule).Times(2); - - EXPECT_EQ(voip_core_->ReleaseChannel(channel_one), VoipResult::kOk); - EXPECT_EQ(voip_core_->ReleaseChannel(channel_two), VoipResult::kOk); - - EXPECT_CALL(*process_thread_, Start); - EXPECT_CALL(*process_thread_, RegisterModule); - - auto channel_three = voip_core_->CreateChannel(&transport_, absl::nullopt); - - EXPECT_CALL(*process_thread_, Stop); - EXPECT_CALL(*process_thread_, DeRegisterModule); - - EXPECT_EQ(voip_core_->ReleaseChannel(channel_three), VoipResult::kOk); -} - } // namespace } // namespace webrtc |