blob: 84f330a9e78796de4276569dab6362ff4c935dcf [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"
13#include "modules/audio_processing/include/audio_processing.h"
14#include "test/gtest.h"
15#include "test/mock_audio_decoder_factory.h"
16#include "test/mock_audio_encoder_factory.h"
jbauch4cb3e392016-01-26 13:07:54 -080017
18namespace cricket {
19
20class WebRtcMediaEngineNullVideo
21 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
22 public:
ossu29b1a8d2016-06-13 07:34:51 -070023 WebRtcMediaEngineNullVideo(
24 webrtc::AudioDeviceModule* adm,
ossueb1fde42017-05-02 06:46:30 -070025 const rtc::scoped_refptr<webrtc::AudioEncoderFactory>&
26 audio_encoder_factory,
ossu29b1a8d2016-06-13 07:34:51 -070027 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
magjed2475ae22017-09-12 04:42:15 -070028 audio_decoder_factory)
ossu29b1a8d2016-06-13 07:34:51 -070029 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
magjed2475ae22017-09-12 04:42:15 -070030 std::forward_as_tuple(adm,
31 audio_encoder_factory,
32 audio_decoder_factory,
33 nullptr,
34 webrtc::AudioProcessing::Create()),
35 std::forward_as_tuple()) {}
jbauch4cb3e392016-01-26 13:07:54 -080036};
37
38// Simple test to check if NullWebRtcVideoEngine implements the methods
39// required by CompositeMediaEngine.
40TEST(NullWebRtcVideoEngineTest, CheckInterface) {
ossuc54071d2016-08-17 02:45:41 -070041 WebRtcMediaEngineNullVideo engine(
ossueb1fde42017-05-02 06:46:30 -070042 nullptr, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
magjed2475ae22017-09-12 04:42:15 -070043 webrtc::MockAudioDecoderFactory::CreateUnusedFactory());
solenbergff976312016-03-30 23:28:51 -070044 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080045}
46
47} // namespace cricket