blob: 85eaea3a927232163eb1cf61cd95cbb503040dfe [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"
Sebastian Janssonfa0aa392018-11-16 09:54:32 +010012#include "absl/memory/memory.h"
Steve Anton10542f22019-01-11 09:11:00 -080013#include "media/engine/webrtc_voice_engine.h"
henrika919dc2e2017-10-12 14:24:55 +020014#include "modules/audio_device/include/mock_audio_device.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "modules/audio_processing/include/audio_processing.h"
16#include "test/gtest.h"
17#include "test/mock_audio_decoder_factory.h"
18#include "test/mock_audio_encoder_factory.h"
jbauch4cb3e392016-01-26 13:07:54 -080019
20namespace cricket {
21
Amit Hilbuche27ccf92019-03-26 17:36:53 +000022class WebRtcMediaEngineNullVideo : public CompositeMediaEngine {
23 public:
24 WebRtcMediaEngineNullVideo(
25 webrtc::AudioDeviceModule* adm,
26 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
27 audio_encoder_factory,
28 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
29 audio_decoder_factory)
30 : CompositeMediaEngine(absl::make_unique<WebRtcVoiceEngine>(
31 adm,
32 audio_encoder_factory,
33 audio_decoder_factory,
34 nullptr,
35 webrtc::AudioProcessingBuilder().Create()),
36 absl::make_unique<NullWebRtcVideoEngine>()) {}
37};
38
jbauch4cb3e392016-01-26 13:07:54 -080039// Simple test to check if NullWebRtcVideoEngine implements the methods
40// required by CompositeMediaEngine.
41TEST(NullWebRtcVideoEngineTest, CheckInterface) {
henrika919dc2e2017-10-12 14:24:55 +020042 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
Amit Hilbuche27ccf92019-03-26 17:36:53 +000043 WebRtcMediaEngineNullVideo engine(
44 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
45 webrtc::MockAudioDecoderFactory::CreateUnusedFactory());
solenbergff976312016-03-30 23:28:51 -070046 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080047}
48
49} // namespace cricket