Use TaskQueueForTest instead or TaskQueue in unittests
To avoid hidden dependency on GlobalTaskQueueFactory used to construct TaskQueue Bug: webrtc:10284 Change-Id: Iaa08be2827198e16aeb5538ea188d54cab60c1d9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128879 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27291}
This commit is contained in:

committed by
Commit Bot

parent
a533e00fa0
commit
07122bc87e
@ -453,6 +453,7 @@ if (rtc_include_tests) {
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_base_tests_utils",
|
||||
"../../rtc_base:safe_minmax",
|
||||
"../../rtc_base:task_queue_for_test",
|
||||
"../../rtc_base/system:arch",
|
||||
"../../rtc_base/system:file_wrapper",
|
||||
"../../system_wrappers",
|
||||
@ -618,7 +619,7 @@ if (rtc_include_tests) {
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_json",
|
||||
"../../rtc_base:rtc_task_queue",
|
||||
"../../rtc_base:task_queue_for_test",
|
||||
"../../system_wrappers",
|
||||
"../../test:test_support",
|
||||
"aec_dump",
|
||||
|
@ -87,7 +87,7 @@ if (rtc_enable_protobuf) {
|
||||
":aec_dump_impl",
|
||||
"..:audioproc_debug_proto",
|
||||
"../",
|
||||
"../../../rtc_base:rtc_task_queue",
|
||||
"../../../rtc_base:task_queue_for_test",
|
||||
"../../../test:fileutils",
|
||||
"../../../test:test_support",
|
||||
"//testing/gtest",
|
||||
|
@ -12,14 +12,14 @@
|
||||
|
||||
#include "modules/audio_processing/aec_dump/aec_dump_factory.h"
|
||||
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
TEST(AecDumper, APICallsDoNotCrash) {
|
||||
// Note order of initialization: Task queue has to be initialized
|
||||
// before AecDump.
|
||||
rtc::TaskQueue file_writer_queue("file_writer_queue");
|
||||
webrtc::TaskQueueForTest file_writer_queue("file_writer_queue");
|
||||
|
||||
const std::string filename =
|
||||
webrtc::test::TempFilename(webrtc::test::OutputPath(), "aec_dump");
|
||||
@ -48,7 +48,7 @@ TEST(AecDumper, APICallsDoNotCrash) {
|
||||
}
|
||||
|
||||
TEST(AecDumper, WriteToFile) {
|
||||
rtc::TaskQueue file_writer_queue("file_writer_queue");
|
||||
webrtc::TaskQueueForTest file_writer_queue("file_writer_queue");
|
||||
|
||||
const std::string filename =
|
||||
webrtc::test::TempFilename(webrtc::test::OutputPath(), "aec_dump");
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_base/swap_queue.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
@ -1448,7 +1448,7 @@ void ApmTest::ProcessDebugDump(const std::string& in_filename,
|
||||
const std::string& out_filename,
|
||||
Format format,
|
||||
int max_size_bytes) {
|
||||
rtc::TaskQueue worker_queue("ApmTest_worker_queue");
|
||||
TaskQueueForTest worker_queue("ApmTest_worker_queue");
|
||||
FILE* in_file = fopen(in_filename.c_str(), "rb");
|
||||
ASSERT_TRUE(in_file != NULL);
|
||||
audioproc::Event event_msg;
|
||||
@ -1616,7 +1616,7 @@ TEST_F(ApmTest, VerifyDebugDumpFloat) {
|
||||
|
||||
// TODO(andrew): expand test to verify output.
|
||||
TEST_F(ApmTest, DebugDump) {
|
||||
rtc::TaskQueue worker_queue("ApmTest_worker_queue");
|
||||
TaskQueueForTest worker_queue("ApmTest_worker_queue");
|
||||
const std::string filename =
|
||||
test::TempFilename(test::OutputPath(), "debug_aec");
|
||||
{
|
||||
@ -1650,7 +1650,7 @@ TEST_F(ApmTest, DebugDump) {
|
||||
|
||||
// TODO(andrew): expand test to verify output.
|
||||
TEST_F(ApmTest, DebugDumpFromFileHandle) {
|
||||
rtc::TaskQueue worker_queue("ApmTest_worker_queue");
|
||||
TaskQueueForTest worker_queue("ApmTest_worker_queue");
|
||||
|
||||
const std::string filename =
|
||||
test::TempFilename(test::OutputPath(), "debug_aec");
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "modules/audio_processing/test/fake_recording_device.h"
|
||||
#include "modules/audio_processing/test/test_utils.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
#include "rtc_base/time_utils.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -199,7 +199,7 @@ class AudioProcessingSimulator {
|
||||
int analog_mic_level_;
|
||||
FakeRecordingDevice fake_recording_device_;
|
||||
|
||||
rtc::TaskQueue worker_queue_;
|
||||
TaskQueueForTest worker_queue_;
|
||||
|
||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioProcessingSimulator);
|
||||
};
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "modules/audio_processing/aec_dump/aec_dump_factory.h"
|
||||
#include "modules/audio_processing/test/debug_dump_replayer.h"
|
||||
#include "modules/audio_processing/test/test_utils.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/file_utils.h"
|
||||
|
||||
@ -110,7 +110,7 @@ class DebugDumpGenerator {
|
||||
|
||||
bool enable_pre_amplifier_;
|
||||
|
||||
rtc::TaskQueue worker_queue_;
|
||||
TaskQueueForTest worker_queue_;
|
||||
std::unique_ptr<AudioProcessing> apm_;
|
||||
|
||||
const std::string dump_file_name_;
|
||||
|
Reference in New Issue
Block a user