Using fully qualified names for using declarations.

Using declarations should use fully qualified names (with leading `::`)
unless they are referring to a name inside the current namespace.
Source: https://abseil.io/tips/119.

This CL removes a lot of "using webrtc::*" adding a namespace to the
tests. It also removes some unneeded "using" declarations.

Bug: webrtc:9855
Change-Id: Id6eb843e9dcee2e458b1ffd0c499df390fa9c45d
Reviewed-on: https://webrtc-review.googlesource.com/c/114001
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25987}
This commit is contained in:
Mirko Bonadei
2018-12-12 12:10:18 +01:00
committed by Commit Bot
parent 17d57c7c13
commit ab64e8a7ea
2 changed files with 16 additions and 82 deletions

View File

@ -68,55 +68,20 @@
#include "system_wrappers/include/metrics.h" #include "system_wrappers/include/metrics.h"
#include "test/gmock.h" #include "test/gmock.h"
using cricket::ContentInfo; namespace webrtc {
using cricket::FakeWebRtcVideoDecoder; namespace {
using cricket::FakeWebRtcVideoDecoderFactory;
using cricket::FakeWebRtcVideoEncoder; using ::cricket::ContentInfo;
using cricket::FakeWebRtcVideoEncoderFactory; using ::cricket::StreamParams;
using cricket::MediaContentDescription; using ::rtc::SocketAddress;
using cricket::StreamParams; using ::testing::_;
using rtc::SocketAddress;
using ::testing::Combine; using ::testing::Combine;
using ::testing::ElementsAre; using ::testing::ElementsAre;
using ::testing::UnorderedElementsAreArray;
using ::testing::Return; using ::testing::Return;
using ::testing::SetArgPointee; using ::testing::SetArgPointee;
using ::testing::Values;
using ::testing::UnorderedElementsAreArray; using ::testing::UnorderedElementsAreArray;
using ::testing::_; using ::testing::Values;
using webrtc::DataBuffer;
using webrtc::DataChannelInterface;
using webrtc::DtmfSender;
using webrtc::DtmfSenderInterface;
using webrtc::DtmfSenderObserverInterface;
using webrtc::FakeVideoTrackRenderer;
using webrtc::MediaStreamInterface;
using webrtc::MediaStreamTrackInterface;
using webrtc::MockCreateSessionDescriptionObserver;
using webrtc::MockDataChannelObserver;
using webrtc::MockSetSessionDescriptionObserver;
using webrtc::MockStatsObserver;
using webrtc::ObserverInterface;
using webrtc::PeerConnection;
using webrtc::PeerConnectionInterface;
using RTCConfiguration = PeerConnectionInterface::RTCConfiguration; using RTCConfiguration = PeerConnectionInterface::RTCConfiguration;
using webrtc::PeerConnectionFactory;
using webrtc::PeerConnectionProxy;
using webrtc::RTCErrorType;
using webrtc::RTCTransportStats;
using webrtc::RtpSenderInterface;
using webrtc::RtpReceiverInterface;
using webrtc::RtpSenderInterface;
using webrtc::RtpTransceiverDirection;
using webrtc::RtpTransceiverInit;
using webrtc::RtpTransceiverInterface;
using webrtc::SdpSemantics;
using webrtc::SdpType;
using webrtc::SessionDescriptionInterface;
using webrtc::StreamCollectionInterface;
using webrtc::VideoTrackInterface;
namespace {
static const int kDefaultTimeout = 10000; static const int kDefaultTimeout = 10000;
static const int kMaxWaitForStatsMs = 3000; static const int kMaxWaitForStatsMs = 3000;
@ -5090,5 +5055,6 @@ TEST_F(PeerConnectionIntegrationTestPlanB, TwoVideoUnifiedPlanToNoMediaPlanB) {
} }
} // namespace } // namespace
} // namespace webrtc
#endif // if !defined(THREAD_SANITIZER) #endif // if !defined(THREAD_SANITIZER)

View File

@ -94,6 +94,9 @@
#include "pc/test/androidtestinitializer.h" #include "pc/test/androidtestinitializer.h"
#endif #endif
namespace webrtc {
namespace {
static const char kStreamId1[] = "local_stream_1"; static const char kStreamId1[] = "local_stream_1";
static const char kStreamId2[] = "local_stream_2"; static const char kStreamId2[] = "local_stream_2";
static const char kStreamId3[] = "local_stream_3"; static const char kStreamId3[] = "local_stream_3";
@ -449,49 +452,13 @@ static const char kDtlsSdesFallbackSdp[] =
"inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32 " "inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32 "
"dummy_session_params\r\n"; "dummy_session_params\r\n";
using ::cricket::StreamParams;
using ::testing::Exactly; using ::testing::Exactly;
using ::testing::Values; using ::testing::Values;
using cricket::StreamParams;
using webrtc::AudioSourceInterface;
using webrtc::AudioTrack;
using webrtc::AudioTrackInterface;
using webrtc::DataBuffer;
using webrtc::DataChannelInterface;
using webrtc::IceCandidateInterface;
using webrtc::MediaStream;
using webrtc::MediaStreamInterface;
using webrtc::MediaStreamTrackInterface;
using webrtc::MockCreateSessionDescriptionObserver;
using webrtc::MockDataChannelObserver;
using webrtc::MockPeerConnectionObserver;
using webrtc::MockSetSessionDescriptionObserver;
using webrtc::MockStatsObserver;
using webrtc::NotifierInterface;
using webrtc::ObserverInterface;
using webrtc::PeerConnectionInterface;
using webrtc::PeerConnectionObserver;
using webrtc::RTCError;
using webrtc::RTCErrorType;
using webrtc::RtpReceiverInterface;
using webrtc::RtpSenderInterface;
using webrtc::RtpSenderProxyWithInternal;
using webrtc::RtpSenderInternal;
using webrtc::RtpTransceiverDirection;
using webrtc::SdpParseError;
using webrtc::SdpSemantics;
using webrtc::SdpType;
using webrtc::SessionDescriptionInterface;
using webrtc::StreamCollection;
using webrtc::StreamCollectionInterface;
using webrtc::VideoTrackSourceInterface;
using webrtc::VideoTrack;
using webrtc::VideoTrackInterface;
using RTCConfiguration = PeerConnectionInterface::RTCConfiguration; using RTCConfiguration = PeerConnectionInterface::RTCConfiguration;
using RTCOfferAnswerOptions = PeerConnectionInterface::RTCOfferAnswerOptions; using RTCOfferAnswerOptions = PeerConnectionInterface::RTCOfferAnswerOptions;
namespace {
// Gets the first ssrc of given content type from the ContentInfo. // Gets the first ssrc of given content type from the ContentInfo.
bool GetFirstSsrc(const cricket::ContentInfo* content_info, int* ssrc) { bool GetFirstSsrc(const cricket::ContentInfo* content_info, int* ssrc) {
if (!content_info || !ssrc) { if (!content_info || !ssrc) {
@ -660,8 +627,6 @@ class MockTrackObserver : public ObserverInterface {
NotifierInterface* notifier_; NotifierInterface* notifier_;
}; };
} // namespace
// The PeerConnectionMediaConfig tests below verify that configuration and // The PeerConnectionMediaConfig tests below verify that configuration and
// constraints are propagated into the PeerConnection's MediaConfig. These // constraints are propagated into the PeerConnection's MediaConfig. These
// settings are intended for MediaChannel constructors, but that is not // settings are intended for MediaChannel constructors, but that is not
@ -4104,3 +4069,6 @@ TEST(RTCConfigurationTest, ComparisonOperators) {
PeerConnectionInterface::RTCConfigurationType::kAggressive); PeerConnectionInterface::RTCConfigurationType::kAggressive);
EXPECT_NE(a, h); EXPECT_NE(a, h);
} }
} // namespace
} // namespace webrtc