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

Side by Side Diff: webrtc/modules/audio_processing/aec_dumper/aec_dumper_unittest.cc

Issue 2747123007: Test submission of complete AEC-dump refactoring. (Closed)
Patch Set: Refactoring introduced bug: DCHECK(moved uptr) 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include <utility>
12
13 #include "webrtc/modules/audio_processing/aec_dumper/aec_dumper.h"
14
15 #include "webrtc/base/task_queue.h"
16 #include "webrtc/modules/include/module_common_types.h"
17 #include "webrtc/test/gtest.h"
18
19 TEST(AecDumper, APICallsDoNotCrash) {
20 // Note order of initialization: factory first (has event pool),
21 // then task queue (looks at event pool), then aec_dumper (posts
22 // stuff to task queue).
23 rtc::TaskQueue file_writer_queue("file_writer_queue");
24 auto aec_dumper = webrtc::AecDumper::Create("file1", -1, &file_writer_queue);
25 EXPECT_TRUE(aec_dumper);
26
27 // TODO(aleloi): wait a while and check that file1 is
28 // opened. Perhaps add a Flush/join method? Or call d-tor?
29 aec_dumper = webrtc::AecDumper::Create("file2", -1, &file_writer_queue);
30
31 aec_dumper = webrtc::AecDumper::Create("file3", 10, &file_writer_queue);
32
33 // TODO(aleloi): open from handle.
34
35 const webrtc::AudioFrame frame;
36 aec_dumper->WriteReverseStreamMessage(frame);
37
38 auto capture_stream_info = aec_dumper->GetCaptureStreamInfo();
39
40 capture_stream_info->AddInput(frame);
41 capture_stream_info->AddOutput(frame);
42
43 aec_dumper->WriteCaptureStreamMessage(std::move(capture_stream_info));
44
45 webrtc::InternalAPMConfig apm_config;
46 aec_dumper->WriteConfig(apm_config, false);
47
48 aec_dumper->WriteConfig(apm_config, true);
49
50 webrtc::ProcessingConfig processing_config;
51 aec_dumper->WriteInitMessage(processing_config);
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698