jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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. |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 11 | #include "media/engine/null_webrtc_video_engine.h" |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 12 | |
| 13 | #include <memory> |
| 14 | #include <utility> |
| 15 | |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 16 | #include "api/task_queue/default_task_queue_factory.h" |
| 17 | #include "api/task_queue/task_queue_factory.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 18 | #include "media/engine/webrtc_voice_engine.h" |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 19 | #include "modules/audio_device/include/mock_audio_device.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 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" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 24 | |
| 25 | namespace cricket { |
| 26 | |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 27 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 28 | // required by CompositeMediaEngine. |
| 29 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 30 | std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory = |
| 31 | webrtc::CreateDefaultTaskQueueFactory(); |
Mirko Bonadei | 6a489f2 | 2019-04-09 15:11:12 +0200 | [diff] [blame] | 32 | ::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm; |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 33 | auto audio_engine = std::make_unique<WebRtcVoiceEngine>( |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 34 | task_queue_factory.get(), &adm, |
| 35 | webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), |
| 36 | webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr, |
| 37 | webrtc::AudioProcessingBuilder().Create()); |
| 38 | |
| 39 | CompositeMediaEngine engine(std::move(audio_engine), |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 40 | std::make_unique<NullWebRtcVideoEngine>()); |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 41 | |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 42 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | } // namespace cricket |