Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc.orig

Issue 2747123007: Test submission of complete AEC-dump refactoring. (Closed)
Patch Set: Changed interface and build structure after reviewer comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/audio_processing_unittest.cc.orig
diff --git a/webrtc/modules/audio_processing/audio_processing_unittest.cc b/webrtc/modules/audio_processing/audio_processing_unittest.cc.orig
similarity index 98%
copy from webrtc/modules/audio_processing/audio_processing_unittest.cc
copy to webrtc/modules/audio_processing/audio_processing_unittest.cc.orig
index b52acce230c4d980feb25d8aa89a6f3092b619d1..1fd04acf11b6d5182bbcdd91aa09b4f550e5dae7 100644
--- a/webrtc/modules/audio_processing/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_unittest.cc.orig
@@ -20,6 +20,13 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/gtest_prod_util.h"
#include "webrtc/base/ignore_wundef.h"
+<<<<<<< HEAD
+||||||| parent of 6d4e36d05... aec-dumper and null-aec-dumper. Most parts are implemented.
+#include "webrtc/base/protobuf_utils.h"
+=======
+#include "webrtc/base/task_queue.h"
+#include "webrtc/base/thread.h"
+>>>>>>> 6d4e36d05... aec-dumper and null-aec-dumper. Most parts are implemented.
#include "webrtc/common_audio/include/audio_util.h"
#include "webrtc/common_audio/resampler/include/push_resampler.h"
#include "webrtc/common_audio/resampler/push_sinc_resampler.h"
@@ -410,17 +417,17 @@ class ApmTest : public ::testing::Test {
ApmTest::ApmTest()
: output_path_(test::OutputPath()),
#if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
- ref_filename_(test::ResourcePath("audio_processing/output_data_fixed",
- "pb")),
+ ref_filename_(
+ test::ResourcePath("audio_processing/output_data_fixed", "pb")),
#elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
#if defined(WEBRTC_MAC)
// A different file for Mac is needed because on this platform the AEC
// constant |kFixedDelayMs| value is 20 and not 50 as it is on the rest.
- ref_filename_(test::ResourcePath("audio_processing/output_data_mac",
- "pb")),
+ ref_filename_(
+ test::ResourcePath("audio_processing/output_data_mac", "pb")),
#else
- ref_filename_(test::ResourcePath("audio_processing/output_data_float",
- "pb")),
+ ref_filename_(
+ test::ResourcePath("audio_processing/output_data_float", "pb")),
#endif
#endif
frame_(NULL),
@@ -581,6 +588,7 @@ void ApmTest::ProcessWithDefaultStreamParameters(AudioFrame* frame) {
}
int ApmTest::ProcessStreamChooser(Format format) {
+ rtc::Thread::Current()->SleepMs(1);
if (format == kIntFormat) {
return apm_->ProcessStream(frame_);
}
@@ -594,6 +602,7 @@ int ApmTest::ProcessStreamChooser(Format format) {
}
int ApmTest::AnalyzeReverseStreamChooser(Format format) {
+ rtc::Thread::Current()->SleepMs(1);
if (format == kIntFormat) {
return apm_->ProcessReverseStream(revframe_);
}
@@ -1706,6 +1715,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");
FILE* in_file = fopen(in_filename.c_str(), "rb");
ASSERT_TRUE(in_file != NULL);
audioproc::Event event_msg;
@@ -1733,8 +1743,8 @@ void ApmTest::ProcessDebugDump(const std::string& in_filename,
if (first_init) {
// StartDebugRecording() writes an additional init message. Don't start
// recording until after the first init to avoid the extra message.
- EXPECT_NOERR(
- apm_->StartDebugRecording(out_filename.c_str(), max_size_bytes));
+ EXPECT_NOERR(apm_->StartDebugRecording(out_filename.c_str(),
+ max_size_bytes, &worker_queue));
first_init = false;
}
@@ -1870,16 +1880,16 @@ TEST_F(ApmTest, VerifyDebugDumpFloat) {
// TODO(andrew): expand test to verify output.
TEST_F(ApmTest, DebugDump) {
+ rtc::TaskQueue worker_queue("ApmTest_worker_queue");
const std::string filename =
test::TempFilename(test::OutputPath(), "debug_aec");
- EXPECT_EQ(apm_->kNullPointerError,
- apm_->StartDebugRecording(static_cast<const char*>(NULL), -1));
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
// Stopping without having started should be OK.
EXPECT_EQ(apm_->kNoError, apm_->StopDebugRecording());
- EXPECT_EQ(apm_->kNoError, apm_->StartDebugRecording(filename.c_str(), -1));
+ EXPECT_EQ(apm_->kNoError,
+ apm_->StartDebugRecording(filename.c_str(), -1, &worker_queue));
EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_));
EXPECT_EQ(apm_->kNoError, apm_->ProcessReverseStream(revframe_));
EXPECT_EQ(apm_->kNoError, apm_->StopDebugRecording());
@@ -1903,18 +1913,17 @@ TEST_F(ApmTest, DebugDump) {
// TODO(andrew): expand test to verify output.
TEST_F(ApmTest, DebugDumpFromFileHandle) {
- FILE* fid = NULL;
- EXPECT_EQ(apm_->kNullPointerError, apm_->StartDebugRecording(fid, -1));
+ rtc::TaskQueue worker_queue("ApmTest_worker_queue");
const std::string filename =
test::TempFilename(test::OutputPath(), "debug_aec");
- fid = fopen(filename.c_str(), "w");
+ FILE* fid = fopen(filename.c_str(), "w");
ASSERT_TRUE(fid);
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
// Stopping without having started should be OK.
EXPECT_EQ(apm_->kNoError, apm_->StopDebugRecording());
- EXPECT_EQ(apm_->kNoError, apm_->StartDebugRecording(fid, -1));
+ EXPECT_EQ(apm_->kNoError, apm_->StartDebugRecording(fid, -1, &worker_queue));
EXPECT_EQ(apm_->kNoError, apm_->ProcessReverseStream(revframe_));
EXPECT_EQ(apm_->kNoError, apm_->ProcessStream(frame_));
EXPECT_EQ(apm_->kNoError, apm_->StopDebugRecording());
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_unittest.cc ('k') | webrtc/modules/audio_processing/include/aec_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698