Commit 59a7b9c9 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Move FakeRtcRtp{Sender,Receiver,Transceiver} to Blink

These testing classes are needed for
peer_connection_tracker_unittest.cc, that will be Onion soup'ed
next, together with various other classes and tests.

For simplicity, this particular pair of files are moved independently,
so the core CL is easier to review.

Note that the classes got renamed to FakeRtcRtp{XXX}Impl, to mirror
their respective non-fake classes, moved to Blink in [1], [2] and [3].

[1] https://crrev.com/c/1819801
[2] https://crrev.com/c/1819811
[3] https://crrev.com/c/1820060

BUG=787254
R=guidou@chromium.org, haraken@chromium.org

Change-Id: I3b8de656d96ef4148f6a08afb23080803a52255f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1835799
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705095}
parent a6aa2f14
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "content/common/media/peer_connection_tracker.mojom.h" #include "content/common/media/peer_connection_tracker.mojom.h"
#include "content/common/media/peer_connection_tracker_messages.h" #include "content/common/media/peer_connection_tracker_messages.h"
#include "content/public/test/mock_render_thread.h" #include "content/public/test/mock_render_thread.h"
#include "content/renderer/media/webrtc/fake_rtc_rtp_transceiver.h"
#include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h" #include "content/renderer/media/webrtc/mock_web_rtc_peer_connection_handler_client.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h" #include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include "third_party/blink/public/platform/web_rtc_rtp_receiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_receiver.h"
#include "third_party/blink/public/platform/web_rtc_rtp_sender.h" #include "third_party/blink/public/platform/web_rtc_rtp_sender.h"
#include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h"
#include "third_party/blink/public/web/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h"
#include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h" #include "third_party/blink/public/web/modules/peerconnection/mock_peer_connection_dependency_factory.h"
using ::testing::_; using ::testing::_;
...@@ -91,15 +91,15 @@ class MockPeerConnectionTrackerHost : public mojom::PeerConnectionTrackerHost { ...@@ -91,15 +91,15 @@ class MockPeerConnectionTrackerHost : public mojom::PeerConnectionTrackerHost {
std::unique_ptr<blink::WebRTCRtpTransceiver> CreateDefaultTransceiver( std::unique_ptr<blink::WebRTCRtpTransceiver> CreateDefaultTransceiver(
blink::WebRTCRtpTransceiverImplementationType implementation_type) { blink::WebRTCRtpTransceiverImplementationType implementation_type) {
std::unique_ptr<blink::WebRTCRtpTransceiver> transceiver; std::unique_ptr<blink::WebRTCRtpTransceiver> transceiver;
FakeRTCRtpSender sender( blink::FakeRTCRtpSenderImpl sender(
"senderTrackId", {"senderStreamId"}, "senderTrackId", {"senderStreamId"},
blink::scheduler::GetSingleThreadTaskRunnerForTesting()); blink::scheduler::GetSingleThreadTaskRunnerForTesting());
FakeRTCRtpReceiver receiver( blink::FakeRTCRtpReceiverImpl receiver(
"receiverTrackId", {"receiverStreamId"}, "receiverTrackId", {"receiverStreamId"},
blink::scheduler::GetSingleThreadTaskRunnerForTesting()); blink::scheduler::GetSingleThreadTaskRunnerForTesting());
if (implementation_type == if (implementation_type ==
blink::WebRTCRtpTransceiverImplementationType::kFullTransceiver) { blink::WebRTCRtpTransceiverImplementationType::kFullTransceiver) {
transceiver = std::make_unique<FakeRTCRtpTransceiver>( transceiver = std::make_unique<blink::FakeRTCRtpTransceiverImpl>(
base::nullopt, std::move(sender), std::move(receiver), base::nullopt, std::move(sender), std::move(receiver),
false /* stopped */, false /* stopped */,
webrtc::RtpTransceiverDirection::kSendOnly /* direction */, webrtc::RtpTransceiverDirection::kSendOnly /* direction */,
...@@ -107,13 +107,13 @@ std::unique_ptr<blink::WebRTCRtpTransceiver> CreateDefaultTransceiver( ...@@ -107,13 +107,13 @@ std::unique_ptr<blink::WebRTCRtpTransceiver> CreateDefaultTransceiver(
} else if (implementation_type == } else if (implementation_type ==
blink::WebRTCRtpTransceiverImplementationType::kPlanBSenderOnly) { blink::WebRTCRtpTransceiverImplementationType::kPlanBSenderOnly) {
transceiver = std::make_unique<blink::RTCRtpSenderOnlyTransceiver>( transceiver = std::make_unique<blink::RTCRtpSenderOnlyTransceiver>(
std::make_unique<FakeRTCRtpSender>(sender)); std::make_unique<blink::FakeRTCRtpSenderImpl>(sender));
} else { } else {
DCHECK_EQ( DCHECK_EQ(
implementation_type, implementation_type,
blink::WebRTCRtpTransceiverImplementationType::kPlanBReceiverOnly); blink::WebRTCRtpTransceiverImplementationType::kPlanBReceiverOnly);
transceiver = std::make_unique<blink::RTCRtpReceiverOnlyTransceiver>( transceiver = std::make_unique<blink::RTCRtpReceiverOnlyTransceiver>(
std::make_unique<FakeRTCRtpReceiver>(receiver)); std::make_unique<blink::FakeRTCRtpReceiverImpl>(receiver));
} }
return transceiver; return transceiver;
} }
...@@ -194,11 +194,12 @@ TEST_F(PeerConnectionTrackerTest, OnSuspend) { ...@@ -194,11 +194,12 @@ TEST_F(PeerConnectionTrackerTest, OnSuspend) {
TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesPresent) { TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesPresent) {
CreateTrackerWithMocks(); CreateTrackerWithMocks();
CreateAndRegisterPeerConnectionHandler(); CreateAndRegisterPeerConnectionHandler();
FakeRTCRtpTransceiver transceiver( blink::FakeRTCRtpTransceiverImpl transceiver(
"midValue", "midValue",
FakeRTCRtpSender("senderTrackId", {"streamIdA", "streamIdB"}, blink::FakeRTCRtpSenderImpl(
blink::scheduler::GetSingleThreadTaskRunnerForTesting()), "senderTrackId", {"streamIdA", "streamIdB"},
FakeRTCRtpReceiver( blink::scheduler::GetSingleThreadTaskRunnerForTesting()),
blink::FakeRTCRtpReceiverImpl(
"receiverTrackId", {"streamIdC"}, "receiverTrackId", {"streamIdC"},
blink::scheduler::GetSingleThreadTaskRunnerForTesting()), blink::scheduler::GetSingleThreadTaskRunnerForTesting()),
true /* stopped */, true /* stopped */,
...@@ -235,11 +236,12 @@ TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesPresent) { ...@@ -235,11 +236,12 @@ TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesPresent) {
TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesNull) { TEST_F(PeerConnectionTrackerTest, AddTransceiverWithOptionalValuesNull) {
CreateTrackerWithMocks(); CreateTrackerWithMocks();
CreateAndRegisterPeerConnectionHandler(); CreateAndRegisterPeerConnectionHandler();
FakeRTCRtpTransceiver transceiver( blink::FakeRTCRtpTransceiverImpl transceiver(
base::nullopt, base::nullopt,
FakeRTCRtpSender(base::nullopt, {}, blink::FakeRTCRtpSenderImpl(
blink::scheduler::GetSingleThreadTaskRunnerForTesting()), base::nullopt, {},
FakeRTCRtpReceiver( blink::scheduler::GetSingleThreadTaskRunnerForTesting()),
blink::FakeRTCRtpReceiverImpl(
"receiverTrackId", {}, "receiverTrackId", {},
blink::scheduler::GetSingleThreadTaskRunnerForTesting()), blink::scheduler::GetSingleThreadTaskRunnerForTesting()),
false /* stopped */, false /* stopped */,
......
...@@ -1938,8 +1938,6 @@ test("content_unittests") { ...@@ -1938,8 +1938,6 @@ test("content_unittests") {
"../renderer/media/batching_media_log_unittest.cc", "../renderer/media/batching_media_log_unittest.cc",
"../renderer/media/inspector_media_event_handler_unittest.cc", "../renderer/media/inspector_media_event_handler_unittest.cc",
"../renderer/media/renderer_webaudiodevice_impl_unittest.cc", "../renderer/media/renderer_webaudiodevice_impl_unittest.cc",
"../renderer/media/webrtc/fake_rtc_rtp_transceiver.cc",
"../renderer/media/webrtc/fake_rtc_rtp_transceiver.h",
"../renderer/media/webrtc/media_stream_track_metrics_unittest.cc", "../renderer/media/webrtc/media_stream_track_metrics_unittest.cc",
"../renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc", "../renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc",
"../renderer/media/webrtc/peer_connection_tracker_unittest.cc", "../renderer/media/webrtc/peer_connection_tracker_unittest.cc",
......
...@@ -108,6 +108,7 @@ source_set("test_headers") { ...@@ -108,6 +108,7 @@ source_set("test_headers") {
# TODO(crbug.com/787254): Remove the group of mock_.h files # TODO(crbug.com/787254): Remove the group of mock_.h files
# below when content/renderer/media/webrtc Onion souping is # below when content/renderer/media/webrtc Onion souping is
# done. # done.
"web/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h",
"web/modules/peerconnection/mock_data_channel_impl.h", "web/modules/peerconnection/mock_data_channel_impl.h",
"web/modules/peerconnection/mock_peer_connection_dependency_factory.h", "web/modules/peerconnection/mock_peer_connection_dependency_factory.h",
"web/modules/peerconnection/mock_peer_connection_impl.h", "web/modules/peerconnection/mock_peer_connection_impl.h",
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_FAKE_RTC_RTP_TRANSCEIVER_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_FAKE_RTC_RTP_TRANSCEIVER_IMPL_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_FAKE_RTC_RTP_TRANSCEIVER_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_FAKE_RTC_RTP_TRANSCEIVER_IMPL_H_
#include <memory> #include <memory>
#include <string> #include <string>
...@@ -19,22 +19,22 @@ ...@@ -19,22 +19,22 @@
#include "third_party/blink/public/platform/web_rtc_rtp_source.h" #include "third_party/blink/public/platform/web_rtc_rtp_source.h"
#include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h" #include "third_party/blink/public/platform/web_rtc_rtp_transceiver.h"
namespace content { namespace blink {
// TODO(https://crbug.com/868868): Similar methods to this exist in many content // TODO(https://crbug.com/868868): Similar methods to this exist in many blink
// unittests. Move to a separate file and reuse it in all of them. // unittests. Move to a separate file and reuse it in all of them.
blink::WebMediaStreamTrack CreateWebMediaStreamTrack( blink::WebMediaStreamTrack CreateWebMediaStreamTrack(
const std::string& id, const std::string& id,
scoped_refptr<base::SingleThreadTaskRunner> task_runner); scoped_refptr<base::SingleThreadTaskRunner> task_runner);
class FakeRTCRtpSender : public blink::WebRTCRtpSender { class FakeRTCRtpSenderImpl : public blink::WebRTCRtpSender {
public: public:
FakeRTCRtpSender(base::Optional<std::string> track_id, FakeRTCRtpSenderImpl(base::Optional<std::string> track_id,
std::vector<std::string> stream_ids, std::vector<std::string> stream_ids,
scoped_refptr<base::SingleThreadTaskRunner> task_runner); scoped_refptr<base::SingleThreadTaskRunner> task_runner);
FakeRTCRtpSender(const FakeRTCRtpSender&); FakeRTCRtpSenderImpl(const FakeRTCRtpSenderImpl&);
~FakeRTCRtpSender() override; ~FakeRTCRtpSenderImpl() override;
FakeRTCRtpSender& operator=(const FakeRTCRtpSender&); FakeRTCRtpSenderImpl& operator=(const FakeRTCRtpSenderImpl&);
std::unique_ptr<blink::WebRTCRtpSender> ShallowCopy() const override; std::unique_ptr<blink::WebRTCRtpSender> ShallowCopy() const override;
uintptr_t Id() const override; uintptr_t Id() const override;
...@@ -61,14 +61,15 @@ class FakeRTCRtpSender : public blink::WebRTCRtpSender { ...@@ -61,14 +61,15 @@ class FakeRTCRtpSender : public blink::WebRTCRtpSender {
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
}; };
class FakeRTCRtpReceiver : public blink::WebRTCRtpReceiver { class FakeRTCRtpReceiverImpl : public blink::WebRTCRtpReceiver {
public: public:
FakeRTCRtpReceiver(const std::string& track_id, FakeRTCRtpReceiverImpl(
std::vector<std::string> stream_ids, const std::string& track_id,
scoped_refptr<base::SingleThreadTaskRunner> task_runner); std::vector<std::string> stream_ids,
FakeRTCRtpReceiver(const FakeRTCRtpReceiver&); scoped_refptr<base::SingleThreadTaskRunner> task_runner);
~FakeRTCRtpReceiver() override; FakeRTCRtpReceiverImpl(const FakeRTCRtpReceiverImpl&);
FakeRTCRtpReceiver& operator=(const FakeRTCRtpReceiver&); ~FakeRTCRtpReceiverImpl() override;
FakeRTCRtpReceiverImpl& operator=(const FakeRTCRtpReceiverImpl&);
std::unique_ptr<blink::WebRTCRtpReceiver> ShallowCopy() const override; std::unique_ptr<blink::WebRTCRtpReceiver> ShallowCopy() const override;
uintptr_t Id() const override; uintptr_t Id() const override;
...@@ -89,16 +90,16 @@ class FakeRTCRtpReceiver : public blink::WebRTCRtpReceiver { ...@@ -89,16 +90,16 @@ class FakeRTCRtpReceiver : public blink::WebRTCRtpReceiver {
std::vector<std::string> stream_ids_; std::vector<std::string> stream_ids_;
}; };
class FakeRTCRtpTransceiver : public blink::WebRTCRtpTransceiver { class FakeRTCRtpTransceiverImpl : public blink::WebRTCRtpTransceiver {
public: public:
FakeRTCRtpTransceiver( FakeRTCRtpTransceiverImpl(
base::Optional<std::string> mid, base::Optional<std::string> mid,
FakeRTCRtpSender sender, FakeRTCRtpSenderImpl sender,
FakeRTCRtpReceiver receiver, FakeRTCRtpReceiverImpl receiver,
bool stopped, bool stopped,
webrtc::RtpTransceiverDirection direction, webrtc::RtpTransceiverDirection direction,
base::Optional<webrtc::RtpTransceiverDirection> current_direction); base::Optional<webrtc::RtpTransceiverDirection> current_direction);
~FakeRTCRtpTransceiver() override; ~FakeRTCRtpTransceiverImpl() override;
blink::WebRTCRtpTransceiverImplementationType ImplementationType() blink::WebRTCRtpTransceiverImplementationType ImplementationType()
const override; const override;
...@@ -116,13 +117,13 @@ class FakeRTCRtpTransceiver : public blink::WebRTCRtpTransceiver { ...@@ -116,13 +117,13 @@ class FakeRTCRtpTransceiver : public blink::WebRTCRtpTransceiver {
private: private:
base::Optional<std::string> mid_; base::Optional<std::string> mid_;
FakeRTCRtpSender sender_; FakeRTCRtpSenderImpl sender_;
FakeRTCRtpReceiver receiver_; FakeRTCRtpReceiverImpl receiver_;
bool stopped_; bool stopped_;
webrtc::RtpTransceiverDirection direction_; webrtc::RtpTransceiverDirection direction_;
base::Optional<webrtc::RtpTransceiverDirection> current_direction_; base::Optional<webrtc::RtpTransceiverDirection> current_direction_;
}; };
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_FAKE_RTC_RTP_TRANSCEIVER_H_ #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_PEERCONNECTION_FAKE_RTC_RTP_TRANSCEIVER_IMPL_H_
...@@ -145,6 +145,7 @@ jumbo_source_set("test_support") { ...@@ -145,6 +145,7 @@ jumbo_source_set("test_support") {
testonly = true testonly = true
sources = [ sources = [
"fake_rtc_rtp_transceiver_impl.cc",
"mock_data_channel_impl.cc", "mock_data_channel_impl.cc",
"mock_peer_connection_dependency_factory.cc", "mock_peer_connection_dependency_factory.cc",
"mock_peer_connection_impl.cc", "mock_peer_connection_impl.cc",
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
#include <utility> #include <utility>
#include "content/renderer/media/webrtc/fake_rtc_rtp_transceiver.h" #include "third_party/blink/public/web/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h"
#include "third_party/blink/public/platform/modules/peerconnection/webrtc_util.h"
namespace content { namespace blink {
blink::WebMediaStreamTrack CreateWebMediaStreamTrack( blink::WebMediaStreamTrack CreateWebMediaStreamTrack(
const std::string& id, const std::string& id,
...@@ -29,7 +28,7 @@ blink::WebMediaStreamTrack CreateWebMediaStreamTrack( ...@@ -29,7 +28,7 @@ blink::WebMediaStreamTrack CreateWebMediaStreamTrack(
return web_track; return web_track;
} }
FakeRTCRtpSender::FakeRTCRtpSender( FakeRTCRtpSenderImpl::FakeRTCRtpSenderImpl(
base::Optional<std::string> track_id, base::Optional<std::string> track_id,
std::vector<std::string> stream_ids, std::vector<std::string> stream_ids,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) scoped_refptr<base::SingleThreadTaskRunner> task_runner)
...@@ -37,41 +36,44 @@ FakeRTCRtpSender::FakeRTCRtpSender( ...@@ -37,41 +36,44 @@ FakeRTCRtpSender::FakeRTCRtpSender(
stream_ids_(std::move(stream_ids)), stream_ids_(std::move(stream_ids)),
task_runner_(task_runner) {} task_runner_(task_runner) {}
FakeRTCRtpSender::FakeRTCRtpSender(const FakeRTCRtpSender&) = default; FakeRTCRtpSenderImpl::FakeRTCRtpSenderImpl(const FakeRTCRtpSenderImpl&) =
default;
FakeRTCRtpSender::~FakeRTCRtpSender() {} FakeRTCRtpSenderImpl::~FakeRTCRtpSenderImpl() {}
FakeRTCRtpSender& FakeRTCRtpSender::operator=(const FakeRTCRtpSender&) = FakeRTCRtpSenderImpl& FakeRTCRtpSenderImpl::operator=(
default; const FakeRTCRtpSenderImpl&) = default;
std::unique_ptr<blink::WebRTCRtpSender> FakeRTCRtpSender::ShallowCopy() const { std::unique_ptr<blink::WebRTCRtpSender> FakeRTCRtpSenderImpl::ShallowCopy()
return std::make_unique<FakeRTCRtpSender>(*this); const {
return std::make_unique<FakeRTCRtpSenderImpl>(*this);
} }
uintptr_t FakeRTCRtpSender::Id() const { uintptr_t FakeRTCRtpSenderImpl::Id() const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return 0; return 0;
} }
rtc::scoped_refptr<webrtc::DtlsTransportInterface> rtc::scoped_refptr<webrtc::DtlsTransportInterface>
FakeRTCRtpSender::DtlsTransport() { FakeRTCRtpSenderImpl::DtlsTransport() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
webrtc::DtlsTransportInformation FakeRTCRtpSender::DtlsTransportInformation() { webrtc::DtlsTransportInformation
FakeRTCRtpSenderImpl::DtlsTransportInformation() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
static webrtc::DtlsTransportInformation dummy( static webrtc::DtlsTransportInformation dummy(
webrtc::DtlsTransportState::kNew); webrtc::DtlsTransportState::kNew);
return dummy; return dummy;
} }
blink::WebMediaStreamTrack FakeRTCRtpSender::Track() const { blink::WebMediaStreamTrack FakeRTCRtpSenderImpl::Track() const {
return track_id_ ? CreateWebMediaStreamTrack(*track_id_, task_runner_) return track_id_ ? CreateWebMediaStreamTrack(*track_id_, task_runner_)
: blink::WebMediaStreamTrack(); // null : blink::WebMediaStreamTrack(); // null
} }
blink::WebVector<blink::WebString> FakeRTCRtpSender::StreamIds() const { blink::WebVector<blink::WebString> FakeRTCRtpSenderImpl::StreamIds() const {
blink::WebVector<blink::WebString> web_stream_ids(stream_ids_.size()); blink::WebVector<blink::WebString> web_stream_ids(stream_ids_.size());
for (size_t i = 0; i < stream_ids_.size(); ++i) { for (size_t i = 0; i < stream_ids_.size(); ++i) {
web_stream_ids[i] = blink::WebString::FromUTF8(stream_ids_[i]); web_stream_ids[i] = blink::WebString::FromUTF8(stream_ids_[i]);
...@@ -79,83 +81,85 @@ blink::WebVector<blink::WebString> FakeRTCRtpSender::StreamIds() const { ...@@ -79,83 +81,85 @@ blink::WebVector<blink::WebString> FakeRTCRtpSender::StreamIds() const {
return web_stream_ids; return web_stream_ids;
} }
void FakeRTCRtpSender::ReplaceTrack(blink::WebMediaStreamTrack with_track, void FakeRTCRtpSenderImpl::ReplaceTrack(blink::WebMediaStreamTrack with_track,
blink::WebRTCVoidRequest request) { blink::WebRTCVoidRequest request) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
std::unique_ptr<blink::WebRTCDTMFSenderHandler> std::unique_ptr<blink::WebRTCDTMFSenderHandler>
FakeRTCRtpSender::GetDtmfSender() const { FakeRTCRtpSenderImpl::GetDtmfSender() const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
std::unique_ptr<webrtc::RtpParameters> FakeRTCRtpSender::GetParameters() const { std::unique_ptr<webrtc::RtpParameters> FakeRTCRtpSenderImpl::GetParameters()
const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
void FakeRTCRtpSender::SetParameters( void FakeRTCRtpSenderImpl::SetParameters(
blink::WebVector<webrtc::RtpEncodingParameters>, blink::WebVector<webrtc::RtpEncodingParameters>,
webrtc::DegradationPreference, webrtc::DegradationPreference,
blink::WebRTCVoidRequest) { blink::WebRTCVoidRequest) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void FakeRTCRtpSender::GetStats( void FakeRTCRtpSenderImpl::GetStats(
blink::WebRTCStatsReportCallback, blink::WebRTCStatsReportCallback,
const blink::WebVector<webrtc::NonStandardGroupId>&) { const blink::WebVector<webrtc::NonStandardGroupId>&) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
void FakeRTCRtpSender::SetStreams( void FakeRTCRtpSenderImpl::SetStreams(
const blink::WebVector<blink::WebString>& stream_ids) { const blink::WebVector<blink::WebString>& stream_ids) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
FakeRTCRtpReceiver::FakeRTCRtpReceiver( FakeRTCRtpReceiverImpl::FakeRTCRtpReceiverImpl(
const std::string& track_id, const std::string& track_id,
std::vector<std::string> stream_ids, std::vector<std::string> stream_ids,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: track_(CreateWebMediaStreamTrack(track_id, task_runner)), : track_(CreateWebMediaStreamTrack(track_id, task_runner)),
stream_ids_(std::move(stream_ids)) {} stream_ids_(std::move(stream_ids)) {}
FakeRTCRtpReceiver::FakeRTCRtpReceiver(const FakeRTCRtpReceiver&) = default; FakeRTCRtpReceiverImpl::FakeRTCRtpReceiverImpl(const FakeRTCRtpReceiverImpl&) =
default;
FakeRTCRtpReceiver::~FakeRTCRtpReceiver() {} FakeRTCRtpReceiverImpl::~FakeRTCRtpReceiverImpl() {}
FakeRTCRtpReceiver& FakeRTCRtpReceiver::operator=(const FakeRTCRtpReceiver&) = FakeRTCRtpReceiverImpl& FakeRTCRtpReceiverImpl::operator=(
default; const FakeRTCRtpReceiverImpl&) = default;
std::unique_ptr<blink::WebRTCRtpReceiver> FakeRTCRtpReceiver::ShallowCopy() std::unique_ptr<blink::WebRTCRtpReceiver> FakeRTCRtpReceiverImpl::ShallowCopy()
const { const {
return std::make_unique<FakeRTCRtpReceiver>(*this); return std::make_unique<FakeRTCRtpReceiverImpl>(*this);
} }
uintptr_t FakeRTCRtpReceiver::Id() const { uintptr_t FakeRTCRtpReceiverImpl::Id() const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return 0; return 0;
} }
rtc::scoped_refptr<webrtc::DtlsTransportInterface> rtc::scoped_refptr<webrtc::DtlsTransportInterface>
FakeRTCRtpReceiver::DtlsTransport() { FakeRTCRtpReceiverImpl::DtlsTransport() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
webrtc::DtlsTransportInformation webrtc::DtlsTransportInformation
FakeRTCRtpReceiver::DtlsTransportInformation() { FakeRTCRtpReceiverImpl::DtlsTransportInformation() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
static webrtc::DtlsTransportInformation dummy( static webrtc::DtlsTransportInformation dummy(
webrtc::DtlsTransportState::kNew); webrtc::DtlsTransportState::kNew);
return dummy; return dummy;
} }
const blink::WebMediaStreamTrack& FakeRTCRtpReceiver::Track() const { const blink::WebMediaStreamTrack& FakeRTCRtpReceiverImpl::Track() const {
return track_; return track_;
} }
blink::WebVector<blink::WebString> FakeRTCRtpReceiver::StreamIds() const { blink::WebVector<blink::WebString> FakeRTCRtpReceiverImpl::StreamIds() const {
blink::WebVector<blink::WebString> web_stream_ids(stream_ids_.size()); blink::WebVector<blink::WebString> web_stream_ids(stream_ids_.size());
for (size_t i = 0; i < stream_ids_.size(); ++i) { for (size_t i = 0; i < stream_ids_.size(); ++i) {
web_stream_ids[i] = blink::WebString::FromUTF8(stream_ids_[i]); web_stream_ids[i] = blink::WebString::FromUTF8(stream_ids_[i]);
...@@ -164,32 +168,32 @@ blink::WebVector<blink::WebString> FakeRTCRtpReceiver::StreamIds() const { ...@@ -164,32 +168,32 @@ blink::WebVector<blink::WebString> FakeRTCRtpReceiver::StreamIds() const {
} }
blink::WebVector<std::unique_ptr<blink::WebRTCRtpSource>> blink::WebVector<std::unique_ptr<blink::WebRTCRtpSource>>
FakeRTCRtpReceiver::GetSources() { FakeRTCRtpReceiverImpl::GetSources() {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return {}; return {};
} }
void FakeRTCRtpReceiver::GetStats( void FakeRTCRtpReceiverImpl::GetStats(
blink::WebRTCStatsReportCallback, blink::WebRTCStatsReportCallback,
const blink::WebVector<webrtc::NonStandardGroupId>&) { const blink::WebVector<webrtc::NonStandardGroupId>&) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
std::unique_ptr<webrtc::RtpParameters> FakeRTCRtpReceiver::GetParameters() std::unique_ptr<webrtc::RtpParameters> FakeRTCRtpReceiverImpl::GetParameters()
const { const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return nullptr; return nullptr;
} }
void FakeRTCRtpReceiver::SetJitterBufferMinimumDelay( void FakeRTCRtpReceiverImpl::SetJitterBufferMinimumDelay(
base::Optional<double> delay_seconds) { base::Optional<double> delay_seconds) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
FakeRTCRtpTransceiver::FakeRTCRtpTransceiver( FakeRTCRtpTransceiverImpl::FakeRTCRtpTransceiverImpl(
base::Optional<std::string> mid, base::Optional<std::string> mid,
FakeRTCRtpSender sender, FakeRTCRtpSenderImpl sender,
FakeRTCRtpReceiver receiver, FakeRTCRtpReceiverImpl receiver,
bool stopped, bool stopped,
webrtc::RtpTransceiverDirection direction, webrtc::RtpTransceiverDirection direction,
base::Optional<webrtc::RtpTransceiverDirection> current_direction) base::Optional<webrtc::RtpTransceiverDirection> current_direction)
...@@ -200,53 +204,54 @@ FakeRTCRtpTransceiver::FakeRTCRtpTransceiver( ...@@ -200,53 +204,54 @@ FakeRTCRtpTransceiver::FakeRTCRtpTransceiver(
direction_(std::move(direction)), direction_(std::move(direction)),
current_direction_(std::move(current_direction)) {} current_direction_(std::move(current_direction)) {}
FakeRTCRtpTransceiver::~FakeRTCRtpTransceiver() {} FakeRTCRtpTransceiverImpl::~FakeRTCRtpTransceiverImpl() {}
blink::WebRTCRtpTransceiverImplementationType blink::WebRTCRtpTransceiverImplementationType
FakeRTCRtpTransceiver::ImplementationType() const { FakeRTCRtpTransceiverImpl::ImplementationType() const {
return blink::WebRTCRtpTransceiverImplementationType::kFullTransceiver; return blink::WebRTCRtpTransceiverImplementationType::kFullTransceiver;
} }
uintptr_t FakeRTCRtpTransceiver::Id() const { uintptr_t FakeRTCRtpTransceiverImpl::Id() const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return 0u; return 0u;
} }
blink::WebString FakeRTCRtpTransceiver::Mid() const { blink::WebString FakeRTCRtpTransceiverImpl::Mid() const {
return mid_ ? blink::WebString::FromUTF8(*mid_) : blink::WebString(); return mid_ ? blink::WebString::FromUTF8(*mid_) : blink::WebString();
} }
std::unique_ptr<blink::WebRTCRtpSender> FakeRTCRtpTransceiver::Sender() const { std::unique_ptr<blink::WebRTCRtpSender> FakeRTCRtpTransceiverImpl::Sender()
const {
return sender_.ShallowCopy(); return sender_.ShallowCopy();
} }
std::unique_ptr<blink::WebRTCRtpReceiver> FakeRTCRtpTransceiver::Receiver() std::unique_ptr<blink::WebRTCRtpReceiver> FakeRTCRtpTransceiverImpl::Receiver()
const { const {
return receiver_.ShallowCopy(); return receiver_.ShallowCopy();
} }
bool FakeRTCRtpTransceiver::Stopped() const { bool FakeRTCRtpTransceiverImpl::Stopped() const {
return stopped_; return stopped_;
} }
webrtc::RtpTransceiverDirection FakeRTCRtpTransceiver::Direction() const { webrtc::RtpTransceiverDirection FakeRTCRtpTransceiverImpl::Direction() const {
return direction_; return direction_;
} }
void FakeRTCRtpTransceiver::SetDirection( void FakeRTCRtpTransceiverImpl::SetDirection(
webrtc::RtpTransceiverDirection direction) { webrtc::RtpTransceiverDirection direction) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
base::Optional<webrtc::RtpTransceiverDirection> base::Optional<webrtc::RtpTransceiverDirection>
FakeRTCRtpTransceiver::CurrentDirection() const { FakeRTCRtpTransceiverImpl::CurrentDirection() const {
return current_direction_; return current_direction_;
} }
base::Optional<webrtc::RtpTransceiverDirection> base::Optional<webrtc::RtpTransceiverDirection>
FakeRTCRtpTransceiver::FiredDirection() const { FakeRTCRtpTransceiverImpl::FiredDirection() const {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return base::nullopt; return base::nullopt;
} }
} // namespace content } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment