blob: 31a2754e19a7a9eb4de357805f67a981556ffe3e [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:
21 WebRtcMediaEngineNullVideo(webrtc::AudioDeviceModule* adm,
22 WebRtcVideoEncoderFactory* encoder_factory,
solenbergff976312016-03-30 23:28:51 -070023 WebRtcVideoDecoderFactory* decoder_factory)
24 : CompositeMediaEngine<WebRtcVoiceEngine, NullWebRtcVideoEngine>(adm) {
jbauch4cb3e392016-01-26 13:07:54 -080025 video_.SetExternalDecoderFactory(decoder_factory);
26 video_.SetExternalEncoderFactory(encoder_factory);
27 }
28};
29
30// Simple test to check if NullWebRtcVideoEngine implements the methods
31// required by CompositeMediaEngine.
32TEST(NullWebRtcVideoEngineTest, CheckInterface) {
33 WebRtcMediaEngineNullVideo engine(nullptr, nullptr, nullptr);
solenbergff976312016-03-30 23:28:51 -070034 EXPECT_TRUE(engine.Init());
jbauch4cb3e392016-01-26 13:07:54 -080035}
36
37} // namespace cricket