1 /*
2 * Copyright (c) 2016 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 "media/engine/null_webrtc_video_engine.h"
12
13 #include <memory>
14 #include <utility>
15
16 #include "api/task_queue/default_task_queue_factory.h"
17 #include "api/task_queue/task_queue_factory.h"
18 #include "api/transport/field_trial_based_config.h"
19 #include "media/engine/webrtc_voice_engine.h"
20 #include "modules/audio_device/include/mock_audio_device.h"
21 #include "modules/audio_processing/include/audio_processing.h"
22 #include "test/gtest.h"
23 #include "test/mock_audio_decoder_factory.h"
24 #include "test/mock_audio_encoder_factory.h"
25
26 namespace cricket {
27
28 // Simple test to check if NullWebRtcVideoEngine implements the methods
29 // required by CompositeMediaEngine.
TEST(NullWebRtcVideoEngineTest,CheckInterface)30 TEST(NullWebRtcVideoEngineTest, CheckInterface) {
31 std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
32 webrtc::CreateDefaultTaskQueueFactory();
33 rtc::scoped_refptr<webrtc::test::MockAudioDeviceModule> adm =
34 webrtc::test::MockAudioDeviceModule::CreateNice();
35 webrtc::FieldTrialBasedConfig trials;
36 auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
37 task_queue_factory.get(), adm.get(),
38 webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
39 webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
40 webrtc::AudioProcessingBuilder().Create(), nullptr, trials);
41
42 CompositeMediaEngine engine(std::move(audio_engine),
43 std::make_unique<NullWebRtcVideoEngine>());
44 engine.Init();
45 }
46
47 } // namespace cricket
48