blob: 584cafe0a6a91ccc2da4c766e6170b38566d3674 [file] [log] [blame]
jbauch4cb3e392016-01-26 13:07:54 -08001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
jbauch4cb3e392016-01-26 13:07:54 -08003 *
kjellander1afca732016-02-07 20:46:45 -08004 * 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.
jbauch4cb3e392016-01-26 13:07:54 -08009 */
10
Steve Anton10542f22019-01-11 09:11:00 -080011#include "media/engine/null_webrtc_video_engine.h"
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010012
13#include <memory>
14#include <utility>
15
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010016#include "api/task_queue/default_task_queue_factory.h"
17#include "api/task_queue/task_queue_factory.h"
Steve Anton10542f22019-01-11 09:11:00 -080018#include "media/engine/webrtc_voice_engine.h"
henrika919dc2e2017-10-12 14:24:55 +020019#include "modules/audio_device/include/mock_audio_device.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#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"
jbauch4cb3e392016-01-26 13:07:54 -080024
25namespace cricket {
26
jbauch4cb3e392016-01-26 13:07:54 -080027// Simple test to check if NullWebRtcVideoEngine implements the methods
28// required by CompositeMediaEngine.
29TEST(NullWebRtcVideoEngineTest, CheckInterface) {
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010030 std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
31 webrtc::CreateDefaultTaskQueueFactory();
Mirko Bonadei6a489f22019-04-09 15:11:12 +020032 ::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
Mirko Bonadei317a1f02019-09-17 17:06:18 +020033 auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010034 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 Bonadei317a1f02019-09-17 17:06:18 +020040 std::make_unique<NullWebRtcVideoEngine>());
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010041
solenbergff976312016-03-30 23:28:51 -070042 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080043}
44
45} // namespace cricket