blob: 38d6e77488632fa32b50fd0e7ec715ce1d1f1f66 [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"
jbauch4cb3e392016-01-26 13:07:54 -080015
16namespace cricket {
17
18class WebRtcMediaEngineNullVideo
19 : public CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine> {
20 public:
ossu29b1a8d2016-06-13 07:34:51 -070021 WebRtcMediaEngineNullVideo(
22 webrtc::AudioDeviceModule* adm,
23 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>&
24 audio_decoder_factory,
25 WebRtcVideoEncoderFactory* video_encoder_factory,
26 WebRtcVideoDecoderFactory* video_decoder_factory)
27 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(
28 adm, audio_decoder_factory) {
29 video_.SetExternalDecoderFactory(video_decoder_factory);
30 video_.SetExternalEncoderFactory(video_encoder_factory);
jbauch4cb3e392016-01-26 13:07:54 -080031 }
32};
33
34// Simple test to check if NullWebRtcVideoEngine implements the methods
35// required by CompositeMediaEngine.
36TEST(NullWebRtcVideoEngineTest, CheckInterface) {
ossuf93be582016-07-13 06:31:30 -070037 WebRtcMediaEngineNullVideo engine(nullptr, nullptr, nullptr, nullptr);
solenbergff976312016-03-30 23:28:51 -070038 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080039}
40
41} // namespace cricket