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 | |
Sebastian Jansson | fa0aa39 | 2018-11-16 09:54:32 +0100 | [diff] [blame] | 16 | #include "absl/memory/memory.h" |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 17 | #include "api/task_queue/default_task_queue_factory.h" |
| 18 | #include "api/task_queue/task_queue_factory.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 19 | #include "media/engine/webrtc_voice_engine.h" |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 20 | #include "modules/audio_device/include/mock_audio_device.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 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" |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 25 | |
| 26 | namespace cricket { |
| 27 | |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 28 | // Simple test to check if NullWebRtcVideoEngine implements the methods |
| 29 | // required by CompositeMediaEngine. |
| 30 | TEST(NullWebRtcVideoEngineTest, CheckInterface) { |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 31 | std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory = |
| 32 | webrtc::CreateDefaultTaskQueueFactory(); |
henrika | 919dc2e | 2017-10-12 14:24:55 +0200 | [diff] [blame] | 33 | testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm; |
Danil Chapovalov | 4c7112a | 2019-03-27 18:51:45 +0100 | [diff] [blame] | 34 | auto audio_engine = absl::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 | absl::make_unique<NullWebRtcVideoEngine>()); |
| 42 | |
solenberg | ff97631 | 2016-03-30 23:28:51 -0700 | [diff] [blame] | 43 | EXPECT_TRUE(engine.Init()); |
jbauch | 4cb3e39 | 2016-01-26 13:07:54 -0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | } // namespace cricket |