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