diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index b5e1b225de..20c6c1be50 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -850,7 +850,6 @@ if (rtc_include_tests) { "session_info_unittest.cc", "test/stream_generator.cc", "test/stream_generator.h", - "test/test_util.h", "timing_unittest.cc", "utility/default_video_bitrate_allocator_unittest.cc", "utility/frame_dropper_unittest.cc", diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc index 6ae65d62e9..3ed18a9386 100644 --- a/modules/video_coding/jitter_buffer_unittest.cc +++ b/modules/video_coding/jitter_buffer_unittest.cc @@ -20,7 +20,6 @@ #include "modules/video_coding/media_opt_util.h" #include "modules/video_coding/packet.h" #include "modules/video_coding/test/stream_generator.h" -#include "modules/video_coding/test/test_util.h" #include "rtc_base/location.h" #include "system_wrappers/include/clock.h" #include "system_wrappers/include/field_trial.h" @@ -220,9 +219,7 @@ class TestBasicJitterBuffer : public ::testing::TestWithParam, void SetUp() override { clock_.reset(new SimulatedClock(0)); jitter_buffer_.reset(new VCMJitterBuffer( - clock_.get(), - std::unique_ptr(event_factory_.CreateEvent()), this, - this)); + clock_.get(), absl::WrapUnique(EventWrapper::Create()), this, this)); jitter_buffer_->Start(); seq_num_ = 1234; timestamp_ = 0; @@ -313,7 +310,6 @@ class TestBasicJitterBuffer : public ::testing::TestWithParam, uint8_t data_[1500]; std::unique_ptr packet_; std::unique_ptr clock_; - NullEventFactory event_factory_; std::unique_ptr jitter_buffer_; }; @@ -339,9 +335,7 @@ class TestRunningJitterBuffer : public ::testing::TestWithParam, max_nack_list_size_ = 150; oldest_packet_to_nack_ = 250; jitter_buffer_ = new VCMJitterBuffer( - clock_.get(), - std::unique_ptr(event_factory_.CreateEvent()), this, - this); + clock_.get(), absl::WrapUnique(EventWrapper::Create()), this, this); stream_generator_ = new StreamGenerator(0, clock_->TimeInMilliseconds()); jitter_buffer_->Start(); jitter_buffer_->SetNackSettings(max_nack_list_size_, oldest_packet_to_nack_, @@ -433,7 +427,6 @@ class TestRunningJitterBuffer : public ::testing::TestWithParam, VCMJitterBuffer* jitter_buffer_; StreamGenerator* stream_generator_; std::unique_ptr clock_; - NullEventFactory event_factory_; size_t max_nack_list_size_; int oldest_packet_to_nack_; uint8_t data_buffer_[kDataBufferSize]; diff --git a/modules/video_coding/receiver_unittest.cc b/modules/video_coding/receiver_unittest.cc index 1ff866298e..320d466095 100644 --- a/modules/video_coding/receiver_unittest.cc +++ b/modules/video_coding/receiver_unittest.cc @@ -18,7 +18,6 @@ #include "modules/video_coding/packet.h" #include "modules/video_coding/receiver.h" #include "modules/video_coding/test/stream_generator.h" -#include "modules/video_coding/test/test_util.h" #include "modules/video_coding/timing.h" #include "rtc_base/checks.h" #include "system_wrappers/include/clock.h" @@ -31,7 +30,7 @@ class TestVCMReceiver : public ::testing::Test { TestVCMReceiver() : clock_(new SimulatedClock(0)), timing_(clock_.get()), - receiver_(&timing_, clock_.get(), &event_factory_) { + receiver_(&timing_, clock_.get(), nullptr) { stream_generator_.reset( new StreamGenerator(0, clock_->TimeInMilliseconds())); } @@ -81,7 +80,6 @@ class TestVCMReceiver : public ::testing::Test { std::unique_ptr clock_; VCMTiming timing_; - NullEventFactory event_factory_; VCMReceiver receiver_; std::unique_ptr stream_generator_; }; diff --git a/modules/video_coding/test/test_util.h b/modules/video_coding/test/test_util.h deleted file mode 100644 index a38fc58b12..0000000000 --- a/modules/video_coding/test/test_util.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ -#define MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ - -#include "system_wrappers/include/event_wrapper.h" - -class NullEventFactory : public webrtc::EventFactory { - public: - virtual ~NullEventFactory() {} - - webrtc::EventWrapper* CreateEvent() override { return new NullEvent; } - - private: - // Private class to avoid more dependencies on it in tests. - class NullEvent : public webrtc::EventWrapper { - public: - ~NullEvent() override {} - bool Set() override { return true; } - webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT - return webrtc::kEventTimeout; - } - }; -}; - -#endif // MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_ diff --git a/modules/video_coding/video_receiver_unittest.cc b/modules/video_coding/video_receiver_unittest.cc index f50398c01d..c446108053 100644 --- a/modules/video_coding/video_receiver_unittest.cc +++ b/modules/video_coding/video_receiver_unittest.cc @@ -14,7 +14,6 @@ #include "api/test/mock_video_decoder.h" #include "modules/video_coding/include/mock/mock_vcm_callbacks.h" #include "modules/video_coding/include/video_coding.h" -#include "modules/video_coding/test/test_util.h" #include "modules/video_coding/timing.h" #include "modules/video_coding/video_coding_impl.h" #include "system_wrappers/include/clock.h" @@ -37,7 +36,7 @@ class TestVideoReceiver : public ::testing::Test { virtual void SetUp() { timing_.reset(new VCMTiming(&clock_)); - receiver_.reset(new VideoReceiver(&clock_, &event_factory_, timing_.get())); + receiver_.reset(new VideoReceiver(&clock_, nullptr, timing_.get())); receiver_->RegisterExternalDecoder(&decoder_, kUnusedPayloadType); const size_t kMaxNackListSize = 250; const int kMaxPacketAgeToNack = 450; @@ -81,7 +80,6 @@ class TestVideoReceiver : public ::testing::Test { } SimulatedClock clock_; - NullEventFactory event_factory_; VideoCodec settings_; NiceMock decoder_; NiceMock packet_request_callback_;