mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Migrate PeerConnection tests to EnableMedia api
Add test helper to inject fake media engine for those tests. Bug: webrtc:15574 Change-Id: Iae4282d2d3b9804548ccadf58797f39508f07c6a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325880 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41075}
This commit is contained in:
parent
37f5172f6e
commit
c63120a092
11 changed files with 134 additions and 29 deletions
20
pc/BUILD.gn
20
pc/BUILD.gn
|
@ -2372,6 +2372,7 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||||
":dtls_srtp_transport",
|
":dtls_srtp_transport",
|
||||||
":dtls_transport",
|
":dtls_transport",
|
||||||
":dtmf_sender",
|
":dtmf_sender",
|
||||||
|
":enable_fake_media",
|
||||||
":ice_server_parsing",
|
":ice_server_parsing",
|
||||||
":integration_test_helpers",
|
":integration_test_helpers",
|
||||||
":jitter_buffer_delay",
|
":jitter_buffer_delay",
|
||||||
|
@ -2532,7 +2533,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||||
":libjingle_peerconnection",
|
":libjingle_peerconnection",
|
||||||
":pc_test_utils",
|
":pc_test_utils",
|
||||||
":rtc_pc",
|
":rtc_pc",
|
||||||
"../api:callfactory_api",
|
|
||||||
"../api:rtc_event_log_output_file",
|
"../api:rtc_event_log_output_file",
|
||||||
"../api:rtc_stats_api",
|
"../api:rtc_stats_api",
|
||||||
"../api:rtp_parameters",
|
"../api:rtp_parameters",
|
||||||
|
@ -2729,6 +2729,23 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rtc_library("enable_fake_media") {
|
||||||
|
testonly = true
|
||||||
|
visibility = [ ":*" ]
|
||||||
|
sources = [
|
||||||
|
"test/enable_fake_media.cc",
|
||||||
|
"test/enable_fake_media.h",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":media_factory",
|
||||||
|
"../api:libjingle_peerconnection_api",
|
||||||
|
"../call:call_interfaces",
|
||||||
|
"../media:rtc_media_tests_utils",
|
||||||
|
"../rtc_base:checks",
|
||||||
|
]
|
||||||
|
absl_deps = [ "//third_party/abseil-cpp/absl/base:nullability" ]
|
||||||
|
}
|
||||||
|
|
||||||
rtc_library("pc_test_utils") {
|
rtc_library("pc_test_utils") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
|
@ -2761,6 +2778,7 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||||
deps = [
|
deps = [
|
||||||
":channel",
|
":channel",
|
||||||
":channel_interface",
|
":channel_interface",
|
||||||
|
":enable_fake_media",
|
||||||
":jitter_buffer_delay",
|
":jitter_buffer_delay",
|
||||||
":libjingle_peerconnection",
|
":libjingle_peerconnection",
|
||||||
":peer_connection_internal",
|
":peer_connection_internal",
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/jsep.h"
|
#include "api/jsep.h"
|
||||||
#include "api/media_types.h"
|
#include "api/media_types.h"
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
|
@ -24,8 +23,6 @@
|
||||||
#include "api/task_queue/default_task_queue_factory.h"
|
#include "api/task_queue/default_task_queue_factory.h"
|
||||||
#include "api/task_queue/task_queue_factory.h"
|
#include "api/task_queue/task_queue_factory.h"
|
||||||
#include "api/transport/sctp_transport_factory_interface.h"
|
#include "api/transport/sctp_transport_factory_interface.h"
|
||||||
#include "media/base/fake_media_engine.h"
|
|
||||||
#include "media/base/media_engine.h"
|
|
||||||
#include "p2p/base/p2p_constants.h"
|
#include "p2p/base/p2p_constants.h"
|
||||||
#include "p2p/base/port_allocator.h"
|
#include "p2p/base/port_allocator.h"
|
||||||
#include "pc/media_session.h"
|
#include "pc/media_session.h"
|
||||||
|
@ -35,6 +32,7 @@
|
||||||
#include "pc/sctp_transport.h"
|
#include "pc/sctp_transport.h"
|
||||||
#include "pc/sdp_utils.h"
|
#include "pc/sdp_utils.h"
|
||||||
#include "pc/session_description.h"
|
#include "pc/session_description.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/mock_peer_connection_observers.h"
|
#include "pc/test/mock_peer_connection_observers.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
|
@ -64,8 +62,7 @@ PeerConnectionFactoryDependencies CreatePeerConnectionFactoryDependencies() {
|
||||||
deps.worker_thread = rtc::Thread::Current();
|
deps.worker_thread = rtc::Thread::Current();
|
||||||
deps.signaling_thread = rtc::Thread::Current();
|
deps.signaling_thread = rtc::Thread::Current();
|
||||||
deps.task_queue_factory = CreateDefaultTaskQueueFactory();
|
deps.task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
deps.media_engine = std::make_unique<cricket::FakeMediaEngine>();
|
EnableFakeMedia(deps);
|
||||||
deps.call_factory = CreateCallFactory();
|
|
||||||
deps.sctp_factory = std::make_unique<FakeSctpTransportFactory>();
|
deps.sctp_factory = std::make_unique<FakeSctpTransportFactory>();
|
||||||
return deps;
|
return deps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/jsep.h"
|
#include "api/jsep.h"
|
||||||
#include "api/media_types.h"
|
#include "api/media_types.h"
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
|
@ -35,6 +34,7 @@
|
||||||
#include "p2p/base/port_allocator.h"
|
#include "p2p/base/port_allocator.h"
|
||||||
#include "pc/peer_connection_wrapper.h"
|
#include "pc/peer_connection_wrapper.h"
|
||||||
#include "pc/session_description.h"
|
#include "pc/session_description.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/mock_peer_connection_observers.h"
|
#include "pc/test/mock_peer_connection_observers.h"
|
||||||
#include "rtc_base/internal/default_socket_server.h"
|
#include "rtc_base/internal/default_socket_server.h"
|
||||||
#include "rtc_base/rtc_certificate_generator.h"
|
#include "rtc_base/rtc_certificate_generator.h"
|
||||||
|
@ -77,21 +77,18 @@ class PeerConnectionHeaderExtensionTest
|
||||||
std::unique_ptr<PeerConnectionWrapper> CreatePeerConnection(
|
std::unique_ptr<PeerConnectionWrapper> CreatePeerConnection(
|
||||||
cricket::MediaType media_type,
|
cricket::MediaType media_type,
|
||||||
absl::optional<SdpSemantics> semantics) {
|
absl::optional<SdpSemantics> semantics) {
|
||||||
auto voice = std::make_unique<cricket::FakeVoiceEngine>();
|
auto media_engine = std::make_unique<cricket::FakeMediaEngine>();
|
||||||
auto video = std::make_unique<cricket::FakeVideoEngine>();
|
|
||||||
if (media_type == cricket::MediaType::MEDIA_TYPE_AUDIO)
|
if (media_type == cricket::MediaType::MEDIA_TYPE_AUDIO)
|
||||||
voice->SetRtpHeaderExtensions(extensions_);
|
media_engine->fake_voice_engine()->SetRtpHeaderExtensions(extensions_);
|
||||||
else
|
else
|
||||||
video->SetRtpHeaderExtensions(extensions_);
|
media_engine->fake_video_engine()->SetRtpHeaderExtensions(extensions_);
|
||||||
auto media_engine = std::make_unique<cricket::CompositeMediaEngine>(
|
|
||||||
std::move(voice), std::move(video));
|
|
||||||
PeerConnectionFactoryDependencies factory_dependencies;
|
PeerConnectionFactoryDependencies factory_dependencies;
|
||||||
factory_dependencies.network_thread = rtc::Thread::Current();
|
factory_dependencies.network_thread = rtc::Thread::Current();
|
||||||
factory_dependencies.worker_thread = rtc::Thread::Current();
|
factory_dependencies.worker_thread = rtc::Thread::Current();
|
||||||
factory_dependencies.signaling_thread = rtc::Thread::Current();
|
factory_dependencies.signaling_thread = rtc::Thread::Current();
|
||||||
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
factory_dependencies.media_engine = std::move(media_engine);
|
EnableFakeMedia(factory_dependencies, std::move(media_engine));
|
||||||
factory_dependencies.call_factory = CreateCallFactory();
|
|
||||||
factory_dependencies.event_log_factory =
|
factory_dependencies.event_log_factory =
|
||||||
std::make_unique<RtcEventLogFactory>(
|
std::make_unique<RtcEventLogFactory>(
|
||||||
factory_dependencies.task_queue_factory.get());
|
factory_dependencies.task_queue_factory.get());
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/async_resolver_factory.h"
|
#include "api/async_resolver_factory.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/jsep.h"
|
#include "api/jsep.h"
|
||||||
#include "api/jsep_session_description.h"
|
#include "api/jsep_session_description.h"
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
|
@ -25,7 +24,6 @@
|
||||||
#include "api/task_queue/default_task_queue_factory.h"
|
#include "api/task_queue/default_task_queue_factory.h"
|
||||||
#include "api/task_queue/task_queue_factory.h"
|
#include "api/task_queue/task_queue_factory.h"
|
||||||
#include "api/test/mock_async_dns_resolver.h"
|
#include "api/test/mock_async_dns_resolver.h"
|
||||||
#include "media/base/fake_media_engine.h"
|
|
||||||
#include "media/base/media_engine.h"
|
#include "media/base/media_engine.h"
|
||||||
#include "p2p/base/mock_async_resolver.h"
|
#include "p2p/base/mock_async_resolver.h"
|
||||||
#include "p2p/base/port_allocator.h"
|
#include "p2p/base/port_allocator.h"
|
||||||
|
@ -35,6 +33,7 @@
|
||||||
#include "pc/peer_connection_proxy.h"
|
#include "pc/peer_connection_proxy.h"
|
||||||
#include "pc/peer_connection_wrapper.h"
|
#include "pc/peer_connection_wrapper.h"
|
||||||
#include "pc/sdp_utils.h"
|
#include "pc/sdp_utils.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/mock_peer_connection_observers.h"
|
#include "pc/test/mock_peer_connection_observers.h"
|
||||||
#include "pc/usage_pattern.h"
|
#include "pc/usage_pattern.h"
|
||||||
#include "pc/webrtc_sdp.h"
|
#include "pc/webrtc_sdp.h"
|
||||||
|
@ -84,9 +83,7 @@ class PeerConnectionFactoryForUsageHistogramTest
|
||||||
dependencies.worker_thread = rtc::Thread::Current();
|
dependencies.worker_thread = rtc::Thread::Current();
|
||||||
dependencies.signaling_thread = rtc::Thread::Current();
|
dependencies.signaling_thread = rtc::Thread::Current();
|
||||||
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
dependencies.media_engine =
|
EnableFakeMedia(dependencies);
|
||||||
std::make_unique<cricket::FakeMediaEngine>();
|
|
||||||
dependencies.call_factory = CreateCallFactory();
|
|
||||||
return dependencies;
|
return dependencies;
|
||||||
}()) {}
|
}()) {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "api/audio/audio_mixer.h"
|
#include "api/audio/audio_mixer.h"
|
||||||
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||||
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/create_peerconnection_factory.h"
|
#include "api/create_peerconnection_factory.h"
|
||||||
#include "api/data_channel_interface.h"
|
#include "api/data_channel_interface.h"
|
||||||
#include "api/enable_media_with_defaults.h"
|
#include "api/enable_media_with_defaults.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/enable_media_with_defaults.h"
|
#include "api/enable_media_with_defaults.h"
|
||||||
#include "api/field_trials_view.h"
|
#include "api/field_trials_view.h"
|
||||||
#include "api/jsep.h"
|
#include "api/jsep.h"
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "absl/algorithm/container.h"
|
#include "absl/algorithm/container.h"
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/audio_options.h"
|
#include "api/audio_options.h"
|
||||||
#include "api/call/call_factory_interface.h"
|
|
||||||
#include "api/jsep.h"
|
#include "api/jsep.h"
|
||||||
#include "api/media_types.h"
|
#include "api/media_types.h"
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
|
@ -57,6 +56,7 @@
|
||||||
#include "pc/rtp_media_utils.h"
|
#include "pc/rtp_media_utils.h"
|
||||||
#include "pc/rtp_transceiver.h"
|
#include "pc/rtp_transceiver.h"
|
||||||
#include "pc/session_description.h"
|
#include "pc/session_description.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/mock_peer_connection_observers.h"
|
#include "pc/test/mock_peer_connection_observers.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/rtc_certificate_generator.h"
|
#include "rtc_base/rtc_certificate_generator.h"
|
||||||
|
@ -173,8 +173,7 @@ class PeerConnectionMediaBaseTest : public ::testing::Test {
|
||||||
factory_dependencies.worker_thread = rtc::Thread::Current();
|
factory_dependencies.worker_thread = rtc::Thread::Current();
|
||||||
factory_dependencies.signaling_thread = rtc::Thread::Current();
|
factory_dependencies.signaling_thread = rtc::Thread::Current();
|
||||||
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
|
||||||
factory_dependencies.media_engine = std::move(media_engine);
|
EnableFakeMedia(factory_dependencies, std::move(media_engine));
|
||||||
factory_dependencies.call_factory = CreateCallFactory();
|
|
||||||
factory_dependencies.event_log_factory =
|
factory_dependencies.event_log_factory =
|
||||||
std::make_unique<RtcEventLogFactory>(
|
std::make_unique<RtcEventLogFactory>(
|
||||||
factory_dependencies.task_queue_factory.get());
|
factory_dependencies.task_queue_factory.get());
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
#include "absl/types/optional.h"
|
#include "absl/types/optional.h"
|
||||||
#include "api/peer_connection_interface.h"
|
#include "api/peer_connection_interface.h"
|
||||||
#include "api/rtp_parameters.h"
|
#include "api/rtp_parameters.h"
|
||||||
#include "media/base/fake_media_engine.h"
|
|
||||||
#include "media/base/media_engine.h"
|
#include "media/base/media_engine.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/mock_channel_interface.h"
|
#include "pc/test/mock_channel_interface.h"
|
||||||
#include "pc/test/mock_rtp_receiver_internal.h"
|
#include "pc/test/mock_rtp_receiver_internal.h"
|
||||||
#include "pc/test/mock_rtp_sender_internal.h"
|
#include "pc/test/mock_rtp_sender_internal.h"
|
||||||
|
@ -60,7 +60,7 @@ class RtpTransceiverTest : public testing::Test {
|
||||||
d.network_thread = rtc::Thread::Current();
|
d.network_thread = rtc::Thread::Current();
|
||||||
d.worker_thread = rtc::Thread::Current();
|
d.worker_thread = rtc::Thread::Current();
|
||||||
d.signaling_thread = rtc::Thread::Current();
|
d.signaling_thread = rtc::Thread::Current();
|
||||||
d.media_engine = std::make_unique<cricket::FakeMediaEngine>();
|
EnableFakeMedia(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
61
pc/test/enable_fake_media.cc
Normal file
61
pc/test/enable_fake_media.cc
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2023 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#include "absl/base/nullability.h"
|
||||||
|
#include "api/peer_connection_interface.h"
|
||||||
|
#include "call/call.h"
|
||||||
|
#include "call/call_config.h"
|
||||||
|
#include "media/base/fake_media_engine.h"
|
||||||
|
#include "pc/media_factory.h"
|
||||||
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
using ::cricket::FakeMediaEngine;
|
||||||
|
using ::cricket::MediaEngineInterface;
|
||||||
|
|
||||||
|
void EnableFakeMedia(
|
||||||
|
PeerConnectionFactoryDependencies& deps,
|
||||||
|
absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake_media_engine) {
|
||||||
|
class FakeMediaFactory : public MediaFactory {
|
||||||
|
public:
|
||||||
|
explicit FakeMediaFactory(
|
||||||
|
absl::Nonnull<std::unique_ptr<FakeMediaEngine>> fake)
|
||||||
|
: fake_(std::move(fake)) {}
|
||||||
|
|
||||||
|
std::unique_ptr<Call> CreateCall(const CallConfig& config) override {
|
||||||
|
return Call::Create(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
|
||||||
|
PeerConnectionFactoryDependencies& /*dependencies*/) {
|
||||||
|
RTC_CHECK(fake_ != nullptr)
|
||||||
|
<< "CreateMediaEngine can be called at most once.";
|
||||||
|
return std::move(fake_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
absl::Nullable<std::unique_ptr<FakeMediaEngine>> fake_;
|
||||||
|
};
|
||||||
|
|
||||||
|
deps.media_factory =
|
||||||
|
std::make_unique<FakeMediaFactory>(std::move(fake_media_engine));
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnableFakeMedia(PeerConnectionFactoryDependencies& deps) {
|
||||||
|
EnableFakeMedia(deps, std::make_unique<cricket::FakeMediaEngine>());
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace webrtc
|
38
pc/test/enable_fake_media.h
Normal file
38
pc/test/enable_fake_media.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2023 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Enables fake media support for PeerConnnectionFactory created from `deps` for
|
||||||
|
// testing purposes. Such fake media support ignores media dependencies in the
|
||||||
|
// `PeerConnectionFactoryDependencies`. Allows to test PeerConnection and
|
||||||
|
// PeerConnectionFactory in the presence of the media, but doesn't test media
|
||||||
|
// support itself.
|
||||||
|
|
||||||
|
#ifndef PC_TEST_ENABLE_FAKE_MEDIA_H_
|
||||||
|
#define PC_TEST_ENABLE_FAKE_MEDIA_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include "absl/base/nullability.h"
|
||||||
|
#include "api/peer_connection_interface.h"
|
||||||
|
#include "media/base/fake_media_engine.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
// Enables media support backed by the 'fake_media_engine'.
|
||||||
|
void EnableFakeMedia(
|
||||||
|
PeerConnectionFactoryDependencies& deps,
|
||||||
|
absl::Nonnull<std::unique_ptr<cricket::FakeMediaEngine>> fake_media_engine);
|
||||||
|
|
||||||
|
// Enables media support backed by unspecified lightweight fake implementation.
|
||||||
|
void EnableFakeMedia(PeerConnectionFactoryDependencies& deps);
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
|
|
||||||
|
#endif // PC_TEST_ENABLE_FAKE_MEDIA_H_
|
|
@ -18,10 +18,10 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "media/base/fake_media_engine.h"
|
|
||||||
#include "media/base/media_channel.h"
|
#include "media/base/media_channel.h"
|
||||||
#include "pc/channel.h"
|
#include "pc/channel.h"
|
||||||
#include "pc/stream_collection.h"
|
#include "pc/stream_collection.h"
|
||||||
|
#include "pc/test/enable_fake_media.h"
|
||||||
#include "pc/test/fake_data_channel_controller.h"
|
#include "pc/test/fake_data_channel_controller.h"
|
||||||
#include "pc/test/fake_peer_connection_base.h"
|
#include "pc/test/fake_peer_connection_base.h"
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ class FakePeerConnectionForStats : public FakePeerConnectionBase {
|
||||||
dependencies.network_thread = rtc::Thread::Current();
|
dependencies.network_thread = rtc::Thread::Current();
|
||||||
dependencies.worker_thread = rtc::Thread::Current();
|
dependencies.worker_thread = rtc::Thread::Current();
|
||||||
dependencies.signaling_thread = rtc::Thread::Current();
|
dependencies.signaling_thread = rtc::Thread::Current();
|
||||||
dependencies.media_engine = std::make_unique<cricket::FakeMediaEngine>();
|
EnableFakeMedia(dependencies);
|
||||||
return dependencies;
|
return dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue