blob: cf5f5076e07b2960c0ca9466723c9ae2219c08d8 [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,
23 WebRtcVideoDecoderFactory* decoder_factory) {
24 voice_.SetAudioDeviceModule(adm);
25 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);
34
35 EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
36 engine.Terminate();
37}
38
39} // namespace cricket