From 5c4ddad0591a61c3196555fc42e28aacbddbb5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Tue, 12 Feb 2019 12:30:58 +0100 Subject: [PATCH] Delete obsolete usage of FakeConstraints Bug: webrtc:9239 Change-Id: I16f3bdaab6f8eee9e2c5ebc0044dd6e86dac9562 Reviewed-on: https://webrtc-review.googlesource.com/c/122500 Reviewed-by: Harald Alvestrand Reviewed-by: Mirko Bonadei Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#26648} --- pc/peer_connection_end_to_end_unittest.cc | 11 ++++------- pc/rtc_stats_integrationtest.cc | 7 ++----- pc/test/peer_connection_test_wrapper.cc | 9 +++------ pc/test/peer_connection_test_wrapper.h | 7 ++----- tools_webrtc/sanitizers/lsan_suppressions_webrtc.cc | 1 - 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index b01a69b0a8..ae8366fc5f 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc @@ -39,7 +39,6 @@ using testing::Values; using testing::_; using webrtc::DataChannelInterface; -using webrtc::FakeConstraints; using webrtc::MediaStreamInterface; using webrtc::PeerConnectionInterface; using webrtc::SdpSemantics; @@ -100,16 +99,14 @@ class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>, void GetAndAddUserMedia() { cricket::AudioOptions audio_options; - FakeConstraints video_constraints; - GetAndAddUserMedia(true, audio_options, true, video_constraints); + GetAndAddUserMedia(true, audio_options, true); } void GetAndAddUserMedia(bool audio, const cricket::AudioOptions& audio_options, - bool video, - const FakeConstraints& video_constraints) { - caller_->GetAndAddUserMedia(audio, audio_options, video, video_constraints); - callee_->GetAndAddUserMedia(audio, audio_options, video, video_constraints); + bool video) { + caller_->GetAndAddUserMedia(audio, audio_options, video); + callee_->GetAndAddUserMedia(audio, audio_options, video); } void Negotiate() { diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index f0fc2f3bdf..7fddfffc07 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -31,7 +31,6 @@ #include "api/stats/rtc_stats.h" #include "api/stats/rtc_stats_report.h" #include "api/stats/rtcstats_objects.h" -#include "api/test/fake_constraints.h" #include "pc/rtc_stats_traversal.h" #include "pc/test/peer_connection_test_wrapper.h" #include "pc/test/rtc_stats_obtainer.h" @@ -133,10 +132,8 @@ class RTCStatsIntegrationTest : public testing::Test { PeerConnectionTestWrapper::Connect(caller_.get(), callee_.get()); // Get user media for audio and video - caller_->GetAndAddUserMedia(true, cricket::AudioOptions(), true, - FakeConstraints()); - callee_->GetAndAddUserMedia(true, cricket::AudioOptions(), true, - FakeConstraints()); + caller_->GetAndAddUserMedia(true, cricket::AudioOptions(), true); + callee_->GetAndAddUserMedia(true, cricket::AudioOptions(), true); // Create data channels DataChannelInit init; diff --git a/pc/test/peer_connection_test_wrapper.cc b/pc/test/peer_connection_test_wrapper.cc index e2015f84e8..d05022f469 100644 --- a/pc/test/peer_connection_test_wrapper.cc +++ b/pc/test/peer_connection_test_wrapper.cc @@ -39,7 +39,6 @@ #include "rtc_base/time_utils.h" #include "test/gtest.h" -using webrtc::FakeConstraints; using webrtc::FakeVideoTrackRenderer; using webrtc::IceCandidateInterface; using webrtc::MediaStreamInterface; @@ -277,10 +276,9 @@ bool PeerConnectionTestWrapper::CheckForVideo() { void PeerConnectionTestWrapper::GetAndAddUserMedia( bool audio, const cricket::AudioOptions& audio_options, - bool video, - const webrtc::FakeConstraints& video_constraints) { + bool video) { rtc::scoped_refptr stream = - GetUserMedia(audio, audio_options, video, video_constraints); + GetUserMedia(audio, audio_options, video); for (const auto& audio_track : stream->GetAudioTracks()) { EXPECT_TRUE(peer_connection_->AddTrack(audio_track, {stream->id()}).ok()); } @@ -293,8 +291,7 @@ rtc::scoped_refptr PeerConnectionTestWrapper::GetUserMedia( bool audio, const cricket::AudioOptions& audio_options, - bool video, - const webrtc::FakeConstraints& video_constraints) { + bool video) { std::string stream_id = kStreamIdBase + rtc::ToString(num_get_user_media_calls_++); rtc::scoped_refptr stream = diff --git a/pc/test/peer_connection_test_wrapper.h b/pc/test/peer_connection_test_wrapper.h index 67f56734ba..2dc88e9309 100644 --- a/pc/test/peer_connection_test_wrapper.h +++ b/pc/test/peer_connection_test_wrapper.h @@ -25,7 +25,6 @@ #include "api/rtc_error.h" #include "api/rtp_receiver_interface.h" #include "api/scoped_refptr.h" -#include "api/test/fake_constraints.h" #include "pc/test/fake_audio_capture_module.h" #include "pc/test/fake_video_track_renderer.h" #include "rtc_base/third_party/sigslot/sigslot.h" @@ -91,8 +90,7 @@ class PeerConnectionTestWrapper void WaitForVideo(); void GetAndAddUserMedia(bool audio, const cricket::AudioOptions& audio_options, - bool video, - const webrtc::FakeConstraints& video_constraints); + bool video); // sigslots sigslot::signal1 SignalOnIceCandidateCreated; @@ -111,8 +109,7 @@ class PeerConnectionTestWrapper rtc::scoped_refptr GetUserMedia( bool audio, const cricket::AudioOptions& audio_options, - bool video, - const webrtc::FakeConstraints& video_constraints); + bool video); std::string name_; rtc::Thread* const network_thread_; diff --git a/tools_webrtc/sanitizers/lsan_suppressions_webrtc.cc b/tools_webrtc/sanitizers/lsan_suppressions_webrtc.cc index a195386887..064b2804ab 100644 --- a/tools_webrtc/sanitizers/lsan_suppressions_webrtc.cc +++ b/tools_webrtc/sanitizers/lsan_suppressions_webrtc.cc @@ -82,7 +82,6 @@ char kLSanDefaultSuppressions[] = "leak:webrtc::AudioDeviceLinuxALSA::InitMicrophone\n" "leak:webrtc::AudioDeviceLinuxALSA::InitSpeaker\n" "leak:webrtc::CreateIceCandidate\n" - "leak:webrtc::FakeConstraints::AddOptional\n" "leak:webrtc::WebRtcIdentityRequestObserver::OnSuccess\n" "leak:webrtc::WebRtcSessionDescriptionFactory::InternalCreateAnswer\n" "leak:webrtc::WebRtcSessionDescriptionFactory::InternalCreateOffer\n"