blob: a53f773fec976eb583b73eadf4f514ed53053091 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "media/engine/nullwebrtcvideoengine.h"
12#include "media/engine/webrtcvoiceengine.h"
henrika919dc2e2017-10-12 14:24:55 +020013#include "modules/audio_device/include/mock_audio_device.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020014#include "modules/audio_processing/include/audio_processing.h"
15#include "test/gtest.h"
16#include "test/mock_audio_decoder_factory.h"
17#include "test/mock_audio_encoder_factory.h"
jbauch4cb3e392016-01-26 13:07:54 -080018
19namespace cricket {
20
21class WebRtcMediaEngineNullVideo
22 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
23 public:
ossu29b1a8d2016-06-13 07:34:51 -070024 WebRtcMediaEngineNullVideo(
25 webrtc::AudioDeviceModule* adm,
ossueb1fde42017-05-02 06:46:30 -070026 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
27 audio_encoder_factory,
ossu29b1a8d2016-06-13 07:34:51 -070028 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
magjed2475ae22017-09-12 04:42:15 -070029 audio_decoder_factory)
ossu29b1a8d2016-06-13 07:34:51 -070030 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
magjed2475ae22017-09-12 04:42:15 -070031 std::forward_as_tuple(adm,
32 audio_encoder_factory,
33 audio_decoder_factory,
34 nullptr,
35 webrtc::AudioProcessing::Create()),
36 std::forward_as_tuple()) {}
jbauch4cb3e392016-01-26 13:07:54 -080037};
38
39// 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;
ossuc54071d2016-08-17 02:45:41 -070043 WebRtcMediaEngineNullVideo engine(
henrika919dc2e2017-10-12 14:24:55 +020044 &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
magjed2475ae22017-09-12 04:42:15 -070045 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