2016-01-26 13:07:54 -08:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
|
2016-01-26 13:07:54 -08:00
|
|
|
*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2016-01-26 13:07:54 -08:00
|
|
|
*/
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "media/engine/null_webrtc_video_engine.h"
|
2019-03-27 18:51:45 +01:00
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
2018-11-16 09:54:32 +01:00
|
|
|
#include "absl/memory/memory.h"
|
2019-03-27 18:51:45 +01:00
|
|
|
#include "api/task_queue/default_task_queue_factory.h"
|
|
|
|
|
#include "api/task_queue/task_queue_factory.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "media/engine/webrtc_voice_engine.h"
|
2017-10-12 14:24:55 +02:00
|
|
|
#include "modules/audio_device/include/mock_audio_device.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/include/audio_processing.h"
|
|
|
|
|
#include "test/gtest.h"
|
|
|
|
|
#include "test/mock_audio_decoder_factory.h"
|
|
|
|
|
#include "test/mock_audio_encoder_factory.h"
|
2016-01-26 13:07:54 -08:00
|
|
|
|
|
|
|
|
namespace cricket {
|
|
|
|
|
|
|
|
|
|
// Simple test to check if NullWebRtcVideoEngine implements the methods
|
|
|
|
|
// required by CompositeMediaEngine.
|
|
|
|
|
TEST(NullWebRtcVideoEngineTest, CheckInterface) {
|
2019-03-27 18:51:45 +01:00
|
|
|
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
|
|
|
|
|
webrtc::CreateDefaultTaskQueueFactory();
|
2017-10-12 14:24:55 +02:00
|
|
|
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
2019-03-27 18:51:45 +01:00
|
|
|
auto audio_engine = absl::make_unique<WebRtcVoiceEngine>(
|
|
|
|
|
task_queue_factory.get(), &adm,
|
|
|
|
|
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
|
|
|
|
webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr,
|
|
|
|
|
webrtc::AudioProcessingBuilder().Create());
|
|
|
|
|
|
|
|
|
|
CompositeMediaEngine engine(std::move(audio_engine),
|
|
|
|
|
absl::make_unique<NullWebRtcVideoEngine>());
|
|
|
|
|
|
2016-03-30 23:28:51 -07:00
|
|
|
EXPECT_TRUE(engine.Init());
|
2016-01-26 13:07:54 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace cricket
|