blob: 343e167fcb9b888e32e4648bb4c7a36ce1efea0b [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
Sebastian Janssonfa0aa392018-11-16 09:54:32 +010016#include "absl/memory/memory.h"
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010017#include "api/task_queue/default_task_queue_factory.h"
18#include "api/task_queue/task_queue_factory.h"
Steve Anton10542f22019-01-11 09:11:00 -080019#include "media/engine/webrtc_voice_engine.h"
henrika919dc2e2017-10-12 14:24:55 +020020#include "modules/audio_device/include/mock_audio_device.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020021#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"
jbauch4cb3e392016-01-26 13:07:54 -080025
26namespace cricket {
27
jbauch4cb3e392016-01-26 13:07:54 -080028// Simple test to check if NullWebRtcVideoEngine implements the methods
29// required by CompositeMediaEngine.
30TEST(NullWebRtcVideoEngineTest, CheckInterface) {
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010031 std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
32 webrtc::CreateDefaultTaskQueueFactory();
henrika919dc2e2017-10-12 14:24:55 +020033 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
Danil Chapovalov4c7112a2019-03-27 18:51:45 +010034 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
solenbergff976312016-03-30 23:28:51 -070043 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080044}
45
46} // namespace cricket