blob: 52cd0f2a62cd95d7cb380487829732c57e58edb9 [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
11#include "testing/gtest/include/gtest/gtest.h"
12
kjellander@webrtc.org5ad12972016-02-12 06:39:40 +010013#include "webrtc/media/engine/nullwebrtcvideoengine.h"
14#include "webrtc/media/engine/webrtcvoiceengine.h"
ossu95eb1ba2016-07-13 06:05:27 -070015#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
jbauch4cb3e392016-01-26 13:07:54 -080016
17namespace cricket {
18
19class WebRtcMediaEngineNullVideo
20 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
21 public:
ossu29b1a8d2016-06-13 07:34:51 -070022 WebRtcMediaEngineNullVideo(
23 webrtc::AudioDeviceModule* adm,
24 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
25 audio_decoder_factory,
26 WebRtcVideoEncoderFactory* video_encoder_factory,
27 WebRtcVideoDecoderFactory* video_decoder_factory)
28 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
29 adm, audio_decoder_factory) {
30 video_.SetExternalDecoderFactory(video_decoder_factory);
31 video_.SetExternalEncoderFactory(video_encoder_factory);
jbauch4cb3e392016-01-26 13:07:54 -080032 }
33};
34
35// Simple test to check if NullWebRtcVideoEngine implements the methods
36// required by CompositeMediaEngine.
37TEST(NullWebRtcVideoEngineTest, CheckInterface) {
ossu95eb1ba2016-07-13 06:05:27 -070038 WebRtcMediaEngineNullVideo engine(
39 nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
40 nullptr);
solenbergff976312016-03-30 23:28:51 -070041 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080042}
43
44} // namespace cricket