diff --git a/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc b/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc index d8fd9e02c1..99a9e29145 100644 --- a/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc +++ b/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc @@ -66,7 +66,7 @@ struct AudioDecoderFakeApi { absl::optional /*codec_pair_id*/ = absl::nullopt) { auto dec = absl::make_unique>(); EXPECT_CALL(*dec, SampleRateHz()) - .WillOnce(testing::Return(Params::CodecInfo().sample_rate_hz)); + .WillOnce(::testing::Return(Params::CodecInfo().sample_rate_hz)); EXPECT_CALL(*dec, Die()); return std::move(dec); } @@ -78,7 +78,7 @@ TEST(AudioDecoderFactoryTemplateTest, NoDecoderTypes) { rtc::scoped_refptr factory( new rtc::RefCountedObject< audio_decoder_factory_template_impl::AudioDecoderFactoryT<>>()); - EXPECT_THAT(factory->GetSupportedDecoders(), testing::IsEmpty()); + EXPECT_THAT(factory->GetSupportedDecoders(), ::testing::IsEmpty()); EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 16000, 1}, absl::nullopt)); @@ -87,7 +87,7 @@ TEST(AudioDecoderFactoryTemplateTest, NoDecoderTypes) { TEST(AudioDecoderFactoryTemplateTest, OneDecoderType) { auto factory = CreateAudioDecoderFactory>(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"bogus", 8000, 1}, {8000, 1, 12345}})); EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); EXPECT_TRUE(factory->IsSupportedDecoder({"bogus", 8000, 1})); @@ -102,7 +102,7 @@ TEST(AudioDecoderFactoryTemplateTest, TwoDecoderTypes) { auto factory = CreateAudioDecoderFactory, AudioDecoderFakeApi>(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"bogus", 8000, 1}, {8000, 1, 12345}}, AudioCodecSpec{{"sham", 16000, 2, {{"param", "value"}}}, {16000, 2, 23456}})); @@ -126,7 +126,7 @@ TEST(AudioDecoderFactoryTemplateTest, TwoDecoderTypes) { TEST(AudioDecoderFactoryTemplateTest, G711) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"PCMU", 8000, 1}, {8000, 1, 64000}}, AudioCodecSpec{{"PCMA", 8000, 1}, {8000, 1, 64000}})); EXPECT_FALSE(factory->IsSupportedDecoder({"G711", 8000, 1})); @@ -145,7 +145,7 @@ TEST(AudioDecoderFactoryTemplateTest, G711) { TEST(AudioDecoderFactoryTemplateTest, G722) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"G722", 8000, 1}, {16000, 1, 64000}})); EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); EXPECT_TRUE(factory->IsSupportedDecoder({"G722", 8000, 1})); @@ -166,7 +166,7 @@ TEST(AudioDecoderFactoryTemplateTest, G722) { TEST(AudioDecoderFactoryTemplateTest, Ilbc) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13300}})); EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); EXPECT_TRUE(factory->IsSupportedDecoder({"ilbc", 8000, 1})); @@ -180,7 +180,7 @@ TEST(AudioDecoderFactoryTemplateTest, Ilbc) { TEST(AudioDecoderFactoryTemplateTest, IsacFix) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre(AudioCodecSpec{ + ::testing::ElementsAre(AudioCodecSpec{ {"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}})); EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2})); EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 16000, 1})); @@ -196,7 +196,7 @@ TEST(AudioDecoderFactoryTemplateTest, IsacFloat) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT( factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}, AudioCodecSpec{{"ISAC", 32000, 1}, {32000, 1, 56000, 10000, 56000}})); EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2})); @@ -216,7 +216,7 @@ TEST(AudioDecoderFactoryTemplateTest, L16) { auto factory = CreateAudioDecoderFactory(); EXPECT_THAT( factory->GetSupportedDecoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"L16", 8000, 1}, {8000, 1, 8000 * 16}}, AudioCodecSpec{{"L16", 16000, 1}, {16000, 1, 16000 * 16}}, AudioCodecSpec{{"L16", 32000, 1}, {32000, 1, 32000 * 16}}, @@ -241,7 +241,7 @@ TEST(AudioDecoderFactoryTemplateTest, Opus) { const SdpAudioFormat opus_format( {"opus", 48000, 2, {{"minptime", "10"}, {"useinbandfec", "1"}}}); EXPECT_THAT(factory->GetSupportedDecoders(), - testing::ElementsAre(AudioCodecSpec{opus_format, opus_info})); + ::testing::ElementsAre(AudioCodecSpec{opus_format, opus_info})); EXPECT_FALSE(factory->IsSupportedDecoder({"opus", 48000, 1})); EXPECT_TRUE(factory->IsSupportedDecoder({"opus", 48000, 2})); EXPECT_EQ(nullptr, diff --git a/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc b/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc index ca024b9326..4188c8c6e8 100644 --- a/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc +++ b/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc @@ -67,7 +67,7 @@ struct AudioEncoderFakeApi { absl::optional /*codec_pair_id*/ = absl::nullopt) { auto enc = absl::make_unique>(); EXPECT_CALL(*enc, SampleRateHz()) - .WillOnce(testing::Return(Params::CodecInfo().sample_rate_hz)); + .WillOnce(::testing::Return(Params::CodecInfo().sample_rate_hz)); return std::move(enc); } }; @@ -78,7 +78,7 @@ TEST(AudioEncoderFactoryTemplateTest, NoEncoderTypes) { rtc::scoped_refptr factory( new rtc::RefCountedObject< audio_encoder_factory_template_impl::AudioEncoderFactoryT<>>()); - EXPECT_THAT(factory->GetSupportedEncoders(), testing::IsEmpty()); + EXPECT_THAT(factory->GetSupportedEncoders(), ::testing::IsEmpty()); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1})); EXPECT_EQ(nullptr, factory->MakeAudioEncoder(17, {"bar", 16000, 1}, absl::nullopt)); @@ -87,7 +87,7 @@ TEST(AudioEncoderFactoryTemplateTest, NoEncoderTypes) { TEST(AudioEncoderFactoryTemplateTest, OneEncoderType) { auto factory = CreateAudioEncoderFactory>(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"bogus", 8000, 1}, {8000, 1, 12345}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1})); EXPECT_EQ(AudioCodecInfo(8000, 1, 12345), @@ -103,7 +103,7 @@ TEST(AudioEncoderFactoryTemplateTest, TwoEncoderTypes) { auto factory = CreateAudioEncoderFactory, AudioEncoderFakeApi>(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"bogus", 8000, 1}, {8000, 1, 12345}}, AudioCodecSpec{{"sham", 16000, 2, {{"param", "value"}}}, {16000, 2, 23456}})); @@ -129,7 +129,7 @@ TEST(AudioEncoderFactoryTemplateTest, TwoEncoderTypes) { TEST(AudioEncoderFactoryTemplateTest, G711) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"PCMU", 8000, 1}, {8000, 1, 64000}}, AudioCodecSpec{{"PCMA", 8000, 1}, {8000, 1, 64000}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"PCMA", 16000, 1})); @@ -148,7 +148,7 @@ TEST(AudioEncoderFactoryTemplateTest, G711) { TEST(AudioEncoderFactoryTemplateTest, G722) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"G722", 8000, 1}, {16000, 1, 64000}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1})); EXPECT_EQ(AudioCodecInfo(16000, 1, 64000), @@ -163,7 +163,7 @@ TEST(AudioEncoderFactoryTemplateTest, G722) { TEST(AudioEncoderFactoryTemplateTest, Ilbc) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13333}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1})); EXPECT_EQ(AudioCodecInfo(8000, 1, 13333), @@ -178,7 +178,7 @@ TEST(AudioEncoderFactoryTemplateTest, Ilbc) { TEST(AudioEncoderFactoryTemplateTest, IsacFix) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT(factory->GetSupportedEncoders(), - testing::ElementsAre(AudioCodecSpec{ + ::testing::ElementsAre(AudioCodecSpec{ {"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"isac", 16000, 2})); EXPECT_EQ(AudioCodecInfo(16000, 1, 32000, 10000, 32000), @@ -200,7 +200,7 @@ TEST(AudioEncoderFactoryTemplateTest, IsacFloat) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT( factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}, AudioCodecSpec{{"ISAC", 32000, 1}, {32000, 1, 56000, 10000, 56000}})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"isac", 16000, 2})); @@ -222,7 +222,7 @@ TEST(AudioEncoderFactoryTemplateTest, L16) { auto factory = CreateAudioEncoderFactory(); EXPECT_THAT( factory->GetSupportedEncoders(), - testing::ElementsAre( + ::testing::ElementsAre( AudioCodecSpec{{"L16", 8000, 1}, {8000, 1, 8000 * 16}}, AudioCodecSpec{{"L16", 16000, 1}, {16000, 1, 16000 * 16}}, AudioCodecSpec{{"L16", 32000, 1}, {32000, 1, 32000 * 16}}, @@ -246,7 +246,7 @@ TEST(AudioEncoderFactoryTemplateTest, Opus) { info.supports_network_adaption = true; EXPECT_THAT( factory->GetSupportedEncoders(), - testing::ElementsAre(AudioCodecSpec{ + ::testing::ElementsAre(AudioCodecSpec{ {"opus", 48000, 2, {{"minptime", "10"}, {"useinbandfec", "1"}}}, info})); EXPECT_EQ(absl::nullopt, factory->QueryAudioEncoder({"foo", 8000, 1})); diff --git a/api/test/loopback_media_transport_unittest.cc b/api/test/loopback_media_transport_unittest.cc index b827405d51..8e510e67b9 100644 --- a/api/test/loopback_media_transport_unittest.cc +++ b/api/test/loopback_media_transport_unittest.cc @@ -86,11 +86,11 @@ TEST(LoopbackMediaTransport, AudioDeliveredToSink) { std::unique_ptr thread = rtc::Thread::Create(); thread->Start(); MediaTransportPair transport_pair(thread.get()); - testing::StrictMock sink; + ::testing::StrictMock sink; EXPECT_CALL(sink, - OnData(1, testing::Property( + OnData(1, ::testing::Property( &MediaTransportEncodedAudioFrame::sequence_number, - testing::Eq(10)))); + ::testing::Eq(10)))); transport_pair.second()->SetReceiveAudioSink(&sink); transport_pair.first()->SendAudioFrame(1, CreateAudioFrame(10)); @@ -102,17 +102,17 @@ TEST(LoopbackMediaTransport, VideoDeliveredToSink) { std::unique_ptr thread = rtc::Thread::Create(); thread->Start(); MediaTransportPair transport_pair(thread.get()); - testing::StrictMock sink; + ::testing::StrictMock sink; constexpr uint8_t encoded_data[] = {1, 2, 3}; EncodedImage encoded_image; encoded_image.Allocate(sizeof(encoded_data)); memcpy(encoded_image.data(), encoded_data, sizeof(encoded_data)); encoded_image.set_size(sizeof(encoded_data)); - EXPECT_CALL(sink, OnData(1, testing::Property( + EXPECT_CALL(sink, OnData(1, ::testing::Property( &MediaTransportEncodedVideoFrame::frame_id, - testing::Eq(10)))) - .WillOnce(testing::Invoke( + ::testing::Eq(10)))) + .WillOnce(::testing::Invoke( [&encoded_image](int frame_id, const MediaTransportEncodedVideoFrame& frame) { EXPECT_NE(frame.encoded_image().data(), encoded_image.data()); @@ -135,8 +135,8 @@ TEST(LoopbackMediaTransport, VideoKeyFrameRequestDeliveredToCallback) { std::unique_ptr thread = rtc::Thread::Create(); thread->Start(); MediaTransportPair transport_pair(thread.get()); - testing::StrictMock callback1; - testing::StrictMock callback2; + ::testing::StrictMock callback1; + ::testing::StrictMock callback2; const uint64_t kFirstChannelId = 1111; const uint64_t kSecondChannelId = 2222; @@ -160,11 +160,11 @@ TEST(LoopbackMediaTransport, DataDeliveredToSink) { transport_pair.first()->SetDataSink(&sink); const int channel_id = 1; - EXPECT_CALL(sink, - OnDataReceived( - channel_id, DataMessageType::kText, - testing::Property( - &rtc::CopyOnWriteBuffer::cdata, testing::StrEq("foo")))); + EXPECT_CALL( + sink, OnDataReceived( + channel_id, DataMessageType::kText, + ::testing::Property( + &rtc::CopyOnWriteBuffer::cdata, ::testing::StrEq("foo")))); SendDataParams params; params.type = DataMessageType::kText; @@ -188,7 +188,7 @@ TEST(LoopbackMediaTransport, CloseDeliveredToSink) { const int channel_id = 1; { - testing::InSequence s; + ::testing::InSequence s; EXPECT_CALL(second_sink, OnChannelClosing(channel_id)); EXPECT_CALL(second_sink, OnChannelClosed(channel_id)); EXPECT_CALL(first_sink, OnChannelClosed(channel_id)); diff --git a/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc b/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc index 40cbb1fad0..8ccafcc884 100644 --- a/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc +++ b/api/video_codecs/test/video_encoder_software_fallback_wrapper_unittest.cc @@ -552,8 +552,8 @@ TEST_F(ForcedFallbackTestEnabled, ScalingDisabledIfResizeOff) { } TEST(SoftwareFallbackEncoderTest, BothRateControllersNotTrusted) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithTrustedRateController(false))); @@ -568,8 +568,8 @@ TEST(SoftwareFallbackEncoderTest, BothRateControllersNotTrusted) { } TEST(SoftwareFallbackEncoderTest, SwRateControllerTrusted) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithTrustedRateController(true))); EXPECT_CALL(*hw_encoder, GetEncoderInfo()) @@ -583,8 +583,8 @@ TEST(SoftwareFallbackEncoderTest, SwRateControllerTrusted) { } TEST(SoftwareFallbackEncoderTest, HwRateControllerTrusted) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithTrustedRateController(false))); EXPECT_CALL(*hw_encoder, GetEncoderInfo()) @@ -608,8 +608,8 @@ TEST(SoftwareFallbackEncoderTest, HwRateControllerTrusted) { } TEST(SoftwareFallbackEncoderTest, BothRateControllersTrusted) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithTrustedRateController(true))); EXPECT_CALL(*hw_encoder, GetEncoderInfo()) @@ -623,8 +623,8 @@ TEST(SoftwareFallbackEncoderTest, BothRateControllersTrusted) { } TEST(SoftwareFallbackEncoderTest, ReportsHardwareAccelerated) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithHardwareAccelerated(false))); EXPECT_CALL(*hw_encoder, GetEncoderInfo()) @@ -647,8 +647,8 @@ TEST(SoftwareFallbackEncoderTest, ReportsHardwareAccelerated) { } TEST(SoftwareFallbackEncoderTest, ReportsInternalSource) { - auto* sw_encoder = new testing::NiceMock(); - auto* hw_encoder = new testing::NiceMock(); + auto* sw_encoder = new ::testing::NiceMock(); + auto* hw_encoder = new ::testing::NiceMock(); EXPECT_CALL(*sw_encoder, GetEncoderInfo()) .WillRepeatedly(Return(GetEncoderInfoWithInternalSource(false))); EXPECT_CALL(*hw_encoder, GetEncoderInfo()) diff --git a/audio/audio_receive_stream_unittest.cc b/audio/audio_receive_stream_unittest.cc index def4d1ae7e..127f2ff60c 100644 --- a/audio/audio_receive_stream_unittest.cc +++ b/audio/audio_receive_stream_unittest.cc @@ -33,9 +33,9 @@ namespace webrtc { namespace test { namespace { -using testing::_; -using testing::FloatEq; -using testing::Return; +using ::testing::_; +using ::testing::FloatEq; +using ::testing::Return; AudioDecodingCallStats MakeAudioDecodeStatsForTest() { AudioDecodingCallStats audio_decode_stats; @@ -76,7 +76,7 @@ struct ConfigHelper { explicit ConfigHelper(rtc::scoped_refptr audio_mixer) : audio_mixer_(audio_mixer) { - using testing::Invoke; + using ::testing::Invoke; AudioState::Config config; config.audio_mixer = audio_mixer_; @@ -85,7 +85,7 @@ struct ConfigHelper { new rtc::RefCountedObject>(); audio_state_ = AudioState::Create(config); - channel_receive_ = new testing::StrictMock(); + channel_receive_ = new ::testing::StrictMock(); EXPECT_CALL(*channel_receive_, SetLocalSSRC(kLocalSsrc)).Times(1); EXPECT_CALL(*channel_receive_, SetNACKStatus(true, 15)).Times(1); EXPECT_CALL(*channel_receive_, @@ -96,7 +96,7 @@ struct ConfigHelper { EXPECT_CALL(*channel_receive_, SetAssociatedSendChannel(nullptr)).Times(1); EXPECT_CALL(*channel_receive_, SetReceiveCodecs(_)) .WillRepeatedly(Invoke([](const std::map& codecs) { - EXPECT_THAT(codecs, testing::IsEmpty()); + EXPECT_THAT(codecs, ::testing::IsEmpty()); })); stream_config_.rtp.local_ssrc = kLocalSsrc; @@ -124,8 +124,8 @@ struct ConfigHelper { MockChannelReceive* channel_receive() { return channel_receive_; } void SetupMockForGetStats() { - using testing::DoAll; - using testing::SetArgPointee; + using ::testing::DoAll; + using ::testing::SetArgPointee; ASSERT_TRUE(channel_receive_); EXPECT_CALL(*channel_receive_, GetRTCPStatistics()) @@ -152,7 +152,7 @@ struct ConfigHelper { rtc::scoped_refptr audio_state_; rtc::scoped_refptr audio_mixer_; AudioReceiveStream::Config stream_config_; - testing::StrictMock* channel_receive_ = nullptr; + ::testing::StrictMock* channel_receive_ = nullptr; RtpStreamReceiverController rtp_stream_receiver_controller_; MockTransport rtcp_send_transport_; }; @@ -242,7 +242,7 @@ TEST(AudioReceiveStreamTest, ReceiveRtpPacket) { parsed_packet.set_arrival_time_ms((packet_time_us + 500) / 1000); EXPECT_CALL(*helper.channel_receive(), - OnRtpPacket(testing::Ref(parsed_packet))); + OnRtpPacket(::testing::Ref(parsed_packet))); recv_stream->OnRtpPacket(parsed_packet); } diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc index 0db569bb53..701df1c9ee 100644 --- a/audio/audio_send_stream_unittest.cc +++ b/audio/audio_send_stream_unittest.cc @@ -39,13 +39,13 @@ namespace webrtc { namespace test { namespace { -using testing::_; -using testing::Eq; -using testing::Ne; -using testing::Field; -using testing::Invoke; -using testing::Return; -using testing::StrEq; +using ::testing::_; +using ::testing::Eq; +using ::testing::Field; +using ::testing::Invoke; +using ::testing::Ne; +using ::testing::Return; +using ::testing::StrEq; const uint32_t kSsrc = 1234; const char* kCName = "foo_name"; @@ -87,7 +87,7 @@ std::unique_ptr SetupAudioEncoderMock( for (const auto& spec : kCodecSpecs) { if (format == spec.format) { std::unique_ptr encoder( - new testing::NiceMock()); + new ::testing::NiceMock()); ON_CALL(*encoder.get(), SampleRateHz()) .WillByDefault(Return(spec.info.sample_rate_hz)); ON_CALL(*encoder.get(), NumChannels()) @@ -136,7 +136,7 @@ struct ConfigHelper { "ConfigHelper_worker_queue", TaskQueueFactory::Priority::NORMAL)), audio_encoder_(nullptr) { - using testing::Invoke; + using ::testing::Invoke; AudioState::Config config; config.audio_mixer = AudioMixerImpl::Create(); @@ -191,7 +191,7 @@ struct ConfigHelper { void SetupDefaultChannelSend(bool audio_bwe_enabled) { EXPECT_TRUE(channel_send_ == nullptr); - channel_send_ = new testing::StrictMock(); + channel_send_ = new ::testing::StrictMock(); EXPECT_CALL(*channel_send_, GetRtpRtcp()).WillRepeatedly(Invoke([this]() { return &this->rtp_rtcp_; })); @@ -254,9 +254,9 @@ struct ConfigHelper { } void SetupMockForGetStats() { - using testing::DoAll; - using testing::SetArgPointee; - using testing::SetArgReferee; + using ::testing::DoAll; + using ::testing::SetArgPointee; + using ::testing::SetArgReferee; std::vector report_blocks; webrtc::ReportBlock block = kReportBlock; @@ -295,15 +295,15 @@ struct ConfigHelper { std::unique_ptr task_queue_factory_; rtc::scoped_refptr audio_state_; AudioSendStream::Config stream_config_; - testing::StrictMock* channel_send_ = nullptr; + ::testing::StrictMock* channel_send_ = nullptr; rtc::scoped_refptr audio_processing_; AudioProcessingStats audio_processing_stats_; - testing::StrictMock bandwidth_observer_; - testing::NiceMock event_log_; - testing::NiceMock rtp_transport_; - testing::NiceMock rtp_rtcp_; + ::testing::StrictMock bandwidth_observer_; + ::testing::NiceMock event_log_; + ::testing::NiceMock rtp_transport_; + ::testing::NiceMock rtp_rtcp_; MockRtcpRttStats rtcp_rtt_stats_; - testing::NiceMock limit_observer_; + ::testing::NiceMock limit_observer_; BitrateAllocator bitrate_allocator_; // |worker_queue| is defined last to ensure all pending tasks are cancelled // and deleted before any other members. @@ -537,7 +537,7 @@ TEST(AudioSendStreamTest, ReconfigureTransportCcResetsFirst) { } // CallEncoder will be called to re-set overhead. - EXPECT_CALL(*helper.channel_send(), CallEncoder(testing::_)).Times(1); + EXPECT_CALL(*helper.channel_send(), CallEncoder(::testing::_)).Times(1); send_stream->Reconfigure(new_config); } @@ -548,7 +548,7 @@ TEST(AudioSendStreamTest, OnTransportOverheadChanged) { auto new_config = helper.config(); // CallEncoder will be called on overhead change. - EXPECT_CALL(*helper.channel_send(), CallEncoder(testing::_)).Times(1); + EXPECT_CALL(*helper.channel_send(), CallEncoder(::testing::_)).Times(1); const size_t transport_overhead_per_packet_bytes = 333; send_stream->SetTransportOverhead(transport_overhead_per_packet_bytes); @@ -563,7 +563,7 @@ TEST(AudioSendStreamTest, OnAudioOverheadChanged) { auto new_config = helper.config(); // CallEncoder will be called on overhead change. - EXPECT_CALL(*helper.channel_send(), CallEncoder(testing::_)).Times(1); + EXPECT_CALL(*helper.channel_send(), CallEncoder(::testing::_)).Times(1); const size_t audio_overhead_per_packet_bytes = 555; send_stream->OnOverheadChanged(audio_overhead_per_packet_bytes); @@ -577,7 +577,7 @@ TEST(AudioSendStreamTest, OnAudioAndTransportOverheadChanged) { auto new_config = helper.config(); // CallEncoder will be called when each of overhead changes. - EXPECT_CALL(*helper.channel_send(), CallEncoder(testing::_)).Times(2); + EXPECT_CALL(*helper.channel_send(), CallEncoder(::testing::_)).Times(2); const size_t transport_overhead_per_packet_bytes = 333; send_stream->SetTransportOverhead(transport_overhead_per_packet_bytes); diff --git a/audio/audio_state_unittest.cc b/audio/audio_state_unittest.cc index 75bf4e1583..ed5ca223d5 100644 --- a/audio/audio_state_unittest.cc +++ b/audio/audio_state_unittest.cc @@ -112,12 +112,12 @@ TEST(AudioStateTest, RecordedAudioArrivesAtSingleStream) { EXPECT_CALL( stream, - SendAudioDataForMock(testing::AllOf( - testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(8000)), - testing::Field(&AudioFrame::num_channels_, testing::Eq(2u))))) + SendAudioDataForMock(::testing::AllOf( + ::testing::Field(&AudioFrame::sample_rate_hz_, ::testing::Eq(8000)), + ::testing::Field(&AudioFrame::num_channels_, ::testing::Eq(2u))))) .WillOnce( // Verify that channels are not swapped by default. - testing::Invoke([](AudioFrame* audio_frame) { + ::testing::Invoke([](AudioFrame* audio_frame) { auto levels = ComputeChannelLevels(audio_frame); EXPECT_LT(0u, levels[0]); EXPECT_EQ(0u, levels[1]); @@ -126,7 +126,7 @@ TEST(AudioStateTest, RecordedAudioArrivesAtSingleStream) { static_cast(audio_state->audio_processing()); EXPECT_CALL(*ap, set_stream_delay_ms(0)); EXPECT_CALL(*ap, set_stream_key_pressed(false)); - EXPECT_CALL(*ap, ProcessStream(testing::_)); + EXPECT_CALL(*ap, ProcessStream(::testing::_)); constexpr int kSampleRate = 16000; constexpr size_t kNumChannels = 2; @@ -152,23 +152,23 @@ TEST(AudioStateTest, RecordedAudioArrivesAtMultipleStreams) { EXPECT_CALL( stream_1, - SendAudioDataForMock(testing::AllOf( - testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)), - testing::Field(&AudioFrame::num_channels_, testing::Eq(1u))))) + SendAudioDataForMock(::testing::AllOf( + ::testing::Field(&AudioFrame::sample_rate_hz_, ::testing::Eq(16000)), + ::testing::Field(&AudioFrame::num_channels_, ::testing::Eq(1u))))) .WillOnce( // Verify that there is output signal. - testing::Invoke([](AudioFrame* audio_frame) { + ::testing::Invoke([](AudioFrame* audio_frame) { auto levels = ComputeChannelLevels(audio_frame); EXPECT_LT(0u, levels[0]); })); EXPECT_CALL( stream_2, - SendAudioDataForMock(testing::AllOf( - testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)), - testing::Field(&AudioFrame::num_channels_, testing::Eq(1u))))) + SendAudioDataForMock(::testing::AllOf( + ::testing::Field(&AudioFrame::sample_rate_hz_, ::testing::Eq(16000)), + ::testing::Field(&AudioFrame::num_channels_, ::testing::Eq(1u))))) .WillOnce( // Verify that there is output signal. - testing::Invoke([](AudioFrame* audio_frame) { + ::testing::Invoke([](AudioFrame* audio_frame) { auto levels = ComputeChannelLevels(audio_frame); EXPECT_LT(0u, levels[0]); })); @@ -176,7 +176,7 @@ TEST(AudioStateTest, RecordedAudioArrivesAtMultipleStreams) { static_cast(audio_state->audio_processing()); EXPECT_CALL(*ap, set_stream_delay_ms(5)); EXPECT_CALL(*ap, set_stream_key_pressed(true)); - EXPECT_CALL(*ap, ProcessStream(testing::_)); + EXPECT_CALL(*ap, ProcessStream(::testing::_)); constexpr int kSampleRate = 16000; constexpr size_t kNumChannels = 1; @@ -204,10 +204,10 @@ TEST(AudioStateTest, EnableChannelSwap) { MockAudioSendStream stream; audio_state->AddSendingStream(&stream, kSampleRate, kNumChannels); - EXPECT_CALL(stream, SendAudioDataForMock(testing::_)) + EXPECT_CALL(stream, SendAudioDataForMock(::testing::_)) .WillOnce( // Verify that channels are swapped. - testing::Invoke([](AudioFrame* audio_frame) { + ::testing::Invoke([](AudioFrame* audio_frame) { auto levels = ComputeChannelLevels(audio_frame); EXPECT_EQ(0u, levels[0]); EXPECT_LT(0u, levels[1]); @@ -240,8 +240,8 @@ TEST(AudioStateTest, InputLevelStats) { kSampleRate, 0, 0, 0, false, new_mic_level); auto stats = audio_state->GetAudioInputStats(); EXPECT_EQ(0, stats.audio_level); - EXPECT_THAT(stats.total_energy, testing::DoubleEq(0.0)); - EXPECT_THAT(stats.total_duration, testing::DoubleEq(0.01)); + EXPECT_THAT(stats.total_energy, ::testing::DoubleEq(0.0)); + EXPECT_THAT(stats.total_duration, ::testing::DoubleEq(0.01)); } // Push 10 non-silent buffers -> Level stats should be non-zero. @@ -255,8 +255,8 @@ TEST(AudioStateTest, InputLevelStats) { } auto stats = audio_state->GetAudioInputStats(); EXPECT_EQ(32767, stats.audio_level); - EXPECT_THAT(stats.total_energy, testing::DoubleEq(0.01)); - EXPECT_THAT(stats.total_duration, testing::DoubleEq(0.11)); + EXPECT_THAT(stats.total_energy, ::testing::DoubleEq(0.01)); + EXPECT_THAT(stats.total_duration, ::testing::DoubleEq(0.11)); } } @@ -268,9 +268,9 @@ TEST(AudioStateTest, FakeAudioSource fake_source; helper.mixer()->AddSource(&fake_source); - EXPECT_CALL(fake_source, GetAudioFrameWithInfo(testing::_, testing::_)) + EXPECT_CALL(fake_source, GetAudioFrameWithInfo(::testing::_, ::testing::_)) .WillOnce( - testing::Invoke([](int sample_rate_hz, AudioFrame* audio_frame) { + ::testing::Invoke([](int sample_rate_hz, AudioFrame* audio_frame) { audio_frame->sample_rate_hz_ = sample_rate_hz; audio_frame->samples_per_channel_ = sample_rate_hz / 100; audio_frame->num_channels_ = kNumberOfChannels; diff --git a/audio/test/media_transport_test.cc b/audio/test/media_transport_test.cc index 5ab13c5b4b..c48a1f6f51 100644 --- a/audio/test/media_transport_test.cc +++ b/audio/test/media_transport_test.cc @@ -33,7 +33,7 @@ namespace webrtc { namespace test { namespace { -using testing::NiceMock; +using ::testing::NiceMock; constexpr int kPayloadTypeOpus = 17; constexpr int kSamplingFrequency = 48000; diff --git a/audio/transport_feedback_packet_loss_tracker_unittest.cc b/audio/transport_feedback_packet_loss_tracker_unittest.cc index cc9065109c..716a1bdfa5 100644 --- a/audio/transport_feedback_packet_loss_tracker_unittest.cc +++ b/audio/transport_feedback_packet_loss_tracker_unittest.cc @@ -563,6 +563,6 @@ constexpr uint16_t kBases[] = {0x0000, 0x3456, 0xc032, 0xfffe}; INSTANTIATE_TEST_SUITE_P(_, TransportFeedbackPacketLossTrackerTest, - testing::ValuesIn(kBases)); + ::testing::ValuesIn(kBases)); } // namespace webrtc diff --git a/call/flexfec_receive_stream_unittest.cc b/call/flexfec_receive_stream_unittest.cc index 4728c8f2b9..6fcc5ddf36 100644 --- a/call/flexfec_receive_stream_unittest.cc +++ b/call/flexfec_receive_stream_unittest.cc @@ -143,7 +143,7 @@ TEST_F(FlexfecReceiveStreamTest, RecoversPacket) { kPayloadBits, kPayloadBits, kPayloadBits, kPayloadBits}; // clang-format on - testing::StrictMock recovered_packet_receiver; + ::testing::StrictMock recovered_packet_receiver; EXPECT_CALL(process_thread_, RegisterModule(_, _)).Times(1); FlexfecReceiveStreamImpl receive_stream( Clock::GetRealTimeClock(), &rtp_stream_receiver_controller_, config_, diff --git a/call/rtcp_demuxer_unittest.cc b/call/rtcp_demuxer_unittest.cc index 5060c7b1d3..16faa287d7 100644 --- a/call/rtcp_demuxer_unittest.cc +++ b/call/rtcp_demuxer_unittest.cc @@ -39,7 +39,7 @@ class MockRtcpPacketSink : public RtcpPacketSinkInterface { MOCK_METHOD1(OnRtcpPacket, void(rtc::ArrayView)); }; -class RtcpDemuxerTest : public testing::Test { +class RtcpDemuxerTest : public ::testing::Test { protected: ~RtcpDemuxerTest() { for (auto* sink : sinks_to_tear_down_) { diff --git a/call/rtp_bitrate_configurator_unittest.cc b/call/rtp_bitrate_configurator_unittest.cc index b177db7a8f..70a4cf6798 100644 --- a/call/rtp_bitrate_configurator_unittest.cc +++ b/call/rtp_bitrate_configurator_unittest.cc @@ -15,7 +15,7 @@ namespace webrtc { using absl::nullopt; -class RtpBitrateConfiguratorTest : public testing::Test { +class RtpBitrateConfiguratorTest : public ::testing::Test { public: RtpBitrateConfiguratorTest() : configurator_(new RtpBitrateConfigurator(BitrateConstraints())) {} diff --git a/call/rtp_demuxer_unittest.cc b/call/rtp_demuxer_unittest.cc index fbca494c1f..0a08c8698d 100644 --- a/call/rtp_demuxer_unittest.cc +++ b/call/rtp_demuxer_unittest.cc @@ -48,7 +48,7 @@ class MockSsrcBindingObserver : public SsrcBindingObserver { void(uint8_t payload_type, uint32_t ssrc)); }; -class RtpDemuxerTest : public testing::Test { +class RtpDemuxerTest : public ::testing::Test { protected: ~RtpDemuxerTest() { for (auto* sink : sinks_to_tear_down_) { diff --git a/call/rtp_video_sender_unittest.cc b/call/rtp_video_sender_unittest.cc index 1a1dd9bdde..d1c771409d 100644 --- a/call/rtp_video_sender_unittest.cc +++ b/call/rtp_video_sender_unittest.cc @@ -316,7 +316,7 @@ TEST(RtpVideoSenderTest, FrameCountCallbacks) { EXPECT_NE( EncodedImageCallback::Result::OK, test.router()->OnEncodedImage(encoded_image, nullptr, nullptr).error); - testing::Mock::VerifyAndClearExpectations(&callback); + ::testing::Mock::VerifyAndClearExpectations(&callback); test.router()->SetActive(true); @@ -330,7 +330,7 @@ TEST(RtpVideoSenderTest, FrameCountCallbacks) { EXPECT_EQ(1, frame_counts.key_frames); EXPECT_EQ(0, frame_counts.delta_frames); - testing::Mock::VerifyAndClearExpectations(&callback); + ::testing::Mock::VerifyAndClearExpectations(&callback); encoded_image._frameType = VideoFrameType::kVideoFrameDelta; EXPECT_CALL(callback, FrameCountUpdated(_, kSsrc1)) diff --git a/call/rtx_receive_stream_unittest.cc b/call/rtx_receive_stream_unittest.cc index a9cfd53b3c..f003c4e063 100644 --- a/call/rtx_receive_stream_unittest.cc +++ b/call/rtx_receive_stream_unittest.cc @@ -74,11 +74,11 @@ TEST(RtxReceiveStreamTest, RestoresPacketPayload) { EXPECT_TRUE(rtx_packet.Parse(rtc::ArrayView(kRtxPacket))); EXPECT_CALL(media_sink, OnRtpPacket(_)) - .WillOnce(testing::Invoke([](const RtpPacketReceived& packet) { + .WillOnce(::testing::Invoke([](const RtpPacketReceived& packet) { EXPECT_EQ(packet.SequenceNumber(), kMediaSeqno); EXPECT_EQ(packet.Ssrc(), kMediaSSRC); EXPECT_EQ(packet.PayloadType(), kMediaPayloadType); - EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee)); + EXPECT_THAT(packet.payload(), ::testing::ElementsAre(0xee)); })); rtx_sink.OnRtpPacket(rtx_packet); @@ -91,7 +91,7 @@ TEST(RtxReceiveStreamTest, SetsRecoveredFlag) { EXPECT_TRUE(rtx_packet.Parse(rtc::ArrayView(kRtxPacket))); EXPECT_FALSE(rtx_packet.recovered()); EXPECT_CALL(media_sink, OnRtpPacket(_)) - .WillOnce(testing::Invoke([](const RtpPacketReceived& packet) { + .WillOnce(::testing::Invoke([](const RtpPacketReceived& packet) { EXPECT_TRUE(packet.recovered()); })); @@ -132,11 +132,11 @@ TEST(RtxReceiveStreamTest, CopiesRtpHeaderExtensions) { EXPECT_EQ(kVideoRotation_90, rotation); EXPECT_CALL(media_sink, OnRtpPacket(_)) - .WillOnce(testing::Invoke([](const RtpPacketReceived& packet) { + .WillOnce(::testing::Invoke([](const RtpPacketReceived& packet) { EXPECT_EQ(packet.SequenceNumber(), kMediaSeqno); EXPECT_EQ(packet.Ssrc(), kMediaSSRC); EXPECT_EQ(packet.PayloadType(), kMediaPayloadType); - EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee)); + EXPECT_THAT(packet.payload(), ::testing::ElementsAre(0xee)); VideoRotation rotation = kVideoRotation_0; EXPECT_TRUE(packet.GetExtension(&rotation)); EXPECT_EQ(rotation, kVideoRotation_90); diff --git a/common_audio/resampler/resampler_unittest.cc b/common_audio/resampler/resampler_unittest.cc index 61be040468..08a7479f3e 100644 --- a/common_audio/resampler/resampler_unittest.cc +++ b/common_audio/resampler/resampler_unittest.cc @@ -40,7 +40,7 @@ bool ValidRates(int in_rate, int out_rate) { return true; } -class ResamplerTest : public testing::Test { +class ResamplerTest : public ::testing::Test { protected: ResamplerTest(); void SetUp() override; diff --git a/common_audio/resampler/sinc_resampler_unittest.cc b/common_audio/resampler/sinc_resampler_unittest.cc index 3aedaccd56..0aa3c91c53 100644 --- a/common_audio/resampler/sinc_resampler_unittest.cc +++ b/common_audio/resampler/sinc_resampler_unittest.cc @@ -29,7 +29,7 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; +using ::testing::_; namespace webrtc { @@ -72,7 +72,7 @@ TEST(SincResamplerTest, ChunkedResample) { resampler.Resample(resampler.ChunkSize(), resampled_destination.get()); // Verify requesting kChunks * ChunkSize() frames causes kChunks callbacks. - testing::Mock::VerifyAndClear(&mock_source); + ::testing::Mock::VerifyAndClear(&mock_source); EXPECT_CALL(mock_source, Run(_, _)) .Times(kChunks) .WillRepeatedly(ClearBuffer()); @@ -94,7 +94,7 @@ TEST(SincResamplerTest, Flush) { // Flush and request more data, which should all be zeros now. resampler.Flush(); - testing::Mock::VerifyAndClear(&mock_source); + ::testing::Mock::VerifyAndClear(&mock_source); EXPECT_CALL(mock_source, Run(_, _)).Times(1).WillOnce(ClearBuffer()); resampler.Resample(resampler.ChunkSize() / 2, resampled_destination.get()); for (size_t i = 0; i < resampler.ChunkSize() / 2; ++i) @@ -230,7 +230,8 @@ TEST(SincResamplerTest, ConvolveBenchmark) { #undef CONVOLVE_FUNC typedef std::tuple SincResamplerTestData; -class SincResamplerTest : public testing::TestWithParam { +class SincResamplerTest + : public ::testing::TestWithParam { public: SincResamplerTest() : input_rate_(std::get<0>(GetParam())), @@ -343,7 +344,7 @@ static const double kResamplingRMSError = -14.58; INSTANTIATE_TEST_SUITE_P( SincResamplerTest, SincResamplerTest, - testing::Values( + ::testing::Values( // To 44.1kHz std::make_tuple(8000, 44100, kResamplingRMSError, -62.73), std::make_tuple(11025, 44100, kResamplingRMSError, -72.19), diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc index aeaf97bdeb..0e316b9622 100644 --- a/common_audio/signal_processing/signal_processing_unittest.cc +++ b/common_audio/signal_processing/signal_processing_unittest.cc @@ -25,7 +25,7 @@ static const int16_t vector16[kVector16Size] = {1, -3333, 345}; -class SplTest : public testing::Test { +class SplTest : public ::testing::Test { protected: SplTest() { WebRtcSpl_Init(); } ~SplTest() override {} diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_common_unittest.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_common_unittest.cc index 8a44a6dc2b..0afa5368d1 100644 --- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_common_unittest.cc +++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_common_unittest.cc @@ -21,7 +21,7 @@ namespace webrtc_event_logging { namespace { template -class SignednessConversionTest : public testing::Test { +class SignednessConversionTest : public ::testing::Test { public: static_assert(std::is_integral::value, ""); static_assert(std::is_signed::value, ""); diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc index 796c6d4b0b..e8d69ea03c 100644 --- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc +++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_unittest.cc @@ -43,7 +43,7 @@ namespace webrtc { class RtcEventLogEncoderTest - : public testing::TestWithParam> { + : public ::testing::TestWithParam> { protected: RtcEventLogEncoderTest() : seed_(std::get<0>(GetParam())), diff --git a/media/base/rtp_data_engine_unittest.cc b/media/base/rtp_data_engine_unittest.cc index bcba9a4add..97d7e18dc8 100644 --- a/media/base/rtp_data_engine_unittest.cc +++ b/media/base/rtp_data_engine_unittest.cc @@ -49,7 +49,7 @@ class FakeDataReceiver : public sigslot::has_slots<> { cricket::ReceiveDataParams last_received_data_params_; }; -class RtpDataMediaChannelTest : public testing::Test { +class RtpDataMediaChannelTest : public ::testing::Test { protected: virtual void SetUp() { // Seed needed for each test to satisfy expectations. diff --git a/media/base/video_adapter_unittest.cc b/media/base/video_adapter_unittest.cc index c156264ce9..3334d36250 100644 --- a/media/base/video_adapter_unittest.cc +++ b/media/base/video_adapter_unittest.cc @@ -26,7 +26,7 @@ const int kHeight = 720; const int kDefaultFps = 30; } // namespace -class VideoAdapterTest : public testing::Test, +class VideoAdapterTest : public ::testing::Test, public ::testing::WithParamInterface { public: VideoAdapterTest() diff --git a/media/engine/fake_webrtc_call.h b/media/engine/fake_webrtc_call.h index 9839b2d1f3..134dd47cd3 100644 --- a/media/engine/fake_webrtc_call.h +++ b/media/engine/fake_webrtc_call.h @@ -357,7 +357,7 @@ class FakeCall final : public webrtc::Call, public webrtc::PacketReceiver { int transport_overhead_per_packet) override; void OnSentPacket(const rtc::SentPacket& sent_packet) override; - testing::NiceMock + ::testing::NiceMock transport_controller_send_; webrtc::NetworkState audio_network_state_; diff --git a/media/engine/null_webrtc_video_engine_unittest.cc b/media/engine/null_webrtc_video_engine_unittest.cc index 343e167fcb..0d1833f999 100644 --- a/media/engine/null_webrtc_video_engine_unittest.cc +++ b/media/engine/null_webrtc_video_engine_unittest.cc @@ -30,7 +30,7 @@ namespace cricket { TEST(NullWebRtcVideoEngineTest, CheckInterface) { std::unique_ptr task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - testing::NiceMock adm; + ::testing::NiceMock adm; auto audio_engine = absl::make_unique( task_queue_factory.get(), &adm, webrtc::MockAudioEncoderFactory::CreateUnusedFactory(), diff --git a/media/engine/payload_type_mapper_unittest.cc b/media/engine/payload_type_mapper_unittest.cc index eed797b806..2e6ae1ed2b 100644 --- a/media/engine/payload_type_mapper_unittest.cc +++ b/media/engine/payload_type_mapper_unittest.cc @@ -18,7 +18,7 @@ namespace cricket { -class PayloadTypeMapperTest : public testing::Test { +class PayloadTypeMapperTest : public ::testing::Test { protected: PayloadTypeMapper mapper_; }; diff --git a/media/engine/webrtc_video_engine_unittest.cc b/media/engine/webrtc_video_engine_unittest.cc index e844403378..54e76e53e4 100644 --- a/media/engine/webrtc_video_engine_unittest.cc +++ b/media/engine/webrtc_video_engine_unittest.cc @@ -57,7 +57,7 @@ #include "test/frame_generator.h" #include "test/gmock.h" -using testing::Field; +using ::testing::Field; using webrtc::BitrateConstraints; using webrtc::RtpExtension; @@ -342,7 +342,7 @@ TEST_F(WebRtcVideoEngineTestWithGenericDescriptor, TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeCapturer) { // Allocate the source first to prevent early destruction before channel's // dtor is called. - testing::NiceMock video_source; + ::testing::NiceMock video_source; encoder_factory_->AddSupportedVideoCodecType("VP8"); @@ -360,19 +360,19 @@ TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeCapturer) { EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, false))); // Set capturer. EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &video_source)); // Verify capturer has turned off applying rotation. - testing::Mock::VerifyAndClear(&video_source); + ::testing::Mock::VerifyAndClear(&video_source); // Verify removing header extension turns on applying rotation. parameters.extensions.clear(); EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, true))); EXPECT_TRUE(channel->SetSendParameters(parameters)); @@ -381,7 +381,7 @@ TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeCapturer) { TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeAddSendStream) { // Allocate the source first to prevent early destruction before channel's // dtor is called. - testing::NiceMock video_source; + ::testing::NiceMock video_source; encoder_factory_->AddSupportedVideoCodecType("VP8"); @@ -399,13 +399,13 @@ TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeAddSendStream) { // Set source. EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, false))); EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &video_source)); } TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionAfterCapturer) { - testing::NiceMock video_source; + ::testing::NiceMock video_source; encoder_factory_->AddSupportedVideoCodecType("VP8"); encoder_factory_->AddSupportedVideoCodecType("VP9"); @@ -417,12 +417,12 @@ TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionAfterCapturer) { // Set capturer. EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, true))); EXPECT_TRUE(channel->SetVideoSend(kSsrc, nullptr, &video_source)); // Verify capturer has turned on applying rotation. - testing::Mock::VerifyAndClear(&video_source); + ::testing::Mock::VerifyAndClear(&video_source); // Add CVO extension. const int id = 1; @@ -435,18 +435,18 @@ TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionAfterCapturer) { parameters.codecs.erase(parameters.codecs.begin()); EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, false))); EXPECT_TRUE(channel->SetSendParameters(parameters)); // Verify capturer has turned off applying rotation. - testing::Mock::VerifyAndClear(&video_source); + ::testing::Mock::VerifyAndClear(&video_source); // Verify removing header extension turns on applying rotation. parameters.extensions.clear(); EXPECT_CALL( video_source, - AddOrUpdateSink(testing::_, + AddOrUpdateSink(::testing::_, Field(&rtc::VideoSinkWants::rotation_applied, true))); EXPECT_TRUE(channel->SetSendParameters(parameters)); } @@ -710,11 +710,11 @@ void WebRtcVideoEngineTest::ExpectRtpCapabilitySupport(const char* uri, const RtpCapabilities capabilities = engine_.GetCapabilities(); if (supported) { EXPECT_THAT(capabilities.header_extensions, - testing::Contains(testing::Field(&RtpExtension::uri, uri))); + ::testing::Contains(::testing::Field(&RtpExtension::uri, uri))); } else { - EXPECT_THAT( - capabilities.header_extensions, - testing::Each(testing::Field(&RtpExtension::uri, testing::StrNe(uri)))); + EXPECT_THAT(capabilities.header_extensions, + ::testing::Each(::testing::Field(&RtpExtension::uri, + ::testing::StrNe(uri)))); } } @@ -1053,7 +1053,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) { EXPECT_CALL(*rate_allocator_factory, CreateVideoBitrateAllocatorProxy(Field( &webrtc::VideoCodec::codecType, webrtc::kVideoCodecVP8))) - .WillOnce(testing::Return(new webrtc::MockVideoBitrateAllocator())); + .WillOnce(::testing::Return(new webrtc::MockVideoBitrateAllocator())); WebRtcVideoEngine engine( (std::unique_ptr(encoder_factory)), (std::unique_ptr(decoder_factory)), @@ -1062,7 +1062,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) { const webrtc::SdpVideoFormat vp8_format("VP8"); const std::vector supported_formats = {vp8_format}; EXPECT_CALL(*encoder_factory, GetSupportedFormats()) - .WillRepeatedly(testing::Return(supported_formats)); + .WillRepeatedly(::testing::Return(supported_formats)); // Verify the codecs from the engine. const std::vector engine_codecs = engine.codecs(); @@ -1101,7 +1101,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) { codec_info.has_internal_source = false; const webrtc::SdpVideoFormat format("VP8"); EXPECT_CALL(*encoder_factory, QueryVideoEncoder(format)) - .WillRepeatedly(testing::Return(codec_info)); + .WillRepeatedly(::testing::Return(codec_info)); FakeWebRtcVideoEncoder* const encoder = new FakeWebRtcVideoEncoder(nullptr); rtc::Event encoder_created; EXPECT_CALL(*encoder_factory, CreateVideoEncoderProxy(format)) @@ -1113,7 +1113,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) { // Mock decoder creation. |engine| take ownership of the decoder. FakeWebRtcVideoDecoder* const decoder = new FakeWebRtcVideoDecoder(nullptr); EXPECT_CALL(*decoder_factory, CreateVideoDecoderProxy(format)) - .WillOnce(testing::Return(decoder)); + .WillOnce(::testing::Return(decoder)); // Create a call. webrtc::RtcEventLogNullImpl event_log; @@ -1176,11 +1176,11 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, NullDecoder) { const webrtc::SdpVideoFormat vp8_format("VP8"); const std::vector supported_formats = {vp8_format}; EXPECT_CALL(*encoder_factory, GetSupportedFormats()) - .WillRepeatedly(testing::Return(supported_formats)); + .WillRepeatedly(::testing::Return(supported_formats)); // Decoder creation fails. - EXPECT_CALL(*decoder_factory, CreateVideoDecoderProxy(testing::_)) - .WillOnce(testing::Return(nullptr)); + EXPECT_CALL(*decoder_factory, CreateVideoDecoderProxy(::testing::_)) + .WillOnce(::testing::Return(nullptr)); // Create a call. webrtc::RtcEventLogNullImpl event_log; @@ -1261,7 +1261,7 @@ TEST_F(WebRtcVideoEngineTest, DISABLED_RecreatesEncoderOnContentTypeChange) { EXPECT_EQ(0u, encoder_factory_->encoders().size()); } -class WebRtcVideoChannelBaseTest : public testing::Test { +class WebRtcVideoChannelBaseTest : public ::testing::Test { protected: WebRtcVideoChannelBaseTest() : engine_(webrtc::CreateBuiltinVideoEncoderFactory(), @@ -7113,7 +7113,7 @@ TEST_F(WebRtcVideoChannelTest, ConfiguresLocalSsrcOnExistingReceivers) { TestReceiverLocalSsrcConfiguration(true); } -class WebRtcVideoChannelSimulcastTest : public testing::Test { +class WebRtcVideoChannelSimulcastTest : public ::testing::Test { public: WebRtcVideoChannelSimulcastTest() : fake_call_(), diff --git a/media/engine/webrtc_voice_engine_unittest.cc b/media/engine/webrtc_voice_engine_unittest.cc index 969c10ce97..4ddcd43377 100644 --- a/media/engine/webrtc_voice_engine_unittest.cc +++ b/media/engine/webrtc_voice_engine_unittest.cc @@ -98,27 +98,30 @@ void AdmSetupExpectations(webrtc::test::MockAudioDeviceModule* adm) { EXPECT_CALL(*adm, RegisterAudioCallback(_)).WillOnce(Return(0)); #if defined(WEBRTC_WIN) EXPECT_CALL( - *adm, SetPlayoutDevice( - testing::Matcher( - webrtc::AudioDeviceModule::kDefaultCommunicationDevice))) + *adm, + SetPlayoutDevice( + ::testing::Matcher( + webrtc::AudioDeviceModule::kDefaultCommunicationDevice))) .WillOnce(Return(0)); #else EXPECT_CALL(*adm, SetPlayoutDevice(0)).WillOnce(Return(0)); #endif // #if defined(WEBRTC_WIN) EXPECT_CALL(*adm, InitSpeaker()).WillOnce(Return(0)); - EXPECT_CALL(*adm, StereoPlayoutIsAvailable(testing::_)).WillOnce(Return(0)); + EXPECT_CALL(*adm, StereoPlayoutIsAvailable(::testing::_)).WillOnce(Return(0)); EXPECT_CALL(*adm, SetStereoPlayout(false)).WillOnce(Return(0)); #if defined(WEBRTC_WIN) EXPECT_CALL( - *adm, SetRecordingDevice( - testing::Matcher( - webrtc::AudioDeviceModule::kDefaultCommunicationDevice))) + *adm, + SetRecordingDevice( + ::testing::Matcher( + webrtc::AudioDeviceModule::kDefaultCommunicationDevice))) .WillOnce(Return(0)); #else EXPECT_CALL(*adm, SetRecordingDevice(0)).WillOnce(Return(0)); #endif // #if defined(WEBRTC_WIN) EXPECT_CALL(*adm, InitMicrophone()).WillOnce(Return(0)); - EXPECT_CALL(*adm, StereoRecordingIsAvailable(testing::_)).WillOnce(Return(0)); + EXPECT_CALL(*adm, StereoRecordingIsAvailable(::testing::_)) + .WillOnce(Return(0)); EXPECT_CALL(*adm, SetStereoRecording(false)).WillOnce(Return(0)); EXPECT_CALL(*adm, BuiltInAECIsAvailable()).WillOnce(Return(false)); EXPECT_CALL(*adm, BuiltInAGCIsAvailable()).WillOnce(Return(false)); @@ -147,7 +150,7 @@ TEST(WebRtcVoiceEngineTestStubLibrary, StartupShutdown) { webrtc::AudioProcessing::Config apm_config; EXPECT_CALL(*apm, GetConfig()).WillRepeatedly(ReturnPointee(&apm_config)); EXPECT_CALL(*apm, ApplyConfig(_)).WillRepeatedly(SaveArg<0>(&apm_config)); - EXPECT_CALL(*apm, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm, SetExtraOptions(::testing::_)); EXPECT_CALL(*apm, DetachAecDump()); { cricket::WebRtcVoiceEngine engine( @@ -167,7 +170,7 @@ class FakeAudioSource : public cricket::AudioSource { void SetSink(Sink* sink) override {} }; -class WebRtcVoiceEngineTestFake : public testing::Test { +class WebRtcVoiceEngineTestFake : public ::testing::Test { public: WebRtcVoiceEngineTestFake() : WebRtcVoiceEngineTestFake("") {} @@ -183,7 +186,7 @@ class WebRtcVoiceEngineTestFake : public testing::Test { // AudioProcessing. EXPECT_CALL(*apm_, GetConfig()).WillRepeatedly(ReturnPointee(&apm_config_)); EXPECT_CALL(*apm_, ApplyConfig(_)).WillRepeatedly(SaveArg<0>(&apm_config_)); - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)); EXPECT_CALL(*apm_, DetachAecDump()); // Default Options. EXPECT_CALL(apm_ns_, set_level(kDefaultNsLevel)).WillOnce(Return(0)); @@ -209,7 +212,7 @@ class WebRtcVoiceEngineTestFake : public testing::Test { } bool SetupChannel() { - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)); channel_ = engine_->CreateMediaChannel(&call_, cricket::MediaConfig(), cricket::AudioOptions(), webrtc::CryptoOptions()); @@ -285,13 +288,13 @@ class WebRtcVoiceEngineTestFake : public testing::Test { EXPECT_CALL(adm_, RecordingIsInitialized()).WillOnce(Return(false)); EXPECT_CALL(adm_, Recording()).WillOnce(Return(false)); EXPECT_CALL(adm_, InitRecording()).WillOnce(Return(0)); - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)); } channel_->SetSend(enable); } void SetSendParameters(const cricket::AudioSendParameters& params) { - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)); ASSERT_TRUE(channel_); EXPECT_TRUE(channel_->SetSendParameters(params)); } @@ -303,7 +306,7 @@ class WebRtcVoiceEngineTestFake : public testing::Test { EXPECT_CALL(*apm_, set_output_will_be_muted(!enable)); ASSERT_TRUE(channel_); if (enable && options) { - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)); } EXPECT_TRUE(channel_->SetAudioSend(ssrc, enable, options, source)); } @@ -2033,7 +2036,7 @@ TEST_F(WebRtcVoiceEngineWithSendSideBweTest, SupportsTransportSequenceNumberHeaderExtension) { const cricket::RtpCapabilities capabilities = engine_->GetCapabilities(); EXPECT_THAT(capabilities.header_extensions, - Contains(testing::Field( + Contains(::testing::Field( "uri", &RtpExtension::uri, webrtc::RtpExtension::kTransportSequenceNumberUri))); } @@ -2320,7 +2323,7 @@ TEST_F(WebRtcVoiceEngineTestFake, PlayoutWithMultipleStreams) { TEST_F(WebRtcVoiceEngineTestFake, TxAgcConfigViaOptions) { EXPECT_TRUE(SetupSendStream()); EXPECT_CALL(adm_, BuiltInAGCIsAvailable()) - .Times(testing::AtLeast(1)) + .Times(::testing::AtLeast(1)) .WillRepeatedly(Return(false)); const auto& agc_config = apm_config_.gain_controller1; @@ -2978,7 +2981,7 @@ TEST_F(WebRtcVoiceEngineTestFake, SetOptionOverridesViaChannels) { .WillRepeatedly(Return(false)); EXPECT_CALL(adm_, Recording()).Times(2).WillRepeatedly(Return(false)); EXPECT_CALL(adm_, InitRecording()).Times(2).WillRepeatedly(Return(0)); - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)).Times(10); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)).Times(10); std::unique_ptr channel1( static_cast( @@ -3084,7 +3087,7 @@ TEST_F(WebRtcVoiceEngineTestFake, TestSetDscpOptions) { std::unique_ptr channel; webrtc::RtpParameters parameters; - EXPECT_CALL(*apm_, SetExtraOptions(testing::_)).Times(3); + EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)).Times(3); channel.reset(static_cast( engine_->CreateMediaChannel(&call_, config, cricket::AudioOptions(), @@ -3508,7 +3511,7 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) { // we never want it to create a decoder at this stage. std::unique_ptr task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - testing::NiceMock adm; + ::testing::NiceMock adm; rtc::scoped_refptr apm = webrtc::AudioProcessingBuilder().Create(); cricket::WebRtcVoiceEngine engine( @@ -3530,7 +3533,7 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) { TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) { std::unique_ptr task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - testing::NiceMock adm; + ::testing::NiceMock adm; EXPECT_CALL(adm, AddRef()).Times(3); EXPECT_CALL(adm, Release()) .Times(3) @@ -3560,7 +3563,7 @@ TEST(WebRtcVoiceEngineTest, HasCorrectPayloadTypeMapping) { webrtc::CreateDefaultTaskQueueFactory(); // TODO(ossu): Why are the payload types of codecs with non-static payload // type assignments checked here? It shouldn't really matter. - testing::NiceMock adm; + ::testing::NiceMock adm; rtc::scoped_refptr apm = webrtc::AudioProcessingBuilder().Create(); cricket::WebRtcVoiceEngine engine( @@ -3608,7 +3611,7 @@ TEST(WebRtcVoiceEngineTest, HasCorrectPayloadTypeMapping) { TEST(WebRtcVoiceEngineTest, Has32Channels) { std::unique_ptr task_queue_factory = webrtc::CreateDefaultTaskQueueFactory(); - testing::NiceMock adm; + ::testing::NiceMock adm; rtc::scoped_refptr apm = webrtc::AudioProcessingBuilder().Create(); cricket::WebRtcVoiceEngine engine( @@ -3650,7 +3653,7 @@ TEST(WebRtcVoiceEngineTest, SetRecvCodecs) { // what we sent in - though it's probably reasonable to expect so, if // SetRecvParameters returns true. // I think it will become clear once audio decoder injection is completed. - testing::NiceMock adm; + ::testing::NiceMock adm; rtc::scoped_refptr apm = webrtc::AudioProcessingBuilder().Create(); cricket::WebRtcVoiceEngine engine( @@ -3695,7 +3698,7 @@ TEST(WebRtcVoiceEngineTest, CollectRecvCodecs) { new rtc::RefCountedObject; EXPECT_CALL(*mock_decoder_factory.get(), GetSupportedDecoders()) .WillOnce(Return(specs)); - testing::NiceMock adm; + ::testing::NiceMock adm; rtc::scoped_refptr apm = webrtc::AudioProcessingBuilder().Create(); diff --git a/media/sctp/sctp_transport_unittest.cc b/media/sctp/sctp_transport_unittest.cc index c86b62b578..86cb416e22 100644 --- a/media/sctp/sctp_transport_unittest.cc +++ b/media/sctp/sctp_transport_unittest.cc @@ -116,7 +116,7 @@ class SignalTransportClosedReopener : public sigslot::has_slots<> { }; // SCTP Data Engine testing framework. -class SctpTransportTest : public testing::Test, public sigslot::has_slots<> { +class SctpTransportTest : public ::testing::Test, public sigslot::has_slots<> { protected: // usrsctp uses the NSS random number generator on non-Android platforms, // so we need to initialize SSL. diff --git a/modules/audio_coding/audio_network_adaptor/event_log_writer_unittest.cc b/modules/audio_coding/audio_network_adaptor/event_log_writer_unittest.cc index b1e3313289..5d5e5df58a 100644 --- a/modules/audio_coding/audio_network_adaptor/event_log_writer_unittest.cc +++ b/modules/audio_coding/audio_network_adaptor/event_log_writer_unittest.cc @@ -48,7 +48,7 @@ struct EventLogWriterStates { EventLogWriterStates CreateEventLogWriter() { EventLogWriterStates state; - state.event_log.reset(new testing::StrictMock()); + state.event_log.reset(new ::testing::StrictMock()); state.event_log_writer.reset(new EventLogWriter( state.event_log.get(), kMinBitrateChangeBps, kMinBitrateChangeFraction, kMinPacketLossChangeFraction)); diff --git a/modules/audio_coding/codecs/isac/fix/source/filterbanks_unittest.cc b/modules/audio_coding/codecs/isac/fix/source/filterbanks_unittest.cc index b7456a7056..4a3db2324a 100644 --- a/modules/audio_coding/codecs/isac/fix/source/filterbanks_unittest.cc +++ b/modules/audio_coding/codecs/isac/fix/source/filterbanks_unittest.cc @@ -16,7 +16,7 @@ #include "system_wrappers/include/cpu_features_wrapper.h" #include "test/gtest.h" -class FilterBanksTest : public testing::Test { +class FilterBanksTest : public ::testing::Test { protected: // Pass a function pointer to the Tester function. void RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5513 diff --git a/modules/audio_coding/codecs/isac/fix/source/filters_unittest.cc b/modules/audio_coding/codecs/isac/fix/source/filters_unittest.cc index 471fa57474..192ef89f9f 100644 --- a/modules/audio_coding/codecs/isac/fix/source/filters_unittest.cc +++ b/modules/audio_coding/codecs/isac/fix/source/filters_unittest.cc @@ -12,7 +12,7 @@ #include "system_wrappers/include/cpu_features_wrapper.h" #include "test/gtest.h" -class FiltersTest : public testing::Test { +class FiltersTest : public ::testing::Test { protected: // Pass a function pointer to the Tester function. void FiltersTester(AutocorrFix WebRtcIsacfix_AutocorrFixFunction) { diff --git a/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model_unittest.cc b/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model_unittest.cc index fab0a043cc..554ec0cedb 100644 --- a/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model_unittest.cc +++ b/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model_unittest.cc @@ -12,7 +12,7 @@ #include "system_wrappers/include/cpu_features_wrapper.h" #include "test/gtest.h" -class LpcMaskingModelTest : public testing::Test { +class LpcMaskingModelTest : public ::testing::Test { protected: // Pass a function pointer to the Tester function. void CalculateResidualEnergyTester( diff --git a/modules/audio_coding/codecs/isac/fix/source/transform_unittest.cc b/modules/audio_coding/codecs/isac/fix/source/transform_unittest.cc index a058530c25..473b7f8d05 100644 --- a/modules/audio_coding/codecs/isac/fix/source/transform_unittest.cc +++ b/modules/audio_coding/codecs/isac/fix/source/transform_unittest.cc @@ -136,7 +136,7 @@ static const int16_t time2spec_out_expected_2[kSamples] = { 294, -339, 344, -396, 407, -429, 438, -439, 485, -556, 629, -612, 637, -645, 661, -737, 829, -830, 831, -1041}; -class TransformTest : public testing::Test { +class TransformTest : public ::testing::Test { protected: TransformTest() { WebRtcSpl_Init(); } diff --git a/modules/audio_coding/codecs/isac/unittest.cc b/modules/audio_coding/codecs/isac/unittest.cc index 076510be2a..b9eff322b8 100644 --- a/modules/audio_coding/codecs/isac/unittest.cc +++ b/modules/audio_coding/codecs/isac/unittest.cc @@ -210,7 +210,7 @@ struct IsacTestParam { } }; -class IsacCommonTest : public testing::TestWithParam {}; +class IsacCommonTest : public ::testing::TestWithParam {}; } // namespace @@ -252,6 +252,6 @@ std::vector TestCases() { return cases; } -INSTANTIATE_TEST_SUITE_P(, IsacCommonTest, testing::ValuesIn(TestCases())); +INSTANTIATE_TEST_SUITE_P(, IsacCommonTest, ::testing::ValuesIn(TestCases())); } // namespace webrtc diff --git a/modules/audio_coding/codecs/opus/audio_decoder_multi_channel_opus_unittest.cc b/modules/audio_coding/codecs/opus/audio_decoder_multi_channel_opus_unittest.cc index 23b950621a..66eecb758e 100644 --- a/modules/audio_coding/codecs/opus/audio_decoder_multi_channel_opus_unittest.cc +++ b/modules/audio_coding/codecs/opus/audio_decoder_multi_channel_opus_unittest.cc @@ -94,7 +94,7 @@ TEST(AudioDecoderMultiOpusTest, ValidSdpToConfigProducesCorrectConfig) { EXPECT_TRUE(decoder_config->IsOk()); EXPECT_EQ(decoder_config->coupled_streams, 2); EXPECT_THAT(decoder_config->channel_mapping, - testing::ContainerEq(std::vector({3, 1, 2, 0}))); + ::testing::ContainerEq(std::vector({3, 1, 2, 0}))); } TEST(AudioDecoderMultiOpusTest, InvalidSdpToConfigDoesNotProduceConfig) { diff --git a/modules/audio_coding/codecs/tools/audio_codec_speed_test.h b/modules/audio_coding/codecs/tools/audio_codec_speed_test.h index c626bfa0ed..59c2f16055 100644 --- a/modules/audio_coding/codecs/tools/audio_codec_speed_test.h +++ b/modules/audio_coding/codecs/tools/audio_codec_speed_test.h @@ -22,7 +22,7 @@ namespace webrtc { // . typedef std::tuple coding_param; -class AudioCodecSpeedTest : public testing::TestWithParam { +class AudioCodecSpeedTest : public ::testing::TestWithParam { protected: AudioCodecSpeedTest(int block_duration_ms, int input_sampling_khz, diff --git a/modules/audio_coding/neteq/decoder_database_unittest.cc b/modules/audio_coding/neteq/decoder_database_unittest.cc index 9a28cacb35..c1b92b5375 100644 --- a/modules/audio_coding/neteq/decoder_database_unittest.cc +++ b/modules/audio_coding/neteq/decoder_database_unittest.cc @@ -21,8 +21,8 @@ #include "test/mock_audio_decoder.h" #include "test/mock_audio_decoder_factory.h" -using testing::_; -using testing::Invoke; +using ::testing::_; +using ::testing::Invoke; namespace webrtc { diff --git a/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc b/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc index 09b3728bb8..5d2df77d70 100644 --- a/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc +++ b/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc @@ -17,7 +17,7 @@ #include "rtc_base/numerics/safe_conversions.h" #include "test/testsupport/file_utils.h" -using testing::InitGoogleTest; +using ::testing::InitGoogleTest; namespace webrtc { namespace test { diff --git a/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc index 92e06804f9..94a5a86b7a 100644 --- a/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc +++ b/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc @@ -12,7 +12,7 @@ #include "modules/audio_coding/neteq/tools/neteq_quality_test.h" #include "rtc_base/flags.h" -using testing::InitGoogleTest; +using ::testing::InitGoogleTest; namespace webrtc { namespace test { diff --git a/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc b/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc index 35e24c2d09..e56c81725d 100644 --- a/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc +++ b/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc @@ -13,7 +13,7 @@ #include "modules/audio_coding/neteq/tools/neteq_quality_test.h" #include "rtc_base/flags.h" -using testing::InitGoogleTest; +using ::testing::InitGoogleTest; namespace webrtc { namespace test { diff --git a/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc b/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc index 3557b11260..a43c26ae37 100644 --- a/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc +++ b/modules/audio_coding/neteq/test/neteq_pcm16b_quality_test.cc @@ -18,7 +18,7 @@ #include "rtc_base/numerics/safe_conversions.h" #include "test/testsupport/file_utils.h" -using testing::InitGoogleTest; +using ::testing::InitGoogleTest; namespace webrtc { namespace test { diff --git a/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc b/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc index ce399a4e90..62a184ee3c 100644 --- a/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc +++ b/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc @@ -17,7 +17,7 @@ #include "rtc_base/numerics/safe_conversions.h" #include "test/testsupport/file_utils.h" -using testing::InitGoogleTest; +using ::testing::InitGoogleTest; namespace webrtc { namespace test { diff --git a/modules/audio_device/include/test_audio_device_unittest.cc b/modules/audio_device/include/test_audio_device_unittest.cc index 8d62084224..db3260e214 100644 --- a/modules/audio_device/include/test_audio_device_unittest.cc +++ b/modules/audio_device/include/test_audio_device_unittest.cc @@ -59,7 +59,7 @@ void RunTestViaRtcPlatformFileAPI( std::vector read_samples(expected_samples.size()); EXPECT_EQ(expected_samples.size(), reader.ReadSamples(read_samples.size(), read_samples.data())); - EXPECT_THAT(expected_samples, testing::ElementsAreArray(read_samples)); + EXPECT_THAT(expected_samples, ::testing::ElementsAreArray(read_samples)); EXPECT_EQ(0u, reader.ReadSamples(read_samples.size(), read_samples.data())); } diff --git a/modules/audio_mixer/audio_mixer_impl_unittest.cc b/modules/audio_mixer/audio_mixer_impl_unittest.cc index ab20378cb4..e14b69e984 100644 --- a/modules/audio_mixer/audio_mixer_impl_unittest.cc +++ b/modules/audio_mixer/audio_mixer_impl_unittest.cc @@ -26,10 +26,10 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::Exactly; -using testing::Invoke; -using testing::Return; +using ::testing::_; +using ::testing::Exactly; +using ::testing::Invoke; +using ::testing::Return; namespace webrtc { @@ -63,7 +63,7 @@ AudioFrame frame_for_mixing; } // namespace -class MockMixerAudioSource : public testing::NiceMock { +class MockMixerAudioSource : public ::testing::NiceMock { public: MockMixerAudioSource() : fake_audio_frame_info_(AudioMixer::Source::AudioFrameInfo::kNormal) { @@ -296,7 +296,7 @@ TEST(AudioMixer, ShouldNotCauseQualityLossForMultipleSources) { const auto sample_rate = source_sample_rates[i]; EXPECT_CALL(source, PreferredSampleRate()).WillOnce(Return(sample_rate)); - EXPECT_CALL(source, GetAudioFrameWithInfo(testing::Ge(sample_rate), _)); + EXPECT_CALL(source, GetAudioFrameWithInfo(::testing::Ge(sample_rate), _)); } mixer->Mix(1, &frame_for_mixing); } diff --git a/modules/audio_processing/aec3/block_processor_unittest.cc b/modules/audio_processing/aec3/block_processor_unittest.cc index 29a25eb2a7..bd085da4e7 100644 --- a/modules/audio_processing/aec3/block_processor_unittest.cc +++ b/modules/audio_processing/aec3/block_processor_unittest.cc @@ -28,10 +28,10 @@ namespace webrtc { namespace { -using testing::AtLeast; -using testing::Return; -using testing::StrictMock; -using testing::_; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Return; +using ::testing::StrictMock; // Verifies that the basic BlockProcessor functionality works and that the API // methods are callable. @@ -151,7 +151,7 @@ TEST(BlockProcessor, DISABLED_SubmoduleIntegration) { render_delay_buffer_mock( new StrictMock(rate)); std::unique_ptr< - testing::StrictMock> + ::testing::StrictMock> render_delay_controller_mock( new StrictMock()); std::unique_ptr> diff --git a/modules/audio_processing/aec3/echo_canceller3_unittest.cc b/modules/audio_processing/aec3/echo_canceller3_unittest.cc index 267213ea34..6951597487 100644 --- a/modules/audio_processing/aec3/echo_canceller3_unittest.cc +++ b/modules/audio_processing/aec3/echo_canceller3_unittest.cc @@ -28,8 +28,8 @@ namespace webrtc { namespace { -using testing::StrictMock; -using testing::_; +using ::testing::_; +using ::testing::StrictMock; // Populates the frame with linearly increasing sample values for each band, // with a band-specific offset, in order to allow simple bitexactness @@ -327,7 +327,7 @@ class EchoCanceller3Tester { .Times(1); break; case EchoLeakageTestVariant::kTrueNonSticky: { - testing::InSequence s; + ::testing::InSequence s; EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true)) .Times(1); EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false)) @@ -409,14 +409,14 @@ class EchoCanceller3Tester { .Times(expected_num_block_to_process); break; case SaturationTestVariant::kOneNegative: { - testing::InSequence s; + ::testing::InSequence s; EXPECT_CALL(*block_processor_mock, ProcessCapture(_, true, _)) .Times(num_full_blocks_per_frame); EXPECT_CALL(*block_processor_mock, ProcessCapture(_, false, _)) .Times(expected_num_block_to_process - num_full_blocks_per_frame); } break; case SaturationTestVariant::kOnePositive: { - testing::InSequence s; + ::testing::InSequence s; EXPECT_CALL(*block_processor_mock, ProcessCapture(_, true, _)) .Times(num_full_blocks_per_frame); EXPECT_CALL(*block_processor_mock, ProcessCapture(_, false, _)) diff --git a/modules/audio_processing/aec3/mock/mock_render_delay_buffer.cc b/modules/audio_processing/aec3/mock/mock_render_delay_buffer.cc index 20214cbc2d..75262354c7 100644 --- a/modules/audio_processing/aec3/mock/mock_render_delay_buffer.cc +++ b/modules/audio_processing/aec3/mock/mock_render_delay_buffer.cc @@ -23,9 +23,9 @@ MockRenderDelayBuffer::MockRenderDelayBuffer(int sample_rate_hz) downsampled_render_buffer_(GetDownSampledBufferSize(4, 4)) { ON_CALL(*this, GetRenderBuffer()) .WillByDefault( - testing::Invoke(this, &MockRenderDelayBuffer::FakeGetRenderBuffer)); + ::testing::Invoke(this, &MockRenderDelayBuffer::FakeGetRenderBuffer)); ON_CALL(*this, GetDownsampledRenderBuffer()) - .WillByDefault(testing::Invoke( + .WillByDefault(::testing::Invoke( this, &MockRenderDelayBuffer::FakeGetDownsampledRenderBuffer)); } diff --git a/modules/audio_processing/aec_dump/aec_dump_integration_test.cc b/modules/audio_processing/aec_dump/aec_dump_integration_test.cc index b6d8756d27..a32867fd61 100644 --- a/modules/audio_processing/aec_dump/aec_dump_integration_test.cc +++ b/modules/audio_processing/aec_dump/aec_dump_integration_test.cc @@ -14,11 +14,11 @@ #include "modules/audio_processing/aec_dump/mock_aec_dump.h" #include "modules/audio_processing/include/audio_processing.h" -using testing::_; -using testing::AtLeast; -using testing::Exactly; -using testing::Matcher; -using testing::StrictMock; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Exactly; +using ::testing::Matcher; +using ::testing::StrictMock; namespace { std::unique_ptr CreateAudioProcessing() { diff --git a/modules/audio_processing/agc/agc_manager_direct_unittest.cc b/modules/audio_processing/agc/agc_manager_direct_unittest.cc index 4be420a4ab..cfa7f6966a 100644 --- a/modules/audio_processing/agc/agc_manager_direct_unittest.cc +++ b/modules/audio_processing/agc/agc_manager_direct_unittest.cc @@ -683,7 +683,7 @@ TEST_F(AgcManagerDirectTest, TakesNoActionOnZeroMicVolume) { } TEST(AgcManagerDirectStandaloneTest, DisableDigitalDisablesDigital) { - auto agc = std::unique_ptr(new testing::NiceMock()); + auto agc = std::unique_ptr(new ::testing::NiceMock()); test::MockGainControl gctrl; TestVolumeCallbacks volume; diff --git a/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc b/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc index bd2ea24961..7e29417baf 100644 --- a/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc +++ b/modules/audio_processing/agc2/rnn_vad/pitch_search_internal_unittest.cc @@ -32,7 +32,7 @@ constexpr std::array kTestPitchGains = {0.35f, 0.75f}; } // namespace class ComputePitchGainThresholdTest - : public testing::Test, + : public ::testing::Test, public ::testing::WithParamInterface< std::tuple> {}; @@ -124,7 +124,7 @@ TEST(RnnVadTest, RefinePitchPeriod48kHzBitExactness) { } class CheckLowerPitchPeriodsAndComputePitchGainTest - : public testing::Test, + : public ::testing::Test, public ::testing::WithParamInterface< std::tuple> {}; diff --git a/modules/audio_processing/audio_processing_unittest.cc b/modules/audio_processing/audio_processing_unittest.cc index ddfcf58065..7ff37cb2d7 100644 --- a/modules/audio_processing/audio_processing_unittest.cc +++ b/modules/audio_processing/audio_processing_unittest.cc @@ -2142,7 +2142,7 @@ void UpdateBestSNR(const float* ref, // case SNR which corresponds to inf, or zero error. typedef std::tuple AudioProcessingTestData; class AudioProcessingTest - : public testing::TestWithParam { + : public ::testing::TestWithParam { public: AudioProcessingTest() : input_rate_(std::get<0>(GetParam())), @@ -2440,113 +2440,113 @@ TEST_P(AudioProcessingTest, Formats) { INSTANTIATE_TEST_SUITE_P( CommonFormats, AudioProcessingTest, - testing::Values(std::make_tuple(48000, 48000, 48000, 48000, 0, 0), - std::make_tuple(48000, 48000, 32000, 48000, 40, 30), - std::make_tuple(48000, 48000, 16000, 48000, 40, 20), - std::make_tuple(48000, 44100, 48000, 44100, 20, 20), - std::make_tuple(48000, 44100, 32000, 44100, 20, 15), - std::make_tuple(48000, 44100, 16000, 44100, 20, 15), - std::make_tuple(48000, 32000, 48000, 32000, 30, 35), - std::make_tuple(48000, 32000, 32000, 32000, 30, 0), - std::make_tuple(48000, 32000, 16000, 32000, 30, 20), - std::make_tuple(48000, 16000, 48000, 16000, 25, 20), - std::make_tuple(48000, 16000, 32000, 16000, 25, 20), - std::make_tuple(48000, 16000, 16000, 16000, 25, 0), + ::testing::Values(std::make_tuple(48000, 48000, 48000, 48000, 0, 0), + std::make_tuple(48000, 48000, 32000, 48000, 40, 30), + std::make_tuple(48000, 48000, 16000, 48000, 40, 20), + std::make_tuple(48000, 44100, 48000, 44100, 20, 20), + std::make_tuple(48000, 44100, 32000, 44100, 20, 15), + std::make_tuple(48000, 44100, 16000, 44100, 20, 15), + std::make_tuple(48000, 32000, 48000, 32000, 30, 35), + std::make_tuple(48000, 32000, 32000, 32000, 30, 0), + std::make_tuple(48000, 32000, 16000, 32000, 30, 20), + std::make_tuple(48000, 16000, 48000, 16000, 25, 20), + std::make_tuple(48000, 16000, 32000, 16000, 25, 20), + std::make_tuple(48000, 16000, 16000, 16000, 25, 0), - std::make_tuple(44100, 48000, 48000, 48000, 30, 0), - std::make_tuple(44100, 48000, 32000, 48000, 30, 30), - std::make_tuple(44100, 48000, 16000, 48000, 30, 20), - std::make_tuple(44100, 44100, 48000, 44100, 20, 20), - std::make_tuple(44100, 44100, 32000, 44100, 20, 15), - std::make_tuple(44100, 44100, 16000, 44100, 20, 15), - std::make_tuple(44100, 32000, 48000, 32000, 30, 35), - std::make_tuple(44100, 32000, 32000, 32000, 30, 0), - std::make_tuple(44100, 32000, 16000, 32000, 30, 20), - std::make_tuple(44100, 16000, 48000, 16000, 25, 20), - std::make_tuple(44100, 16000, 32000, 16000, 25, 20), - std::make_tuple(44100, 16000, 16000, 16000, 25, 0), + std::make_tuple(44100, 48000, 48000, 48000, 30, 0), + std::make_tuple(44100, 48000, 32000, 48000, 30, 30), + std::make_tuple(44100, 48000, 16000, 48000, 30, 20), + std::make_tuple(44100, 44100, 48000, 44100, 20, 20), + std::make_tuple(44100, 44100, 32000, 44100, 20, 15), + std::make_tuple(44100, 44100, 16000, 44100, 20, 15), + std::make_tuple(44100, 32000, 48000, 32000, 30, 35), + std::make_tuple(44100, 32000, 32000, 32000, 30, 0), + std::make_tuple(44100, 32000, 16000, 32000, 30, 20), + std::make_tuple(44100, 16000, 48000, 16000, 25, 20), + std::make_tuple(44100, 16000, 32000, 16000, 25, 20), + std::make_tuple(44100, 16000, 16000, 16000, 25, 0), - std::make_tuple(32000, 48000, 48000, 48000, 30, 0), - std::make_tuple(32000, 48000, 32000, 48000, 32, 30), - std::make_tuple(32000, 48000, 16000, 48000, 30, 20), - std::make_tuple(32000, 44100, 48000, 44100, 19, 20), - std::make_tuple(32000, 44100, 32000, 44100, 19, 15), - std::make_tuple(32000, 44100, 16000, 44100, 19, 15), - std::make_tuple(32000, 32000, 48000, 32000, 40, 35), - std::make_tuple(32000, 32000, 32000, 32000, 0, 0), - std::make_tuple(32000, 32000, 16000, 32000, 40, 20), - std::make_tuple(32000, 16000, 48000, 16000, 25, 20), - std::make_tuple(32000, 16000, 32000, 16000, 25, 20), - std::make_tuple(32000, 16000, 16000, 16000, 25, 0), + std::make_tuple(32000, 48000, 48000, 48000, 30, 0), + std::make_tuple(32000, 48000, 32000, 48000, 32, 30), + std::make_tuple(32000, 48000, 16000, 48000, 30, 20), + std::make_tuple(32000, 44100, 48000, 44100, 19, 20), + std::make_tuple(32000, 44100, 32000, 44100, 19, 15), + std::make_tuple(32000, 44100, 16000, 44100, 19, 15), + std::make_tuple(32000, 32000, 48000, 32000, 40, 35), + std::make_tuple(32000, 32000, 32000, 32000, 0, 0), + std::make_tuple(32000, 32000, 16000, 32000, 40, 20), + std::make_tuple(32000, 16000, 48000, 16000, 25, 20), + std::make_tuple(32000, 16000, 32000, 16000, 25, 20), + std::make_tuple(32000, 16000, 16000, 16000, 25, 0), - std::make_tuple(16000, 48000, 48000, 48000, 24, 0), - std::make_tuple(16000, 48000, 32000, 48000, 24, 30), - std::make_tuple(16000, 48000, 16000, 48000, 24, 20), - std::make_tuple(16000, 44100, 48000, 44100, 15, 20), - std::make_tuple(16000, 44100, 32000, 44100, 15, 15), - std::make_tuple(16000, 44100, 16000, 44100, 15, 15), - std::make_tuple(16000, 32000, 48000, 32000, 25, 35), - std::make_tuple(16000, 32000, 32000, 32000, 25, 0), - std::make_tuple(16000, 32000, 16000, 32000, 25, 20), - std::make_tuple(16000, 16000, 48000, 16000, 39, 20), - std::make_tuple(16000, 16000, 32000, 16000, 40, 20), - std::make_tuple(16000, 16000, 16000, 16000, 0, 0))); + std::make_tuple(16000, 48000, 48000, 48000, 24, 0), + std::make_tuple(16000, 48000, 32000, 48000, 24, 30), + std::make_tuple(16000, 48000, 16000, 48000, 24, 20), + std::make_tuple(16000, 44100, 48000, 44100, 15, 20), + std::make_tuple(16000, 44100, 32000, 44100, 15, 15), + std::make_tuple(16000, 44100, 16000, 44100, 15, 15), + std::make_tuple(16000, 32000, 48000, 32000, 25, 35), + std::make_tuple(16000, 32000, 32000, 32000, 25, 0), + std::make_tuple(16000, 32000, 16000, 32000, 25, 20), + std::make_tuple(16000, 16000, 48000, 16000, 39, 20), + std::make_tuple(16000, 16000, 32000, 16000, 40, 20), + std::make_tuple(16000, 16000, 16000, 16000, 0, 0))); #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) INSTANTIATE_TEST_SUITE_P( CommonFormats, AudioProcessingTest, - testing::Values(std::make_tuple(48000, 48000, 48000, 48000, 20, 0), - std::make_tuple(48000, 48000, 32000, 48000, 20, 30), - std::make_tuple(48000, 48000, 16000, 48000, 20, 20), - std::make_tuple(48000, 44100, 48000, 44100, 15, 20), - std::make_tuple(48000, 44100, 32000, 44100, 15, 15), - std::make_tuple(48000, 44100, 16000, 44100, 15, 15), - std::make_tuple(48000, 32000, 48000, 32000, 20, 35), - std::make_tuple(48000, 32000, 32000, 32000, 20, 0), - std::make_tuple(48000, 32000, 16000, 32000, 20, 20), - std::make_tuple(48000, 16000, 48000, 16000, 20, 20), - std::make_tuple(48000, 16000, 32000, 16000, 20, 20), - std::make_tuple(48000, 16000, 16000, 16000, 20, 0), + ::testing::Values(std::make_tuple(48000, 48000, 48000, 48000, 20, 0), + std::make_tuple(48000, 48000, 32000, 48000, 20, 30), + std::make_tuple(48000, 48000, 16000, 48000, 20, 20), + std::make_tuple(48000, 44100, 48000, 44100, 15, 20), + std::make_tuple(48000, 44100, 32000, 44100, 15, 15), + std::make_tuple(48000, 44100, 16000, 44100, 15, 15), + std::make_tuple(48000, 32000, 48000, 32000, 20, 35), + std::make_tuple(48000, 32000, 32000, 32000, 20, 0), + std::make_tuple(48000, 32000, 16000, 32000, 20, 20), + std::make_tuple(48000, 16000, 48000, 16000, 20, 20), + std::make_tuple(48000, 16000, 32000, 16000, 20, 20), + std::make_tuple(48000, 16000, 16000, 16000, 20, 0), - std::make_tuple(44100, 48000, 48000, 48000, 15, 0), - std::make_tuple(44100, 48000, 32000, 48000, 15, 30), - std::make_tuple(44100, 48000, 16000, 48000, 15, 20), - std::make_tuple(44100, 44100, 48000, 44100, 15, 20), - std::make_tuple(44100, 44100, 32000, 44100, 15, 15), - std::make_tuple(44100, 44100, 16000, 44100, 15, 15), - std::make_tuple(44100, 32000, 48000, 32000, 20, 35), - std::make_tuple(44100, 32000, 32000, 32000, 20, 0), - std::make_tuple(44100, 32000, 16000, 32000, 20, 20), - std::make_tuple(44100, 16000, 48000, 16000, 20, 20), - std::make_tuple(44100, 16000, 32000, 16000, 20, 20), - std::make_tuple(44100, 16000, 16000, 16000, 20, 0), + std::make_tuple(44100, 48000, 48000, 48000, 15, 0), + std::make_tuple(44100, 48000, 32000, 48000, 15, 30), + std::make_tuple(44100, 48000, 16000, 48000, 15, 20), + std::make_tuple(44100, 44100, 48000, 44100, 15, 20), + std::make_tuple(44100, 44100, 32000, 44100, 15, 15), + std::make_tuple(44100, 44100, 16000, 44100, 15, 15), + std::make_tuple(44100, 32000, 48000, 32000, 20, 35), + std::make_tuple(44100, 32000, 32000, 32000, 20, 0), + std::make_tuple(44100, 32000, 16000, 32000, 20, 20), + std::make_tuple(44100, 16000, 48000, 16000, 20, 20), + std::make_tuple(44100, 16000, 32000, 16000, 20, 20), + std::make_tuple(44100, 16000, 16000, 16000, 20, 0), - std::make_tuple(32000, 48000, 48000, 48000, 35, 0), - std::make_tuple(32000, 48000, 32000, 48000, 65, 30), - std::make_tuple(32000, 48000, 16000, 48000, 40, 20), - std::make_tuple(32000, 44100, 48000, 44100, 20, 20), - std::make_tuple(32000, 44100, 32000, 44100, 20, 15), - std::make_tuple(32000, 44100, 16000, 44100, 20, 15), - std::make_tuple(32000, 32000, 48000, 32000, 35, 35), - std::make_tuple(32000, 32000, 32000, 32000, 0, 0), - std::make_tuple(32000, 32000, 16000, 32000, 40, 20), - std::make_tuple(32000, 16000, 48000, 16000, 20, 20), - std::make_tuple(32000, 16000, 32000, 16000, 20, 20), - std::make_tuple(32000, 16000, 16000, 16000, 20, 0), + std::make_tuple(32000, 48000, 48000, 48000, 35, 0), + std::make_tuple(32000, 48000, 32000, 48000, 65, 30), + std::make_tuple(32000, 48000, 16000, 48000, 40, 20), + std::make_tuple(32000, 44100, 48000, 44100, 20, 20), + std::make_tuple(32000, 44100, 32000, 44100, 20, 15), + std::make_tuple(32000, 44100, 16000, 44100, 20, 15), + std::make_tuple(32000, 32000, 48000, 32000, 35, 35), + std::make_tuple(32000, 32000, 32000, 32000, 0, 0), + std::make_tuple(32000, 32000, 16000, 32000, 40, 20), + std::make_tuple(32000, 16000, 48000, 16000, 20, 20), + std::make_tuple(32000, 16000, 32000, 16000, 20, 20), + std::make_tuple(32000, 16000, 16000, 16000, 20, 0), - std::make_tuple(16000, 48000, 48000, 48000, 25, 0), - std::make_tuple(16000, 48000, 32000, 48000, 25, 30), - std::make_tuple(16000, 48000, 16000, 48000, 25, 20), - std::make_tuple(16000, 44100, 48000, 44100, 15, 20), - std::make_tuple(16000, 44100, 32000, 44100, 15, 15), - std::make_tuple(16000, 44100, 16000, 44100, 15, 15), - std::make_tuple(16000, 32000, 48000, 32000, 25, 35), - std::make_tuple(16000, 32000, 32000, 32000, 25, 0), - std::make_tuple(16000, 32000, 16000, 32000, 25, 20), - std::make_tuple(16000, 16000, 48000, 16000, 35, 20), - std::make_tuple(16000, 16000, 32000, 16000, 35, 20), - std::make_tuple(16000, 16000, 16000, 16000, 0, 0))); + std::make_tuple(16000, 48000, 48000, 48000, 25, 0), + std::make_tuple(16000, 48000, 32000, 48000, 25, 30), + std::make_tuple(16000, 48000, 16000, 48000, 25, 20), + std::make_tuple(16000, 44100, 48000, 44100, 15, 20), + std::make_tuple(16000, 44100, 32000, 44100, 15, 15), + std::make_tuple(16000, 44100, 16000, 44100, 15, 15), + std::make_tuple(16000, 32000, 48000, 32000, 25, 35), + std::make_tuple(16000, 32000, 32000, 32000, 25, 0), + std::make_tuple(16000, 32000, 16000, 32000, 25, 20), + std::make_tuple(16000, 16000, 48000, 16000, 35, 20), + std::make_tuple(16000, 16000, 32000, 16000, 35, 20), + std::make_tuple(16000, 16000, 16000, 16000, 0, 0))); #endif } // namespace @@ -2582,7 +2582,7 @@ TEST(RuntimeSettingTest, TestUsageWithSwapQueue) { TEST(ApmConfiguration, EnablePostProcessing) { // Verify that apm uses a capture post processing module if one is provided. auto mock_post_processor_ptr = - new testing::NiceMock(); + new ::testing::NiceMock(); auto mock_post_processor = std::unique_ptr(mock_post_processor_ptr); rtc::scoped_refptr apm = @@ -2594,14 +2594,14 @@ TEST(ApmConfiguration, EnablePostProcessing) { audio.num_channels_ = 1; SetFrameSampleRate(&audio, AudioProcessing::NativeRate::kSampleRate16kHz); - EXPECT_CALL(*mock_post_processor_ptr, Process(testing::_)).Times(1); + EXPECT_CALL(*mock_post_processor_ptr, Process(::testing::_)).Times(1); apm->ProcessStream(&audio); } TEST(ApmConfiguration, EnablePreProcessing) { // Verify that apm uses a capture post processing module if one is provided. auto mock_pre_processor_ptr = - new testing::NiceMock(); + new ::testing::NiceMock(); auto mock_pre_processor = std::unique_ptr(mock_pre_processor_ptr); rtc::scoped_refptr apm = @@ -2613,14 +2613,14 @@ TEST(ApmConfiguration, EnablePreProcessing) { audio.num_channels_ = 1; SetFrameSampleRate(&audio, AudioProcessing::NativeRate::kSampleRate16kHz); - EXPECT_CALL(*mock_pre_processor_ptr, Process(testing::_)).Times(1); + EXPECT_CALL(*mock_pre_processor_ptr, Process(::testing::_)).Times(1); apm->ProcessReverseStream(&audio); } TEST(ApmConfiguration, EnableCaptureAnalyzer) { // Verify that apm uses a capture analyzer if one is provided. auto mock_capture_analyzer_ptr = - new testing::NiceMock(); + new ::testing::NiceMock(); auto mock_capture_analyzer = std::unique_ptr(mock_capture_analyzer_ptr); rtc::scoped_refptr apm = @@ -2632,13 +2632,13 @@ TEST(ApmConfiguration, EnableCaptureAnalyzer) { audio.num_channels_ = 1; SetFrameSampleRate(&audio, AudioProcessing::NativeRate::kSampleRate16kHz); - EXPECT_CALL(*mock_capture_analyzer_ptr, Analyze(testing::_)).Times(1); + EXPECT_CALL(*mock_capture_analyzer_ptr, Analyze(::testing::_)).Times(1); apm->ProcessStream(&audio); } TEST(ApmConfiguration, PreProcessingReceivesRuntimeSettings) { auto mock_pre_processor_ptr = - new testing::NiceMock(); + new ::testing::NiceMock(); auto mock_pre_processor = std::unique_ptr(mock_pre_processor_ptr); rtc::scoped_refptr apm = @@ -2654,7 +2654,8 @@ TEST(ApmConfiguration, PreProcessingReceivesRuntimeSettings) { audio.num_channels_ = 1; SetFrameSampleRate(&audio, AudioProcessing::NativeRate::kSampleRate16kHz); - EXPECT_CALL(*mock_pre_processor_ptr, SetRuntimeSetting(testing::_)).Times(1); + EXPECT_CALL(*mock_pre_processor_ptr, SetRuntimeSetting(::testing::_)) + .Times(1); apm->ProcessReverseStream(&audio); } @@ -2662,9 +2663,9 @@ class MyEchoControlFactory : public EchoControlFactory { public: std::unique_ptr Create(int sample_rate_hz) { auto ec = new test::MockEchoControl(); - EXPECT_CALL(*ec, AnalyzeRender(testing::_)).Times(1); - EXPECT_CALL(*ec, AnalyzeCapture(testing::_)).Times(2); - EXPECT_CALL(*ec, ProcessCapture(testing::_, testing::_)).Times(2); + EXPECT_CALL(*ec, AnalyzeRender(::testing::_)).Times(1); + EXPECT_CALL(*ec, AnalyzeCapture(::testing::_)).Times(2); + EXPECT_CALL(*ec, ProcessCapture(::testing::_, ::testing::_)).Times(2); return std::unique_ptr(ec); } }; diff --git a/modules/audio_processing/gain_control_config_proxy_unittest.cc b/modules/audio_processing/gain_control_config_proxy_unittest.cc index e5204e87cb..931c99ff81 100644 --- a/modules/audio_processing/gain_control_config_proxy_unittest.cc +++ b/modules/audio_processing/gain_control_config_proxy_unittest.cc @@ -16,23 +16,23 @@ #include "test/gtest.h" namespace webrtc { -class GainControlConfigProxyTest : public testing::Test { +class GainControlConfigProxyTest : public ::testing::Test { protected: GainControlConfigProxyTest() : apm_(new rtc::RefCountedObject< - testing::StrictMock>()), + ::testing::StrictMock>()), agc_(), proxy_(&lock_, apm_, &agc_) { EXPECT_CALL(*apm_, GetConfig()) - .WillRepeatedly(testing::ReturnPointee(&apm_config_)); - EXPECT_CALL(*apm_, ApplyConfig(testing::_)) - .WillRepeatedly(testing::SaveArg<0>(&apm_config_)); + .WillRepeatedly(::testing::ReturnPointee(&apm_config_)); + EXPECT_CALL(*apm_, ApplyConfig(::testing::_)) + .WillRepeatedly(::testing::SaveArg<0>(&apm_config_)); } GainControl* proxy() { return &proxy_; } rtc::scoped_refptr> apm_; - testing::StrictMock agc_; + ::testing::StrictMock agc_; AudioProcessing::Config apm_config_; private: @@ -48,7 +48,7 @@ TEST_F(GainControlConfigProxyTest, SetStreamAnalogLevel) { TEST_F(GainControlConfigProxyTest, StreamAnalogLevel) { EXPECT_CALL(*apm_, recommended_stream_analog_level()) - .WillOnce(testing::Return(100)); + .WillOnce(::testing::Return(100)); EXPECT_EQ(100, proxy()->stream_analog_level()); } @@ -82,8 +82,8 @@ TEST_F(GainControlConfigProxyTest, SetTargetLevelDbfs) { TEST_F(GainControlConfigProxyTest, SetCompressionGainDb) { AudioProcessing::RuntimeSetting setting; - EXPECT_CALL(*apm_, SetRuntimeSetting(testing::_)) - .WillOnce(testing::SaveArg<0>(&setting)); + EXPECT_CALL(*apm_, SetRuntimeSetting(::testing::_)) + .WillOnce(::testing::SaveArg<0>(&setting)); proxy()->set_compression_gain_db(17); EXPECT_EQ(AudioProcessing::RuntimeSetting::Type::kCaptureCompressionGain, setting.type()); @@ -107,53 +107,53 @@ TEST_F(GainControlConfigProxyTest, SetAnalogLevelLimits) { TEST_F(GainControlConfigProxyTest, GetEnabled) { EXPECT_CALL(agc_, is_enabled()) - .WillOnce(testing::Return(true)) - .WillOnce(testing::Return(false)); + .WillOnce(::testing::Return(true)) + .WillOnce(::testing::Return(false)); EXPECT_TRUE(proxy()->is_enabled()); EXPECT_FALSE(proxy()->is_enabled()); } TEST_F(GainControlConfigProxyTest, GetLimiterEnabled) { EXPECT_CALL(agc_, is_enabled()) - .WillOnce(testing::Return(true)) - .WillOnce(testing::Return(false)); + .WillOnce(::testing::Return(true)) + .WillOnce(::testing::Return(false)); EXPECT_TRUE(proxy()->is_enabled()); EXPECT_FALSE(proxy()->is_enabled()); } TEST_F(GainControlConfigProxyTest, GetCompressionGainDb) { - EXPECT_CALL(agc_, compression_gain_db()).WillOnce(testing::Return(17)); + EXPECT_CALL(agc_, compression_gain_db()).WillOnce(::testing::Return(17)); EXPECT_EQ(17, proxy()->compression_gain_db()); } TEST_F(GainControlConfigProxyTest, GetTargetLevelDbfs) { - EXPECT_CALL(agc_, target_level_dbfs()).WillOnce(testing::Return(17)); + EXPECT_CALL(agc_, target_level_dbfs()).WillOnce(::testing::Return(17)); EXPECT_EQ(17, proxy()->target_level_dbfs()); } TEST_F(GainControlConfigProxyTest, GetAnalogLevelMinimum) { - EXPECT_CALL(agc_, analog_level_minimum()).WillOnce(testing::Return(17)); + EXPECT_CALL(agc_, analog_level_minimum()).WillOnce(::testing::Return(17)); EXPECT_EQ(17, proxy()->analog_level_minimum()); } TEST_F(GainControlConfigProxyTest, GetAnalogLevelMaximum) { - EXPECT_CALL(agc_, analog_level_maximum()).WillOnce(testing::Return(17)); + EXPECT_CALL(agc_, analog_level_maximum()).WillOnce(::testing::Return(17)); EXPECT_EQ(17, proxy()->analog_level_maximum()); } TEST_F(GainControlConfigProxyTest, GetStreamIsSaturated) { EXPECT_CALL(agc_, stream_is_saturated()) - .WillOnce(testing::Return(true)) - .WillOnce(testing::Return(false)); + .WillOnce(::testing::Return(true)) + .WillOnce(::testing::Return(false)); EXPECT_TRUE(proxy()->stream_is_saturated()); EXPECT_FALSE(proxy()->stream_is_saturated()); } TEST_F(GainControlConfigProxyTest, GetMode) { EXPECT_CALL(agc_, mode()) - .WillOnce(testing::Return(GainControl::Mode::kAdaptiveAnalog)) - .WillOnce(testing::Return(GainControl::Mode::kAdaptiveDigital)) - .WillOnce(testing::Return(GainControl::Mode::kFixedDigital)); + .WillOnce(::testing::Return(GainControl::Mode::kAdaptiveAnalog)) + .WillOnce(::testing::Return(GainControl::Mode::kAdaptiveDigital)) + .WillOnce(::testing::Return(GainControl::Mode::kFixedDigital)); EXPECT_EQ(GainControl::Mode::kAdaptiveAnalog, proxy()->mode()); EXPECT_EQ(GainControl::Mode::kAdaptiveDigital, proxy()->mode()); EXPECT_EQ(GainControl::Mode::kFixedDigital, proxy()->mode()); diff --git a/modules/audio_processing/gain_controller2_unittest.cc b/modules/audio_processing/gain_controller2_unittest.cc index 258832acf5..46256d8bfc 100644 --- a/modules/audio_processing/gain_controller2_unittest.cc +++ b/modules/audio_processing/gain_controller2_unittest.cc @@ -202,8 +202,8 @@ struct FixedDigitalTestParams { }; class FixedDigitalTest - : public testing::Test, - public testing::WithParamInterface {}; + : public ::testing::Test, + public ::testing::WithParamInterface {}; TEST_P(FixedDigitalTest, CheckSaturationBehaviorWithLimiter) { const float kInputLevel = 32767.f; diff --git a/modules/audio_processing/include/mock_audio_processing.h b/modules/audio_processing/include/mock_audio_processing.h index 7504b5186c..141a8acf98 100644 --- a/modules/audio_processing/include/mock_audio_processing.h +++ b/modules/audio_processing/include/mock_audio_processing.h @@ -103,13 +103,13 @@ class MockVoiceDetection : public VoiceDetection { MOCK_CONST_METHOD0(frame_size_ms, int()); }; -class MockAudioProcessing : public testing::NiceMock { +class MockAudioProcessing : public ::testing::NiceMock { public: MockAudioProcessing() - : gain_control_(new testing::NiceMock()), - level_estimator_(new testing::NiceMock()), - noise_suppression_(new testing::NiceMock()), - voice_detection_(new testing::NiceMock()) {} + : gain_control_(new ::testing::NiceMock()), + level_estimator_(new ::testing::NiceMock()), + noise_suppression_(new ::testing::NiceMock()), + voice_detection_(new ::testing::NiceMock()) {} virtual ~MockAudioProcessing() {} diff --git a/modules/audio_processing/test/conversational_speech/generator_unittest.cc b/modules/audio_processing/test/conversational_speech/generator_unittest.cc index aacf2a2951..cad26562ca 100644 --- a/modules/audio_processing/test/conversational_speech/generator_unittest.cc +++ b/modules/audio_processing/test/conversational_speech/generator_unittest.cc @@ -167,7 +167,7 @@ void DeleteFolderAndContents(const std::string& dir) { } // namespace -using testing::_; +using ::testing::_; TEST(ConversationalSpeechTest, Settings) { const conversational_speech::Config config( @@ -223,7 +223,7 @@ TEST(ConversationalSpeechTest, MultiEndCallSetupDifferentSampleRates) { auto mock_wavreader_factory = CreateMockWavReaderFactory(); // There are two unique audio tracks to read. - EXPECT_CALL(*mock_wavreader_factory, Create(testing::_)).Times(2); + EXPECT_CALL(*mock_wavreader_factory, Create(::testing::_)).Times(2); MultiEndCall multiend_call( timing, audiotracks_path, std::move(mock_wavreader_factory)); @@ -237,7 +237,7 @@ TEST(ConversationalSpeechTest, MultiEndCallSetupMultipleChannels) { auto mock_wavreader_factory = CreateMockWavReaderFactory(); // There is one unique audio track to read. - EXPECT_CALL(*mock_wavreader_factory, Create(testing::_)).Times(1); + EXPECT_CALL(*mock_wavreader_factory, Create(::testing::_)).Times(1); MultiEndCall multiend_call( timing, audiotracks_path, std::move(mock_wavreader_factory)); @@ -252,7 +252,7 @@ TEST(ConversationalSpeechTest, auto mock_wavreader_factory = CreateMockWavReaderFactory(); // There are two unique audio tracks to read. - EXPECT_CALL(*mock_wavreader_factory, Create(testing::_)).Times(2); + EXPECT_CALL(*mock_wavreader_factory, Create(::testing::_)).Times(2); MultiEndCall multiend_call( timing, audiotracks_path, std::move(mock_wavreader_factory)); diff --git a/modules/audio_processing/test/conversational_speech/mock_wavreader.cc b/modules/audio_processing/test/conversational_speech/mock_wavreader.cc index 58d68e68b2..1263e938c4 100644 --- a/modules/audio_processing/test/conversational_speech/mock_wavreader.cc +++ b/modules/audio_processing/test/conversational_speech/mock_wavreader.cc @@ -14,7 +14,7 @@ namespace webrtc { namespace test { namespace conversational_speech { -using testing::Return; +using ::testing::Return; MockWavReader::MockWavReader(int sample_rate, size_t num_channels, diff --git a/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc b/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc index a45e3bbfa7..96b5894dd0 100644 --- a/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc +++ b/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc @@ -18,8 +18,8 @@ namespace webrtc { namespace test { namespace conversational_speech { -using testing::_; -using testing::Invoke; +using ::testing::_; +using ::testing::Invoke; MockWavReaderFactory::MockWavReaderFactory( const Params& default_params, diff --git a/modules/audio_processing/test/debug_dump_test.cc b/modules/audio_processing/test/debug_dump_test.cc index 368449553f..ff08e5de71 100644 --- a/modules/audio_processing/test/debug_dump_test.cc +++ b/modules/audio_processing/test/debug_dump_test.cc @@ -375,9 +375,9 @@ TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) { if (event->type() == audioproc::Event::CONFIG) { const audioproc::Config* msg = &event->config(); ASSERT_TRUE(msg->has_experiments_description()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "RefinedAdaptiveFilter", msg->experiments_description().c_str()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "Legacy AEC", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "Legacy AEC", msg->experiments_description().c_str()); } } @@ -404,11 +404,11 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { if (event->type() == audioproc::Event::CONFIG) { const audioproc::Config* msg = &event->config(); ASSERT_TRUE(msg->has_experiments_description()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "EchoController", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "EchoController", msg->experiments_description().c_str()); - EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "Legacy AEC", + EXPECT_PRED_FORMAT2(::testing::IsNotSubstring, "Legacy AEC", msg->experiments_description().c_str()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "AgcClippingLevelExperiment", msg->experiments_description().c_str()); } } @@ -434,9 +434,10 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { if (event->type() == audioproc::Event::CONFIG) { const audioproc::Config* msg = &event->config(); ASSERT_TRUE(msg->has_experiments_description()); - EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "EchoController", + EXPECT_PRED_FORMAT2(::testing::IsNotSubstring, "EchoController", msg->experiments_description().c_str()); - EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AgcClippingLevelExperiment", + EXPECT_PRED_FORMAT2(::testing::IsNotSubstring, + "AgcClippingLevelExperiment", msg->experiments_description().c_str()); } } @@ -461,9 +462,9 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { if (event->type() == audioproc::Event::CONFIG) { const audioproc::Config* msg = &event->config(); ASSERT_TRUE(msg->has_experiments_description()); - EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "Legacy AEC", + EXPECT_PRED_FORMAT2(::testing::IsNotSubstring, "Legacy AEC", msg->experiments_description().c_str()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "EchoController", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "EchoController", msg->experiments_description().c_str()); } } @@ -488,7 +489,7 @@ TEST_F(DebugDumpTest, VerifyAgcClippingLevelExperimentalString) { if (event->type() == audioproc::Event::CONFIG) { const audioproc::Config* msg = &event->config(); ASSERT_TRUE(msg->has_experiments_description()); - EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment", + EXPECT_PRED_FORMAT2(::testing::IsSubstring, "AgcClippingLevelExperiment", msg->experiments_description().c_str()); } } diff --git a/modules/audio_processing/utility/pffft_wrapper_unittest.cc b/modules/audio_processing/utility/pffft_wrapper_unittest.cc index a3d6f357ec..9aed548934 100644 --- a/modules/audio_processing/utility/pffft_wrapper_unittest.cc +++ b/modules/audio_processing/utility/pffft_wrapper_unittest.cc @@ -125,7 +125,7 @@ TEST(PffftTest, CreateWrapperWithValidSize) { #if !defined(NDEBUG) && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -class PffftInvalidSizeTest : public testing::Test, +class PffftInvalidSizeTest : public ::testing::Test, public ::testing::WithParamInterface {}; TEST_P(PffftInvalidSizeTest, DoNotCreateRealWrapper) { diff --git a/modules/bitrate_controller/bitrate_controller_unittest.cc b/modules/bitrate_controller/bitrate_controller_unittest.cc index cdb9f30771..0f8621048f 100644 --- a/modules/bitrate_controller/bitrate_controller_unittest.cc +++ b/modules/bitrate_controller/bitrate_controller_unittest.cc @@ -94,7 +94,7 @@ class BitrateControllerTest : public ::testing::Test { TestBitrateObserver bitrate_observer_; std::unique_ptr controller_; RtcpBandwidthObserver* bandwidth_observer_; - testing::NiceMock event_log_; + ::testing::NiceMock event_log_; }; TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) { diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc b/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc index 2b01e175a4..0b0185c0e4 100644 --- a/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc +++ b/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc @@ -34,7 +34,7 @@ MATCHER(LossBasedBweUpdateWithBitrateAndLossFraction, "") { } void TestProbing(bool use_delay_based) { - testing::NiceMock event_log; + ::testing::NiceMock event_log; SendSideBandwidthEstimation bwe(&event_log); int64_t now_ms = 0; bwe.SetMinMaxBitrate(DataRate::bps(100000), DataRate::bps(1500000)); diff --git a/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc b/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc index bf6f99fff0..f8b3570978 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc +++ b/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc @@ -17,15 +17,15 @@ #include "test/gtest.h" #include "test/scenario/scenario.h" -using testing::Field; -using testing::Matcher; -using testing::AllOf; -using testing::Ge; -using testing::Le; -using testing::NiceMock; -using testing::Property; -using testing::StrictMock; -using testing::_; +using ::testing::_; +using ::testing::AllOf; +using ::testing::Field; +using ::testing::Ge; +using ::testing::Le; +using ::testing::Matcher; +using ::testing::NiceMock; +using ::testing::Property; +using ::testing::StrictMock; namespace webrtc { namespace test { diff --git a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator_unittest.cc b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator_unittest.cc index 3061730c95..df6ad54e98 100644 --- a/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator_unittest.cc +++ b/modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator_unittest.cc @@ -19,10 +19,10 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::NiceMock; -using testing::InSequence; -using testing::Return; +using ::testing::_; +using ::testing::InSequence; +using ::testing::NiceMock; +using ::testing::Return; namespace webrtc { diff --git a/modules/congestion_controller/goog_cc/alr_detector_unittest.cc b/modules/congestion_controller/goog_cc/alr_detector_unittest.cc index 425268514d..2c8232c092 100644 --- a/modules/congestion_controller/goog_cc/alr_detector_unittest.cc +++ b/modules/congestion_controller/goog_cc/alr_detector_unittest.cc @@ -69,7 +69,7 @@ class SimulateOutgoingTrafficIn { }; } // namespace -class AlrDetectorTest : public testing::Test { +class AlrDetectorTest : public ::testing::Test { public: void SetUp() override { alr_detector_.SetEstimatedBitrate(kEstimatedBitrateBps); diff --git a/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc b/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc index 9be5b21ea6..bd9f7e101c 100644 --- a/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc +++ b/modules/congestion_controller/goog_cc/congestion_window_pushback_controller_unittest.cc @@ -13,7 +13,7 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; +using ::testing::_; namespace webrtc { namespace test { diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc index 000ff9ee1d..1831f5daab 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc @@ -16,11 +16,11 @@ #include "test/gtest.h" #include "test/scenario/scenario.h" -using testing::Field; -using testing::Matcher; -using testing::NiceMock; -using testing::Property; -using testing::_; +using ::testing::_; +using ::testing::Field; +using ::testing::Matcher; +using ::testing::NiceMock; +using ::testing::Property; namespace webrtc { namespace test { diff --git a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc index 46b661cb53..df806c21fd 100644 --- a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc +++ b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc @@ -21,12 +21,12 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::AtLeast; -using testing::Field; -using testing::Matcher; -using testing::NiceMock; -using testing::Return; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Field; +using ::testing::Matcher; +using ::testing::NiceMock; +using ::testing::Return; namespace webrtc { namespace test { diff --git a/modules/congestion_controller/pcc/bitrate_controller_unittest.cc b/modules/congestion_controller/pcc/bitrate_controller_unittest.cc index 7811ab0d05..3f80e21174 100644 --- a/modules/congestion_controller/pcc/bitrate_controller_unittest.cc +++ b/modules/congestion_controller/pcc/bitrate_controller_unittest.cc @@ -109,10 +109,10 @@ TEST(PccBitrateControllerTest, IncreaseRateWhenNoChangesForTestBitrates) { TEST(PccBitrateControllerTest, NoChangesWhenUtilityFunctionDoesntChange) { std::unique_ptr mock_utility_function = absl::make_unique(); - EXPECT_CALL(*mock_utility_function, Compute(testing::_)) + EXPECT_CALL(*mock_utility_function, Compute(::testing::_)) .Times(2) - .WillOnce(testing::Return(100)) - .WillOnce(testing::Return(100)); + .WillOnce(::testing::Return(100)) + .WillOnce(::testing::Return(100)); PccBitrateController bitrate_controller( kInitialConversionFactor, kInitialDynamicBoundary, @@ -144,10 +144,10 @@ TEST(PccBitrateControllerTest, NoBoundaryWhenSmallGradient) { const double kSecondMonitorIntervalUtility = 2 * kTargetSendingRate.bps() * kEpsilon; - EXPECT_CALL(*mock_utility_function, Compute(testing::_)) + EXPECT_CALL(*mock_utility_function, Compute(::testing::_)) .Times(2) - .WillOnce(testing::Return(kFirstMonitorIntervalUtility)) - .WillOnce(testing::Return(kSecondMonitorIntervalUtility)); + .WillOnce(::testing::Return(kFirstMonitorIntervalUtility)) + .WillOnce(::testing::Return(kSecondMonitorIntervalUtility)); PccBitrateController bitrate_controller( kInitialConversionFactor, kInitialDynamicBoundary, @@ -182,12 +182,12 @@ TEST(PccBitrateControllerTest, FaceBoundaryWhenLargeGradient) { 10 * kInitialDynamicBoundary * kTargetSendingRate.bps() * 2 * kTargetSendingRate.bps() * kEpsilon; - EXPECT_CALL(*mock_utility_function, Compute(testing::_)) + EXPECT_CALL(*mock_utility_function, Compute(::testing::_)) .Times(4) - .WillOnce(testing::Return(kFirstMonitorIntervalUtility)) - .WillOnce(testing::Return(kSecondMonitorIntervalUtility)) - .WillOnce(testing::Return(kFirstMonitorIntervalUtility)) - .WillOnce(testing::Return(kSecondMonitorIntervalUtility)); + .WillOnce(::testing::Return(kFirstMonitorIntervalUtility)) + .WillOnce(::testing::Return(kSecondMonitorIntervalUtility)) + .WillOnce(::testing::Return(kFirstMonitorIntervalUtility)) + .WillOnce(::testing::Return(kSecondMonitorIntervalUtility)); PccBitrateController bitrate_controller( kInitialConversionFactor, kInitialDynamicBoundary, @@ -220,16 +220,16 @@ TEST(PccBitrateControllerTest, SlowStartMode) { std::unique_ptr mock_utility_function = absl::make_unique(); constexpr double kFirstUtilityFunction = 1000; - EXPECT_CALL(*mock_utility_function, Compute(testing::_)) + EXPECT_CALL(*mock_utility_function, Compute(::testing::_)) .Times(4) // For first 3 calls we expect to stay in the SLOW_START mode and double // the sending rate since the utility function increases its value. For // the last call utility function decreases its value, this means that // we should not double the sending rate and exit SLOW_START mode. - .WillOnce(testing::Return(kFirstUtilityFunction)) - .WillOnce(testing::Return(kFirstUtilityFunction + 1)) - .WillOnce(testing::Return(kFirstUtilityFunction + 2)) - .WillOnce(testing::Return(kFirstUtilityFunction + 1)); + .WillOnce(::testing::Return(kFirstUtilityFunction)) + .WillOnce(::testing::Return(kFirstUtilityFunction + 1)) + .WillOnce(::testing::Return(kFirstUtilityFunction + 2)) + .WillOnce(::testing::Return(kFirstUtilityFunction + 1)); PccBitrateController bitrate_controller( kInitialConversionFactor, kInitialDynamicBoundary, @@ -260,12 +260,12 @@ TEST(PccBitrateControllerTest, StepSizeIncrease) { const double kSecondMiUtilityFunction = 2 * kTargetSendingRate.bps() * kEpsilon; - EXPECT_CALL(*mock_utility_function, Compute(testing::_)) + EXPECT_CALL(*mock_utility_function, Compute(::testing::_)) .Times(4) - .WillOnce(testing::Return(kFirstMiUtilityFunction)) - .WillOnce(testing::Return(kSecondMiUtilityFunction)) - .WillOnce(testing::Return(kFirstMiUtilityFunction)) - .WillOnce(testing::Return(kSecondMiUtilityFunction)); + .WillOnce(::testing::Return(kFirstMiUtilityFunction)) + .WillOnce(::testing::Return(kSecondMiUtilityFunction)) + .WillOnce(::testing::Return(kFirstMiUtilityFunction)) + .WillOnce(::testing::Return(kSecondMiUtilityFunction)); std::vector monitor_block{ PccMonitorInterval(kTargetSendingRate * (1 + kEpsilon), kStartTime, kIntervalDuration), diff --git a/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc b/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc index cb4e6808c3..f7ee78cfb1 100644 --- a/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc +++ b/modules/congestion_controller/pcc/pcc_network_controller_unittest.cc @@ -17,12 +17,12 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::Field; -using testing::Matcher; -using testing::AllOf; -using testing::Ge; -using testing::Le; -using testing::Property; +using ::testing::AllOf; +using ::testing::Field; +using ::testing::Ge; +using ::testing::Le; +using ::testing::Matcher; +using ::testing::Property; namespace webrtc { namespace test { diff --git a/modules/congestion_controller/receive_side_congestion_controller_unittest.cc b/modules/congestion_controller/receive_side_congestion_controller_unittest.cc index 4b5a66fb0f..632b762403 100644 --- a/modules/congestion_controller/receive_side_congestion_controller_unittest.cc +++ b/modules/congestion_controller/receive_side_congestion_controller_unittest.cc @@ -14,12 +14,12 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::AtLeast; -using testing::NiceMock; -using testing::Return; -using testing::SaveArg; -using testing::StrictMock; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; +using ::testing::StrictMock; namespace webrtc { diff --git a/modules/congestion_controller/send_side_congestion_controller_unittest.cc b/modules/congestion_controller/send_side_congestion_controller_unittest.cc index e959b5342b..f617e564e2 100644 --- a/modules/congestion_controller/send_side_congestion_controller_unittest.cc +++ b/modules/congestion_controller/send_side_congestion_controller_unittest.cc @@ -24,13 +24,13 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::AtLeast; -using testing::Ge; -using testing::NiceMock; -using testing::Return; -using testing::SaveArg; -using testing::StrictMock; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Ge; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; +using ::testing::StrictMock; namespace webrtc { @@ -216,7 +216,7 @@ TEST_F(LegacySendSideCongestionControllerTest, SignalNetworkState) { TEST_F(LegacySendSideCongestionControllerTest, OnNetworkRouteChanged) { int new_bitrate = 200000; - testing::Mock::VerifyAndClearExpectations(pacer_.get()); + ::testing::Mock::VerifyAndClearExpectations(pacer_.get()); EXPECT_CALL(observer_, OnNetworkChanged(new_bitrate, _, _, _)); EXPECT_CALL(*pacer_, SetEstimatedBitrate(new_bitrate)); rtc::NetworkRoute route; @@ -236,7 +236,7 @@ TEST_F(LegacySendSideCongestionControllerTest, OnNetworkRouteChanged) { TEST_F(LegacySendSideCongestionControllerTest, OldFeedback) { int new_bitrate = 200000; - testing::Mock::VerifyAndClearExpectations(pacer_.get()); + ::testing::Mock::VerifyAndClearExpectations(pacer_.get()); EXPECT_CALL(observer_, OnNetworkChanged(new_bitrate, _, _, _)); EXPECT_CALL(*pacer_, SetEstimatedBitrate(new_bitrate)); @@ -326,7 +326,7 @@ TEST_F(LegacySendSideCongestionControllerTest, GetProbingInterval) { clock_.AdvanceTimeMilliseconds(25); controller_->Process(); - EXPECT_CALL(observer_, OnNetworkChanged(_, _, _, testing::Ne(0))); + EXPECT_CALL(observer_, OnNetworkChanged(_, _, _, ::testing::Ne(0))); EXPECT_CALL(*pacer_, SetEstimatedBitrate(_)); bandwidth_observer_->OnReceivedEstimatedBitrate(kInitialBitrateBps * 2); clock_.AdvanceTimeMilliseconds(25); @@ -334,7 +334,7 @@ TEST_F(LegacySendSideCongestionControllerTest, GetProbingInterval) { } TEST_F(LegacySendSideCongestionControllerTest, ProbeOnRouteChange) { - testing::Mock::VerifyAndClearExpectations(pacer_.get()); + ::testing::Mock::VerifyAndClearExpectations(pacer_.get()); EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 6, _)); EXPECT_CALL(*pacer_, CreateProbeCluster(kInitialBitrateBps * 12, _)); EXPECT_CALL(observer_, OnNetworkChanged(kInitialBitrateBps * 2, _, _, _)); diff --git a/modules/desktop_capture/blank_detector_desktop_capturer_wrapper_unittest.cc b/modules/desktop_capture/blank_detector_desktop_capturer_wrapper_unittest.cc index d2393a210b..25a81edd89 100644 --- a/modules/desktop_capture/blank_detector_desktop_capturer_wrapper_unittest.cc +++ b/modules/desktop_capture/blank_detector_desktop_capturer_wrapper_unittest.cc @@ -24,7 +24,7 @@ namespace webrtc { class BlankDetectorDesktopCapturerWrapperTest - : public testing::Test, + : public ::testing::Test, public DesktopCapturer::Callback { public: BlankDetectorDesktopCapturerWrapperTest(); diff --git a/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc b/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc index f1a2860461..ac4fd0ac3d 100644 --- a/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc +++ b/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc @@ -173,7 +173,7 @@ void VerifyFrame(const DesktopFrame& frame, } // namespace -class DesktopAndCursorComposerTest : public testing::Test, +class DesktopAndCursorComposerTest : public ::testing::Test, public DesktopCapturer::Callback { public: DesktopAndCursorComposerTest() diff --git a/modules/desktop_capture/desktop_capturer_differ_wrapper_unittest.cc b/modules/desktop_capture/desktop_capturer_differ_wrapper_unittest.cc index 0ae46f5ad4..d16390dee4 100644 --- a/modules/desktop_capture/desktop_capturer_differ_wrapper_unittest.cc +++ b/modules/desktop_capture/desktop_capturer_differ_wrapper_unittest.cc @@ -117,21 +117,22 @@ void ExecuteDifferWrapperCase(BlackWhiteDesktopFramePainter* frame_painter, const T& updated_region, bool check_result, bool exactly_match) { - EXPECT_CALL(*callback, - OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, testing::_)) + EXPECT_CALL(*callback, OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, + ::testing::_)) .Times(1) - .WillOnce(testing::Invoke([&updated_region, check_result, exactly_match]( - DesktopCapturer::Result result, - std::unique_ptr* frame) { - ASSERT_EQ(result, DesktopCapturer::Result::SUCCESS); - if (check_result) { - if (exactly_match) { - AssertUpdatedRegionIs(**frame, updated_region); - } else { - AssertUpdatedRegionCovers(**frame, updated_region); - } - } - })); + .WillOnce( + ::testing::Invoke([&updated_region, check_result, exactly_match]( + DesktopCapturer::Result result, + std::unique_ptr* frame) { + ASSERT_EQ(result, DesktopCapturer::Result::SUCCESS); + if (check_result) { + if (exactly_match) { + AssertUpdatedRegionIs(**frame, updated_region); + } else { + AssertUpdatedRegionCovers(**frame, updated_region); + } + } + })); for (const auto& rect : updated_region) { frame_painter->updated_region()->AddRect(rect); } @@ -143,8 +144,8 @@ void ExecuteDifferWrapperCase(BlackWhiteDesktopFramePainter* frame_painter, // DesktopFrame into black. void ExecuteCapturer(DesktopCapturerDifferWrapper* capturer, MockDesktopCapturerCallback* callback) { - EXPECT_CALL(*callback, - OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, testing::_)) + EXPECT_CALL(*callback, OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, + ::testing::_)) .Times(1); capturer->CaptureFrame(); } @@ -168,11 +169,11 @@ void ExecuteDifferWrapperTest(bool with_hints, capturer.Start(&callback); - EXPECT_CALL(callback, - OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, testing::_)) + EXPECT_CALL(callback, OnCaptureResultPtr(DesktopCapturer::Result::SUCCESS, + ::testing::_)) .Times(1) - .WillOnce(testing::Invoke([](DesktopCapturer::Result result, - std::unique_ptr* frame) { + .WillOnce(::testing::Invoke([](DesktopCapturer::Result result, + std::unique_ptr* frame) { ASSERT_EQ(result, DesktopCapturer::Result::SUCCESS); AssertUpdatedRegionIs(**frame, {DesktopRect::MakeSize((*frame)->size())}); diff --git a/modules/desktop_capture/fallback_desktop_capturer_wrapper_unittest.cc b/modules/desktop_capture/fallback_desktop_capturer_wrapper_unittest.cc index bc5715d0d0..36fa69dc62 100644 --- a/modules/desktop_capture/fallback_desktop_capturer_wrapper_unittest.cc +++ b/modules/desktop_capture/fallback_desktop_capturer_wrapper_unittest.cc @@ -65,7 +65,7 @@ std::unique_ptr FakeSharedMemoryFactory::CreateSharedMemory( } // namespace -class FallbackDesktopCapturerWrapperTest : public testing::Test, +class FallbackDesktopCapturerWrapperTest : public ::testing::Test, public DesktopCapturer::Callback { public: FallbackDesktopCapturerWrapperTest(); diff --git a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc index 2d1039a334..c42ab35a2e 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc +++ b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc @@ -22,7 +22,7 @@ namespace webrtc { -class MouseCursorMonitorTest : public testing::Test, +class MouseCursorMonitorTest : public ::testing::Test, public MouseCursorMonitor::Callback { public: MouseCursorMonitorTest() : position_received_(false) {} diff --git a/modules/desktop_capture/screen_capturer_helper_unittest.cc b/modules/desktop_capture/screen_capturer_helper_unittest.cc index 1ce4959e76..165bbe42de 100644 --- a/modules/desktop_capture/screen_capturer_helper_unittest.cc +++ b/modules/desktop_capture/screen_capturer_helper_unittest.cc @@ -14,7 +14,7 @@ namespace webrtc { -class ScreenCapturerHelperTest : public testing::Test { +class ScreenCapturerHelperTest : public ::testing::Test { protected: ScreenCapturerHelper capturer_helper_; }; diff --git a/modules/desktop_capture/screen_capturer_integration_test.cc b/modules/desktop_capture/screen_capturer_integration_test.cc index cb0e47530b..f9745b9d6b 100644 --- a/modules/desktop_capture/screen_capturer_integration_test.cc +++ b/modules/desktop_capture/screen_capturer_integration_test.cc @@ -78,7 +78,7 @@ bool ArePixelsColoredBy(const DesktopFrame& frame, } // namespace -class ScreenCapturerIntegrationTest : public testing::Test { +class ScreenCapturerIntegrationTest : public ::testing::Test { public: void SetUp() override { capturer_ = DesktopCapturer::CreateScreenCapturer( @@ -270,7 +270,7 @@ class ScreenCapturerIntegrationTest : public testing::Test { EXPECT_CALL(callback_, OnCaptureResultPtr(_, _)) .WillOnce(SaveCaptureResult(&result, &frame)); capturer->CaptureFrame(); - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); if (result == DesktopCapturer::Result::SUCCESS) { EXPECT_TRUE(frame); return frame; diff --git a/modules/desktop_capture/screen_capturer_mac_unittest.cc b/modules/desktop_capture/screen_capturer_mac_unittest.cc index 812f230a06..96e844066a 100644 --- a/modules/desktop_capture/screen_capturer_mac_unittest.cc +++ b/modules/desktop_capture/screen_capturer_mac_unittest.cc @@ -28,7 +28,7 @@ using ::testing::Return; namespace webrtc { -class ScreenCapturerMacTest : public testing::Test { +class ScreenCapturerMacTest : public ::testing::Test { public: // Verifies that the whole screen is initially dirty. void CaptureDoneCallback1(DesktopCapturer::Result result, diff --git a/modules/desktop_capture/screen_capturer_unittest.cc b/modules/desktop_capture/screen_capturer_unittest.cc index a0b7cc5118..4d1dc6d93c 100644 --- a/modules/desktop_capture/screen_capturer_unittest.cc +++ b/modules/desktop_capture/screen_capturer_unittest.cc @@ -30,7 +30,7 @@ const int kTestSharedMemoryId = 123; namespace webrtc { -class ScreenCapturerTest : public testing::Test { +class ScreenCapturerTest : public ::testing::Test { public: void SetUp() override { capturer_ = DesktopCapturer::CreateScreenCapturer( diff --git a/modules/desktop_capture/window_capturer_unittest.cc b/modules/desktop_capture/window_capturer_unittest.cc index 05b6963bc9..a806ada32e 100644 --- a/modules/desktop_capture/window_capturer_unittest.cc +++ b/modules/desktop_capture/window_capturer_unittest.cc @@ -21,7 +21,7 @@ namespace webrtc { -class WindowCapturerTest : public testing::Test, +class WindowCapturerTest : public ::testing::Test, public DesktopCapturer::Callback { public: void SetUp() override { diff --git a/modules/pacing/paced_sender_unittest.cc b/modules/pacing/paced_sender_unittest.cc index 158a5fb453..234a29f56d 100644 --- a/modules/pacing/paced_sender_unittest.cc +++ b/modules/pacing/paced_sender_unittest.cc @@ -19,9 +19,9 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::Field; -using testing::Return; +using ::testing::_; +using ::testing::Field; +using ::testing::Return; namespace { constexpr unsigned kFirstClusterBps = 900000; @@ -106,7 +106,7 @@ class PacedSenderProbing : public PacedSender::PacketSender { int padding_sent_; }; -class PacedSenderTest : public testing::TestWithParam { +class PacedSenderTest : public ::testing::TestWithParam { protected: PacedSenderTest() : clock_(123456) { srand(0); @@ -141,7 +141,7 @@ class PacedSenderTest : public testing::TestWithParam { std::unique_ptr send_bucket_; }; -class PacedSenderFieldTrialTest : public testing::Test { +class PacedSenderFieldTrialTest : public ::testing::Test { protected: struct MediaStream { const RtpPacketSender::Priority priority; @@ -215,7 +215,7 @@ TEST_F(PacedSenderFieldTrialTest, DefaultCongestionWindowAffectsAudio) { ProcessNext(&pacer); ProcessNext(&pacer); // Audio packet unblocked when congestion window clear. - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); pacer.UpdateOutstandingData(0); EXPECT_CALL(callback_, TimeToSendPacket).WillOnce(Return(true)); ProcessNext(&pacer); @@ -251,7 +251,7 @@ TEST_F(PacedSenderFieldTrialTest, DefaultBudgetAffectsAudio) { InsertPacket(&pacer, &audio); ProcessNext(&pacer); ProcessNext(&pacer); - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); // Audio packet unblocked when the budget has recovered. EXPECT_CALL(callback_, TimeToSendPacket).WillOnce(Return(true)); ProcessNext(&pacer); @@ -699,7 +699,7 @@ TEST_F(PacedSenderTest, SendsOnlyPaddingWhenCongested) { clock_.AdvanceTimeMilliseconds(5); send_bucket_->Process(); } - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, _)).Times(0); EXPECT_CALL(callback_, TimeToSendPadding(_, _)).Times(0); @@ -714,7 +714,7 @@ TEST_F(PacedSenderTest, SendsOnlyPaddingWhenCongested) { send_bucket_->Process(); expected_time_until_padding -= 5; } - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); EXPECT_CALL(callback_, TimeToSendPadding(1, _)).Times(1); clock_.AdvanceTimeMilliseconds(5); send_bucket_->Process(); @@ -781,7 +781,7 @@ TEST_F(PacedSenderTest, ResumesSendingWhenCongestionEnds) { clock_.AdvanceTimeMilliseconds(5); send_bucket_->Process(); } - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); EXPECT_CALL(callback_, TimeToSendPacket(_, _, _, _, _)).Times(0); int unacked_packets = 0; for (int duration = 0; duration < kCongestionTimeMs; duration += 5) { @@ -792,7 +792,7 @@ TEST_F(PacedSenderTest, ResumesSendingWhenCongestionEnds) { clock_.AdvanceTimeMilliseconds(5); send_bucket_->Process(); } - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); // First mark half of the congested packets as cleared and make sure that just // as many are sent @@ -808,7 +808,7 @@ TEST_F(PacedSenderTest, ResumesSendingWhenCongestionEnds) { send_bucket_->Process(); } unacked_packets -= ack_count; - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); // Second make sure all packets are sent if sent packets are continuously // marked as acked. @@ -882,11 +882,11 @@ TEST_F(PacedSenderTest, Pause) { clock_.AdvanceTimeMilliseconds(5); expected_time_until_send -= 5; } - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); EXPECT_CALL(callback_, TimeToSendPadding(1, _)).Times(1); clock_.AdvanceTimeMilliseconds(5); send_bucket_->Process(); - testing::Mock::VerifyAndClearExpectations(&callback_); + ::testing::Mock::VerifyAndClearExpectations(&callback_); // Expect high prio packets to come out first followed by normal // prio packets and low prio packets (all in capture order). diff --git a/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc b/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc index e66b9c943c..2dafdbfc73 100644 --- a/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc +++ b/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc @@ -83,7 +83,7 @@ class RemoteEstimatorProxyTest : public ::testing::Test { } SimulatedClock clock_; - testing::StrictMock router_; + ::testing::StrictMock router_; RemoteEstimatorProxy proxy_; }; diff --git a/modules/rtp_rtcp/source/flexfec_receiver_unittest.cc b/modules/rtp_rtcp/source/flexfec_receiver_unittest.cc index d19e575202..805bc6405a 100644 --- a/modules/rtp_rtcp/source/flexfec_receiver_unittest.cc +++ b/modules/rtp_rtcp/source/flexfec_receiver_unittest.cc @@ -79,7 +79,7 @@ class FlexfecReceiverTest : public ::testing::Test { std::unique_ptr erasure_code_; FlexfecPacketGenerator packet_generator_; - testing::StrictMock recovered_packet_receiver_; + ::testing::StrictMock recovered_packet_receiver_; }; void FlexfecReceiverTest::PacketizeFrame(size_t num_media_packets, diff --git a/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc index 00944b3a33..448c2d4194 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc @@ -14,7 +14,7 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAre; +using ::testing::ElementsAre; using webrtc::rtcp::Bye; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report_unittest.cc index 7598fefed1..3fd7d20397 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report_unittest.cc @@ -14,8 +14,8 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAre; -using testing::IsEmpty; +using ::testing::ElementsAre; +using ::testing::IsEmpty; using webrtc::rtcp::ExtendedJitterReport; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/extended_reports_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/extended_reports_unittest.cc index 7052787178..a302a5b552 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/extended_reports_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/extended_reports_unittest.cc @@ -15,10 +15,10 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAre; -using testing::ElementsAreArray; -using testing::make_tuple; -using testing::SizeIs; +using ::testing::ElementsAre; +using ::testing::ElementsAreArray; +using ::testing::make_tuple; +using ::testing::SizeIs; using webrtc::rtcp::Dlrr; using webrtc::rtcp::ExtendedReports; using webrtc::rtcp::ReceiveTimeInfo; diff --git a/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc index d9eb465fd9..01593e12ba 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/fir_unittest.cc @@ -14,12 +14,12 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::AllOf; -using testing::ElementsAre; -using testing::ElementsAreArray; -using testing::Eq; -using testing::Field; -using testing::make_tuple; +using ::testing::AllOf; +using ::testing::ElementsAre; +using ::testing::ElementsAreArray; +using ::testing::Eq; +using ::testing::Field; +using ::testing::make_tuple; using webrtc::rtcp::Fir; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/pli_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/pli_unittest.cc index 67e614dd3c..c971e22bc1 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/pli_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/pli_unittest.cc @@ -14,8 +14,8 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::make_tuple; using webrtc::rtcp::Pli; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request_unittest.cc index f10f93ea20..d0e40fd83d 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request_unittest.cc @@ -14,8 +14,8 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::make_tuple; using webrtc::rtcp::RapidResyncRequest; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/receiver_report_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/receiver_report_unittest.cc index fb434d9840..23ea49622b 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/receiver_report_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/receiver_report_unittest.cc @@ -16,9 +16,9 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::IsEmpty; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::IsEmpty; +using ::testing::make_tuple; using webrtc::rtcp::ReceiverReport; using webrtc::rtcp::ReportBlock; diff --git a/modules/rtp_rtcp/source/rtcp_packet/remb_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/remb_unittest.cc index c939d9b41c..ed5f48fec6 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/remb_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/remb_unittest.cc @@ -14,9 +14,9 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::IsEmpty; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::IsEmpty; +using ::testing::make_tuple; using webrtc::rtcp::Remb; namespace webrtc { diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/sender_report_unittest.cc index a0c6e725f0..37f268e6b4 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/sender_report_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report_unittest.cc @@ -16,8 +16,8 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::make_tuple; using webrtc::rtcp::ReportBlock; using webrtc::rtcp::SenderReport; diff --git a/modules/rtp_rtcp/source/rtcp_packet/tmmbn_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/tmmbn_unittest.cc index e5d2e0bdd6..3a37bb1c0e 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/tmmbn_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/tmmbn_unittest.cc @@ -14,9 +14,9 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::IsEmpty; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::IsEmpty; +using ::testing::make_tuple; using webrtc::rtcp::TmmbItem; using webrtc::rtcp::Tmmbn; diff --git a/modules/rtp_rtcp/source/rtcp_packet/tmmbr_unittest.cc b/modules/rtp_rtcp/source/rtcp_packet/tmmbr_unittest.cc index 63fa9116ff..a320f2367a 100644 --- a/modules/rtp_rtcp/source/rtcp_packet/tmmbr_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_packet/tmmbr_unittest.cc @@ -14,9 +14,9 @@ #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -using testing::ElementsAreArray; -using testing::IsEmpty; -using testing::make_tuple; +using ::testing::ElementsAreArray; +using ::testing::IsEmpty; +using ::testing::make_tuple; using webrtc::rtcp::TmmbItem; using webrtc::rtcp::Tmmbr; diff --git a/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_unittest.cc index 11a71a07c5..3d9550b22e 100644 --- a/modules/rtp_rtcp/source/rtp_sender_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_sender_unittest.cc @@ -201,11 +201,12 @@ class RtpSenderTest : public ::testing::TestWithParam { } SimulatedClock fake_clock_; - testing::NiceMock mock_rtc_event_log_; + ::testing::NiceMock mock_rtc_event_log_; MockRtpPacketSender mock_paced_sender_; - testing::StrictMock seq_num_allocator_; - testing::StrictMock send_packet_observer_; - testing::StrictMock feedback_observer_; + ::testing::StrictMock + seq_num_allocator_; + ::testing::StrictMock send_packet_observer_; + ::testing::StrictMock feedback_observer_; RateLimiter retransmission_rate_limiter_; std::unique_ptr rtp_sender_; LoopbackTransportTest transport_; @@ -346,14 +347,14 @@ TEST_P(RtpSenderTest, AssignSequenceNumberAllowsPaddingOnAudio) { const size_t kPaddingSize = 59; EXPECT_CALL(transport, SendRtp(_, kPaddingSize + kRtpHeaderSize, _)) - .WillOnce(testing::Return(true)); + .WillOnce(::testing::Return(true)); EXPECT_EQ(kPaddingSize, rtp_sender_->TimeToSendPadding(kPaddingSize, PacedPacketInfo())); // Requested padding size is too small, will send a larger one. const size_t kMinPaddingSize = 50; EXPECT_CALL(transport, SendRtp(_, kMinPaddingSize + kRtpHeaderSize, _)) - .WillOnce(testing::Return(true)); + .WillOnce(::testing::Return(true)); EXPECT_EQ(kMinPaddingSize, rtp_sender_->TimeToSendPadding(kMinPaddingSize - 5, PacedPacketInfo())); } @@ -376,7 +377,7 @@ TEST_P(RtpSenderTestWithoutPacer, AssignSequenceNumberSetPaddingTimestamps) { TEST_P(RtpSenderTestWithoutPacer, TransportFeedbackObserverGetsCorrectByteCount) { constexpr int kRtpOverheadBytesPerPacket = 12 + 8; - testing::NiceMock mock_overhead_observer; + ::testing::NiceMock mock_overhead_observer; rtp_sender_.reset( new RTPSender(false, &fake_clock_, &transport_, nullptr, absl::nullopt, &seq_num_allocator_, &feedback_observer_, nullptr, nullptr, @@ -388,7 +389,7 @@ TEST_P(RtpSenderTestWithoutPacer, kRtpExtensionTransportSequenceNumber, kTransportSequenceNumberExtensionId)); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); const size_t expected_bytes = GetParam() ? sizeof(kPayloadData) + kRtpOverheadBytesPerPacket @@ -417,7 +418,7 @@ TEST_P(RtpSenderTestWithoutPacer, SendsPacketsWithTransportSequenceNumber) { kTransportSequenceNumberExtensionId)); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(send_packet_observer_, OnSendPacket(kTransportSequenceNumber, _, _)) .Times(1); @@ -457,7 +458,7 @@ TEST_P(RtpSenderTestWithoutPacer, rtp_sender_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber, kTransportSequenceNumberExtensionId); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(send_packet_observer_, OnSendPacket).Times(1); SendGenericPacket(); EXPECT_TRUE(transport_.last_options_.included_in_feedback); @@ -470,7 +471,7 @@ TEST_P( rtp_sender_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber, kTransportSequenceNumberExtensionId); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(send_packet_observer_, OnSendPacket).Times(1); SendGenericPacket(); EXPECT_TRUE(transport_.last_options_.included_in_allocation); @@ -493,7 +494,7 @@ TEST_P(RtpSenderTestWithoutPacer, DoesnSetIncludedInAllocationByDefault) { } TEST_P(RtpSenderTestWithoutPacer, OnSendSideDelayUpdated) { - testing::StrictMock send_side_delay_observer_; + ::testing::StrictMock send_side_delay_observer_; rtp_sender_.reset( new RTPSender(false, &fake_clock_, &transport_, nullptr, absl::nullopt, nullptr, nullptr, nullptr, &send_side_delay_observer_, @@ -567,7 +568,7 @@ TEST_P(RtpSenderTestWithoutPacer, OnSendPacketUpdated) { kRtpExtensionTransportSequenceNumber, kTransportSequenceNumberExtensionId)); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(send_packet_observer_, OnSendPacket(kTransportSequenceNumber, _, _)) .Times(1); @@ -591,7 +592,7 @@ TEST_P(RtpSenderTest, SendsPacketsWithTransportSequenceNumber) { EXPECT_CALL(mock_paced_sender_, InsertPacket(_, kSsrc, kSeqNum, _, _, _)); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(send_packet_observer_, OnSendPacket(kTransportSequenceNumber, _, _)) .Times(1); @@ -928,7 +929,7 @@ TEST_P(RtpSenderTest, OnSendPacketUpdated) { OnSendPacket(kTransportSequenceNumber, _, _)) .Times(1); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(mock_paced_sender_, InsertPacket(_, kSsrc, kSeqNum, _, _, _)) .Times(1); @@ -948,7 +949,7 @@ TEST_P(RtpSenderTest, OnSendPacketNotUpdatedForRetransmits) { EXPECT_CALL(send_packet_observer_, OnSendPacket(_, _, _)).Times(0); EXPECT_CALL(seq_num_allocator_, AllocateSequenceNumber()) - .WillOnce(testing::Return(kTransportSequenceNumber)); + .WillOnce(::testing::Return(kTransportSequenceNumber)); EXPECT_CALL(mock_paced_sender_, InsertPacket(_, kSsrc, kSeqNum, _, _, _)) .Times(1); @@ -1024,7 +1025,7 @@ TEST_P(RtpSenderTest, SendRedundantPayloads) { // Send 10 packets of increasing size. for (size_t i = 0; i < kNumPayloadSizes; ++i) { int64_t capture_time_ms = fake_clock_.TimeInMilliseconds(); - EXPECT_CALL(transport, SendRtp(_, _, _)).WillOnce(testing::Return(true)); + EXPECT_CALL(transport, SendRtp(_, _, _)).WillOnce(::testing::Return(true)); SendPacket(capture_time_ms, kPayloadSizes[i]); rtp_sender_->TimeToSendPacket(kSsrc, seq_num++, capture_time_ms, false, PacedPacketInfo()); @@ -1037,15 +1038,15 @@ TEST_P(RtpSenderTest, SendRedundantPayloads) { // The amount of padding to send it too small to send a payload packet. EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _)) - .WillOnce(testing::Return(true)); + .WillOnce(::testing::Return(true)); EXPECT_EQ(kMaxPaddingSize, rtp_sender_->TimeToSendPadding(49, PacedPacketInfo())); PacketOptions options; EXPECT_CALL(transport, SendRtp(_, kPayloadSizes[0] + rtp_header_len + kRtxHeaderSize, _)) - .WillOnce( - testing::DoAll(testing::SaveArg<2>(&options), testing::Return(true))); + .WillOnce(::testing::DoAll(::testing::SaveArg<2>(&options), + ::testing::Return(true))); EXPECT_EQ(kPayloadSizes[0], rtp_sender_->TimeToSendPadding(500, PacedPacketInfo())); EXPECT_TRUE(options.is_retransmit); @@ -1054,12 +1055,12 @@ TEST_P(RtpSenderTest, SendRedundantPayloads) { kPayloadSizes[kNumPayloadSizes - 1] + rtp_header_len + kRtxHeaderSize, _)) - .WillOnce(testing::Return(true)); + .WillOnce(::testing::Return(true)); options.is_retransmit = false; EXPECT_CALL(transport, SendRtp(_, kMaxPaddingSize + rtp_header_len, _)) - .WillOnce( - testing::DoAll(testing::SaveArg<2>(&options), testing::Return(true))); + .WillOnce(::testing::DoAll(::testing::SaveArg<2>(&options), + ::testing::Return(true))); EXPECT_EQ(kPayloadSizes[kNumPayloadSizes - 1] + kMaxPaddingSize, rtp_sender_->TimeToSendPadding(999, PacedPacketInfo())); EXPECT_FALSE(options.is_retransmit); @@ -1146,7 +1147,7 @@ TEST_P(RtpSenderTest, SendFlexfecPackets) { uint16_t flexfec_seq_num; EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kLowPriority, kFlexfecSsrc, _, _, _, false)) - .WillOnce(testing::SaveArg<2>(&flexfec_seq_num)); + .WillOnce(::testing::SaveArg<2>(&flexfec_seq_num)); RTPVideoHeader video_header; EXPECT_TRUE(rtp_sender_video.SendVideo( @@ -1248,7 +1249,7 @@ TEST_P(RtpSenderTest, NoFlexfecForTimingFrames) { uint16_t flexfec_seq_num; EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kLowPriority, kFlexfecSsrc, _, _, _, false)) - .WillOnce(testing::SaveArg<2>(&flexfec_seq_num)); + .WillOnce(::testing::SaveArg<2>(&flexfec_seq_num)); EXPECT_CALL(mock_paced_sender_, InsertPacket(RtpPacketSender::kLowPriority, kMediaSsrc, kSeqNum + 1, _, _, false)); diff --git a/modules/video_capture/test/video_capture_unittest.cc b/modules/video_capture/test/video_capture_unittest.cc index 283c13ff40..8b97076eca 100644 --- a/modules/video_capture/test/video_capture_unittest.cc +++ b/modules/video_capture/test/video_capture_unittest.cc @@ -145,7 +145,7 @@ class TestVideoCaptureCallback webrtc::VideoRotation rotate_frame_; }; -class VideoCaptureTest : public testing::Test { +class VideoCaptureTest : public ::testing::Test { public: VideoCaptureTest() : number_of_devices_(0) {} diff --git a/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc b/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc index fa10bfb9ff..37346f549d 100644 --- a/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc +++ b/modules/video_coding/codecs/multiplex/test/multiplex_adapter_unittest.cc @@ -44,8 +44,8 @@ #include "test/gtest.h" #include "test/video_codec_settings.h" -using testing::_; -using testing::Return; +using ::testing::_; +using ::testing::Return; namespace webrtc { @@ -53,9 +53,9 @@ constexpr const char* kMultiplexAssociatedCodecName = cricket::kVp9CodecName; const VideoCodecType kMultiplexAssociatedCodecType = PayloadStringToCodecType(kMultiplexAssociatedCodecName); -class TestMultiplexAdapter - : public VideoCodecUnitTest, - public testing::WithParamInterface { +class TestMultiplexAdapter : public VideoCodecUnitTest, + public ::testing::WithParamInterface< + bool /* supports_augmenting_data */> { public: TestMultiplexAdapter() : decoder_factory_(new webrtc::MockVideoDecoderFactory), diff --git a/modules/video_coding/codecs/test/videoprocessor_unittest.cc b/modules/video_coding/codecs/test/videoprocessor_unittest.cc index 394ff238e1..842ad7e97d 100644 --- a/modules/video_coding/codecs/test/videoprocessor_unittest.cc +++ b/modules/video_coding/codecs/test/videoprocessor_unittest.cc @@ -39,7 +39,7 @@ const int kFrameSize = kWidth * kHeight * 3 / 2; // I420. } // namespace -class VideoProcessorTest : public testing::Test { +class VideoProcessorTest : public ::testing::Test { protected: VideoProcessorTest() : q_("VP queue") { config_.SetCodecSettings(cricket::kVp8CodecName, 1, 1, 1, false, false, diff --git a/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc b/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc index 705d60f78c..a9248bda63 100644 --- a/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc +++ b/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc @@ -27,11 +27,11 @@ namespace webrtc { -using testing::_; -using testing::ElementsAreArray; -using testing::Invoke; -using testing::NiceMock; -using testing::Return; +using ::testing::_; +using ::testing::ElementsAreArray; +using ::testing::Invoke; +using ::testing::NiceMock; +using ::testing::Return; using EncoderInfo = webrtc::VideoEncoder::EncoderInfo; using FramerateFractions = absl::InlinedVector; diff --git a/modules/video_coding/codecs/vp9/svc_rate_allocator_unittest.cc b/modules/video_coding/codecs/vp9/svc_rate_allocator_unittest.cc index 8495b212a3..fba7f9ffc4 100644 --- a/modules/video_coding/codecs/vp9/svc_rate_allocator_unittest.cc +++ b/modules/video_coding/codecs/vp9/svc_rate_allocator_unittest.cc @@ -197,8 +197,8 @@ TEST(SvcRateAllocatorTest, NoPaddingIfAllLayersAreDeactivated) { } class SvcRateAllocatorTestParametrizedContentType - : public testing::Test, - public testing::WithParamInterface { + : public ::testing::Test, + public ::testing::WithParamInterface { public: SvcRateAllocatorTestParametrizedContentType() : is_screen_sharing_(GetParam()) {} diff --git a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc index 913bc0171b..87f991da48 100644 --- a/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc +++ b/modules/video_coding/codecs/vp9/test/vp9_impl_unittest.cc @@ -24,7 +24,7 @@ namespace webrtc { -using testing::ElementsAreArray; +using ::testing::ElementsAreArray; using EncoderInfo = webrtc::VideoEncoder::EncoderInfo; using FramerateFractions = absl::InlinedVector; diff --git a/modules/video_coding/frame_buffer2_unittest.cc b/modules/video_coding/frame_buffer2_unittest.cc index 53482699d3..0fb2572523 100644 --- a/modules/video_coding/frame_buffer2_unittest.cc +++ b/modules/video_coding/frame_buffer2_unittest.cc @@ -25,8 +25,8 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::_; -using testing::Return; +using ::testing::_; +using ::testing::Return; namespace webrtc { namespace video_coding { diff --git a/modules/video_coding/h264_sprop_parameter_sets_unittest.cc b/modules/video_coding/h264_sprop_parameter_sets_unittest.cc index 6cd7590b73..ae263131a7 100644 --- a/modules/video_coding/h264_sprop_parameter_sets_unittest.cc +++ b/modules/video_coding/h264_sprop_parameter_sets_unittest.cc @@ -16,7 +16,7 @@ namespace webrtc { -class H264SpropParameterSetsTest : public testing::Test { +class H264SpropParameterSetsTest : public ::testing::Test { public: H264SpropParameterSets h264_sprop; }; diff --git a/modules/video_coding/utility/simulcast_test_fixture_impl.cc b/modules/video_coding/utility/simulcast_test_fixture_impl.cc index 8eb2daa30e..b745fae1d9 100644 --- a/modules/video_coding/utility/simulcast_test_fixture_impl.cc +++ b/modules/video_coding/utility/simulcast_test_fixture_impl.cc @@ -854,9 +854,9 @@ void SimulcastTestFixtureImpl::TestDecodeWidthHeightSet() { EXPECT_CALL(encoder_callback, OnEncodedImage(_, _, _)) .Times(3) .WillRepeatedly( - testing::Invoke([&](const EncodedImage& encoded_image, - const CodecSpecificInfo* codec_specific_info, - const RTPFragmentationHeader* fragmentation) { + ::testing::Invoke([&](const EncodedImage& encoded_image, + const CodecSpecificInfo* codec_specific_info, + const RTPFragmentationHeader* fragmentation) { EXPECT_EQ(encoded_image._frameType, VideoFrameType::kVideoFrameKey); size_t index = encoded_image.SpatialIndex().value_or(0); @@ -873,27 +873,27 @@ void SimulcastTestFixtureImpl::TestDecodeWidthHeightSet() { EXPECT_EQ(0, encoder_->Encode(*input_frame_, NULL)); EXPECT_CALL(decoder_callback, Decoded(_, _, _)) - .WillOnce(testing::Invoke([](VideoFrame& decodedImage, - absl::optional decode_time_ms, - absl::optional qp) { + .WillOnce(::testing::Invoke([](VideoFrame& decodedImage, + absl::optional decode_time_ms, + absl::optional qp) { EXPECT_EQ(decodedImage.width(), kDefaultWidth / 4); EXPECT_EQ(decodedImage.height(), kDefaultHeight / 4); })); EXPECT_EQ(0, decoder_->Decode(encoded_frame[0], false, NULL, 0)); EXPECT_CALL(decoder_callback, Decoded(_, _, _)) - .WillOnce(testing::Invoke([](VideoFrame& decodedImage, - absl::optional decode_time_ms, - absl::optional qp) { + .WillOnce(::testing::Invoke([](VideoFrame& decodedImage, + absl::optional decode_time_ms, + absl::optional qp) { EXPECT_EQ(decodedImage.width(), kDefaultWidth / 2); EXPECT_EQ(decodedImage.height(), kDefaultHeight / 2); })); EXPECT_EQ(0, decoder_->Decode(encoded_frame[1], false, NULL, 0)); EXPECT_CALL(decoder_callback, Decoded(_, _, _)) - .WillOnce(testing::Invoke([](VideoFrame& decodedImage, - absl::optional decode_time_ms, - absl::optional qp) { + .WillOnce(::testing::Invoke([](VideoFrame& decodedImage, + absl::optional decode_time_ms, + absl::optional qp) { EXPECT_EQ(decodedImage.width(), kDefaultWidth); EXPECT_EQ(decodedImage.height(), kDefaultHeight); })); diff --git a/p2p/base/async_stun_tcp_socket_unittest.cc b/p2p/base/async_stun_tcp_socket_unittest.cc index 70fddda336..5634534a0c 100644 --- a/p2p/base/async_stun_tcp_socket_unittest.cc +++ b/p2p/base/async_stun_tcp_socket_unittest.cc @@ -56,7 +56,7 @@ static unsigned char kTurnChannelDataMessageWithOddLength[] = { static const rtc::SocketAddress kClientAddr("11.11.11.11", 0); static const rtc::SocketAddress kServerAddr("22.22.22.22", 0); -class AsyncStunTCPSocketTest : public testing::Test, +class AsyncStunTCPSocketTest : public ::testing::Test, public sigslot::has_slots<> { protected: AsyncStunTCPSocketTest() diff --git a/p2p/base/basic_async_resolver_factory_unittest.cc b/p2p/base/basic_async_resolver_factory_unittest.cc index 020226f1aa..0c21c682fb 100644 --- a/p2p/base/basic_async_resolver_factory_unittest.cc +++ b/p2p/base/basic_async_resolver_factory_unittest.cc @@ -17,7 +17,7 @@ namespace webrtc { -class BasicAsyncResolverFactoryTest : public testing::Test, +class BasicAsyncResolverFactoryTest : public ::testing::Test, public sigslot::has_slots<> { public: void TestCreate() { diff --git a/p2p/base/dtls_transport_unittest.cc b/p2p/base/dtls_transport_unittest.cc index f85965d365..b71d65e9c2 100644 --- a/p2p/base/dtls_transport_unittest.cc +++ b/p2p/base/dtls_transport_unittest.cc @@ -297,7 +297,7 @@ class DtlsTestClient : public sigslot::has_slots<> { }; // Base class for DtlsTransportTest and DtlsEventOrderingTest, which -// inherit from different variants of testing::Test. +// inherit from different variants of ::testing::Test. // // Note that this test always uses a FakeClock, due to the |fake_clock_| member // variable. diff --git a/p2p/base/mock_ice_transport.h b/p2p/base/mock_ice_transport.h index 77716b2b67..6aeb95027c 100644 --- a/p2p/base/mock_ice_transport.h +++ b/p2p/base/mock_ice_transport.h @@ -19,8 +19,8 @@ #include "rtc_base/gunit.h" #include "test/gmock.h" -using testing::_; -using testing::Return; +using ::testing::_; +using ::testing::Return; namespace cricket { diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc index 775545b955..f97d631a41 100644 --- a/p2p/base/p2p_transport_channel_unittest.cc +++ b/p2p/base/p2p_transport_channel_unittest.cc @@ -187,7 +187,7 @@ namespace cricket { // and that the result is what we expect. // Note that this class is a base class for use by other tests, who will provide // specialized test behavior. -class P2PTransportChannelTestBase : public testing::Test, +class P2PTransportChannelTestBase : public ::testing::Test, public rtc::MessageHandler, public sigslot::has_slots<> { public: @@ -3074,7 +3074,7 @@ TEST_F(P2PTransportChannelMultihomedTest, TestRestoreBackupConnection) { // A collection of tests which tests a single P2PTransportChannel by sending // pings. -class P2PTransportChannelPingTest : public testing::Test, +class P2PTransportChannelPingTest : public ::testing::Test, public sigslot::has_slots<> { public: P2PTransportChannelPingTest() diff --git a/p2p/base/port_allocator_unittest.cc b/p2p/base/port_allocator_unittest.cc index c82810270d..a9edbeccaf 100644 --- a/p2p/base/port_allocator_unittest.cc +++ b/p2p/base/port_allocator_unittest.cc @@ -24,7 +24,7 @@ static const char kIcePwd[] = "TESTICEPWD00000000000000"; static const char kTurnUsername[] = "test"; static const char kTurnPassword[] = "test"; -class PortAllocatorTest : public testing::Test, public sigslot::has_slots<> { +class PortAllocatorTest : public ::testing::Test, public sigslot::has_slots<> { public: PortAllocatorTest() : vss_(new rtc::VirtualSocketServer()), main_(vss_.get()) { diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc index 8857a978e9..fb2b4ef978 100644 --- a/p2p/base/port_unittest.cc +++ b/p2p/base/port_unittest.cc @@ -397,7 +397,7 @@ class TestChannel : public sigslot::has_slots<> { bool connection_ready_to_send_ = false; }; -class PortTest : public testing::Test, public sigslot::has_slots<> { +class PortTest : public ::testing::Test, public sigslot::has_slots<> { public: PortTest() : ss_(new rtc::VirtualSocketServer()), diff --git a/p2p/base/pseudo_tcp_unittest.cc b/p2p/base/pseudo_tcp_unittest.cc index b54291113e..c0f4a892d6 100644 --- a/p2p/base/pseudo_tcp_unittest.cc +++ b/p2p/base/pseudo_tcp_unittest.cc @@ -42,7 +42,7 @@ class PseudoTcpForTest : public cricket::PseudoTcp { void disableWindowScale() { PseudoTcp::disableWindowScale(); } }; -class PseudoTcpTestBase : public testing::Test, +class PseudoTcpTestBase : public ::testing::Test, public rtc::MessageHandler, public cricket::IPseudoTcpNotify { public: diff --git a/p2p/base/regathering_controller_unittest.cc b/p2p/base/regathering_controller_unittest.cc index db1f1bde1a..c86aa1a2bb 100644 --- a/p2p/base/regathering_controller_unittest.cc +++ b/p2p/base/regathering_controller_unittest.cc @@ -44,7 +44,7 @@ const char kIcePwd[] = "TESTICEPWD00000000000000"; namespace webrtc { -class RegatheringControllerTest : public testing::Test, +class RegatheringControllerTest : public ::testing::Test, public sigslot::has_slots<> { public: RegatheringControllerTest() diff --git a/p2p/base/relay_port_unittest.cc b/p2p/base/relay_port_unittest.cc index 5f410e6397..ce01c1503b 100644 --- a/p2p/base/relay_port_unittest.cc +++ b/p2p/base/relay_port_unittest.cc @@ -41,7 +41,7 @@ static const int kMaxTimeoutMs = 5000; // RelayPort and created sockets by listening for signals such as, // SignalConnectFailure, SignalConnectTimeout, SignalSocketClosed and // SignalReadPacket. -class RelayPortTest : public testing::Test, public sigslot::has_slots<> { +class RelayPortTest : public ::testing::Test, public sigslot::has_slots<> { public: RelayPortTest() : virtual_socket_server_(new rtc::VirtualSocketServer()), diff --git a/p2p/base/relay_server_unittest.cc b/p2p/base/relay_server_unittest.cc index a64cf4f981..48e750fc85 100644 --- a/p2p/base/relay_server_unittest.cc +++ b/p2p/base/relay_server_unittest.cc @@ -43,7 +43,7 @@ const char* msg2 = "Lobster Thermidor a Crevette with a mornay sauce..."; } // namespace -class RelayServerTest : public testing::Test { +class RelayServerTest : public ::testing::Test { public: RelayServerTest() : ss_(new rtc::VirtualSocketServer()), diff --git a/p2p/base/stun_port_unittest.cc b/p2p/base/stun_port_unittest.cc index 7e7e2deae2..a23c063a8f 100644 --- a/p2p/base/stun_port_unittest.cc +++ b/p2p/base/stun_port_unittest.cc @@ -41,7 +41,7 @@ static const int kInfiniteLifetime = -1; static const int kHighCostPortKeepaliveLifetimeMs = 2 * 60 * 1000; // Tests connecting a StunPort to a fake STUN server (cricket::StunServer) -class StunPortTestBase : public testing::Test, public sigslot::has_slots<> { +class StunPortTestBase : public ::testing::Test, public sigslot::has_slots<> { public: StunPortTestBase() : ss_(new rtc::VirtualSocketServer()), @@ -419,17 +419,18 @@ TEST_F(StunPortTest, TestStunPacketsHaveDscpPacketOption) { EXPECT_CALL(*socket, SetOption(_, _)).WillRepeatedly(Return(0)); // If DSCP is not set on the socket, stun packets should have no value. - EXPECT_CALL(*socket, SendTo(_, _, _, - testing::Field(&rtc::PacketOptions::dscp, - testing::Eq(rtc::DSCP_NO_CHANGE)))) + EXPECT_CALL(*socket, + SendTo(_, _, _, + ::testing::Field(&rtc::PacketOptions::dscp, + ::testing::Eq(rtc::DSCP_NO_CHANGE)))) .WillOnce(Return(100)); PrepareAddress(); // Once it is set transport wide, they should inherit that value. port()->SetOption(rtc::Socket::OPT_DSCP, rtc::DSCP_AF41); EXPECT_CALL(*socket, SendTo(_, _, _, - testing::Field(&rtc::PacketOptions::dscp, - testing::Eq(rtc::DSCP_AF41)))) + ::testing::Field(&rtc::PacketOptions::dscp, + ::testing::Eq(rtc::DSCP_AF41)))) .WillRepeatedly(Return(100)); EXPECT_TRUE_SIMULATED_WAIT(done(), kTimeoutMs, fake_clock); } diff --git a/p2p/base/stun_request_unittest.cc b/p2p/base/stun_request_unittest.cc index e2ac57f0ea..47d2d41c91 100644 --- a/p2p/base/stun_request_unittest.cc +++ b/p2p/base/stun_request_unittest.cc @@ -19,7 +19,7 @@ namespace cricket { -class StunRequestTest : public testing::Test, public sigslot::has_slots<> { +class StunRequestTest : public ::testing::Test, public sigslot::has_slots<> { public: StunRequestTest() : manager_(rtc::Thread::Current()), diff --git a/p2p/base/stun_server_unittest.cc b/p2p/base/stun_server_unittest.cc index b5cc1dfae5..efc1cd2b30 100644 --- a/p2p/base/stun_server_unittest.cc +++ b/p2p/base/stun_server_unittest.cc @@ -29,7 +29,7 @@ const rtc::SocketAddress server_addr("99.99.99.1", 3478); const rtc::SocketAddress client_addr("1.2.3.4", 1234); } // namespace -class StunServerTest : public testing::Test { +class StunServerTest : public ::testing::Test { public: StunServerTest() : ss_(new rtc::VirtualSocketServer()), network_(ss_.get()) {} virtual void SetUp() { diff --git a/p2p/base/tcp_port_unittest.cc b/p2p/base/tcp_port_unittest.cc index b5b1f64e88..4c114707d6 100644 --- a/p2p/base/tcp_port_unittest.cc +++ b/p2p/base/tcp_port_unittest.cc @@ -55,7 +55,7 @@ class ConnectionObserver : public sigslot::has_slots<> { bool connection_destroyed_ = false; }; -class TCPPortTest : public testing::Test, public sigslot::has_slots<> { +class TCPPortTest : public ::testing::Test, public sigslot::has_slots<> { public: TCPPortTest() : ss_(new rtc::VirtualSocketServer()), diff --git a/p2p/base/transport_description_factory_unittest.cc b/p2p/base/transport_description_factory_unittest.cc index cf04964e14..875d140ab6 100644 --- a/p2p/base/transport_description_factory_unittest.cc +++ b/p2p/base/transport_description_factory_unittest.cc @@ -30,7 +30,7 @@ using cricket::TransportOptions; using ::testing::Contains; using ::testing::Not; -class TransportDescriptionFactoryTest : public testing::Test { +class TransportDescriptionFactoryTest : public ::testing::Test { public: TransportDescriptionFactoryTest() : ice_credentials_({}), diff --git a/p2p/base/turn_port_unittest.cc b/p2p/base/turn_port_unittest.cc index 80af11d97f..b21a25748a 100644 --- a/p2p/base/turn_port_unittest.cc +++ b/p2p/base/turn_port_unittest.cc @@ -144,7 +144,7 @@ class TestConnectionWrapper : public sigslot::has_slots<> { // Note: This test uses a fake clock with a simulated network round trip // (between local port and TURN server) of kSimulatedRtt. -class TurnPortTest : public testing::Test, +class TurnPortTest : public ::testing::Test, public sigslot::has_slots<>, public rtc::MessageHandler { public: diff --git a/p2p/base/turn_server_unittest.cc b/p2p/base/turn_server_unittest.cc index 4080cec8da..f115be1289 100644 --- a/p2p/base/turn_server_unittest.cc +++ b/p2p/base/turn_server_unittest.cc @@ -19,7 +19,7 @@ namespace cricket { -class TurnServerConnectionTest : public testing::Test { +class TurnServerConnectionTest : public ::testing::Test { public: TurnServerConnectionTest() : thread_(&vss_) {} diff --git a/p2p/client/basic_port_allocator_unittest.cc b/p2p/client/basic_port_allocator_unittest.cc index e9fd5060b5..1682e9dffc 100644 --- a/p2p/client/basic_port_allocator_unittest.cc +++ b/p2p/client/basic_port_allocator_unittest.cc @@ -145,7 +145,7 @@ std::ostream& operator<<(std::ostream& os, return os; } -class BasicPortAllocatorTestBase : public testing::Test, +class BasicPortAllocatorTestBase : public ::testing::Test, public sigslot::has_slots<> { public: BasicPortAllocatorTestBase() diff --git a/p2p/stunprober/stun_prober_unittest.cc b/p2p/stunprober/stun_prober_unittest.cc index c54f453b79..e192598d66 100644 --- a/p2p/stunprober/stun_prober_unittest.cc +++ b/p2p/stunprober/stun_prober_unittest.cc @@ -35,7 +35,7 @@ const rtc::SocketAddress kStunMappedAddr("77.77.77.77", 0); } // namespace -class StunProberTest : public testing::Test { +class StunProberTest : public ::testing::Test { public: StunProberTest() : ss_(new rtc::VirtualSocketServer()), diff --git a/pc/channel_manager_unittest.cc b/pc/channel_manager_unittest.cc index 03c68ea0d2..8a20f40ff3 100644 --- a/pc/channel_manager_unittest.cc +++ b/pc/channel_manager_unittest.cc @@ -40,7 +40,7 @@ static const VideoCodec kVideoCodecs[] = { VideoCodec(99, "H264"), VideoCodec(100, "VP8"), VideoCodec(96, "rtx"), }; -class ChannelManagerTest : public testing::Test { +class ChannelManagerTest : public ::testing::Test { protected: ChannelManagerTest() : network_(rtc::Thread::CreateWithSocketServer()), diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index edcea883bf..9c5f82b0d4 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc @@ -101,7 +101,7 @@ class DataTraits : public Traits -class ChannelTest : public testing::Test, public sigslot::has_slots<> { +class ChannelTest : public ::testing::Test, public sigslot::has_slots<> { public: enum Flags { RTCP_MUX = 0x1, diff --git a/pc/data_channel_unittest.cc b/pc/data_channel_unittest.cc index 7ce40fb088..52c54e73f2 100644 --- a/pc/data_channel_unittest.cc +++ b/pc/data_channel_unittest.cc @@ -62,7 +62,7 @@ class FakeDataChannelObserver : public webrtc::DataChannelObserver { // TODO(deadbeef): The fact that these tests use a fake provider makes them not // too valuable. Should rewrite using the // peerconnection_datachannel_unittest.cc infrastructure. -class SctpDataChannelTest : public testing::Test { +class SctpDataChannelTest : public ::testing::Test { protected: SctpDataChannelTest() : provider_(new FakeDataChannelProvider()), @@ -613,7 +613,7 @@ TEST_F(SctpDataChannelTest, TransportDestroyedWhileDataBuffered) { webrtc_data_channel_->state(), kDefaultTimeout); } -class SctpSidAllocatorTest : public testing::Test { +class SctpSidAllocatorTest : public ::testing::Test { protected: SctpSidAllocator allocator_; }; diff --git a/pc/dtls_srtp_transport_unittest.cc b/pc/dtls_srtp_transport_unittest.cc index abf1b2d307..d4ad5fa037 100644 --- a/pc/dtls_srtp_transport_unittest.cc +++ b/pc/dtls_srtp_transport_unittest.cc @@ -39,7 +39,7 @@ using webrtc::RtpTransport; const int kRtpAuthTagLen = 10; -class DtlsSrtpTransportTest : public testing::Test, +class DtlsSrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> { protected: DtlsSrtpTransportTest() {} diff --git a/pc/dtls_transport_unittest.cc b/pc/dtls_transport_unittest.cc index 508e557159..0c27c1b6c3 100644 --- a/pc/dtls_transport_unittest.cc +++ b/pc/dtls_transport_unittest.cc @@ -47,7 +47,7 @@ class TestDtlsTransportObserver : public DtlsTransportObserverInterface { std::vector states_; }; -class DtlsTransportTest : public testing::Test { +class DtlsTransportTest : public ::testing::Test { public: DtlsTransport* transport() { return transport_.get(); } DtlsTransportObserverInterface* observer() { return &observer_; } diff --git a/pc/dtmf_sender_unittest.cc b/pc/dtmf_sender_unittest.cc index b98b035132..069833a206 100644 --- a/pc/dtmf_sender_unittest.cc +++ b/pc/dtmf_sender_unittest.cc @@ -114,7 +114,7 @@ class FakeDtmfProvider : public DtmfProviderInterface { sigslot::signal0<> SignalDestroyed; }; -class DtmfSenderTest : public testing::Test { +class DtmfSenderTest : public ::testing::Test { protected: DtmfSenderTest() : observer_(new rtc::RefCountedObject()), diff --git a/pc/ice_server_parsing_unittest.cc b/pc/ice_server_parsing_unittest.cc index 9f1b81718e..226290352c 100644 --- a/pc/ice_server_parsing_unittest.cc +++ b/pc/ice_server_parsing_unittest.cc @@ -19,7 +19,7 @@ namespace webrtc { -class IceServerParsingTest : public testing::Test { +class IceServerParsingTest : public ::testing::Test { public: // Convenience functions for parsing a single URL. Result is stored in // |stun_servers_| and |turn_servers_|. diff --git a/pc/ice_transport_unittest.cc b/pc/ice_transport_unittest.cc index 8d668de317..62d7953f7e 100644 --- a/pc/ice_transport_unittest.cc +++ b/pc/ice_transport_unittest.cc @@ -24,7 +24,7 @@ namespace webrtc { -class IceTransportTest : public testing::Test {}; +class IceTransportTest : public ::testing::Test {}; TEST_F(IceTransportTest, CreateNonSelfDeletingTransport) { auto cricket_transport = diff --git a/pc/jsep_session_description_unittest.cc b/pc/jsep_session_description_unittest.cc index 6ac1a0066a..674b6e72f3 100644 --- a/pc/jsep_session_description_unittest.cc +++ b/pc/jsep_session_description_unittest.cc @@ -82,7 +82,7 @@ static cricket::SessionDescription* CreateCricketSessionDescription() { return desc; } -class JsepSessionDescriptionTest : public testing::Test { +class JsepSessionDescriptionTest : public ::testing::Test { protected: virtual void SetUp() { int port = 1234; diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc index 64da95b9b7..b18f85a5ba 100644 --- a/pc/jsep_transport_controller_unittest.cc +++ b/pc/jsep_transport_controller_unittest.cc @@ -78,7 +78,7 @@ class FakeTransportFactory : public cricket::TransportFactoryInterface { }; class JsepTransportControllerTest : public JsepTransportController::Observer, - public testing::Test, + public ::testing::Test, public sigslot::has_slots<> { public: JsepTransportControllerTest() : signaling_thread_(rtc::Thread::Current()) { diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc index 9ed079ba5d..ac17d6f1f6 100644 --- a/pc/jsep_transport_unittest.cc +++ b/pc/jsep_transport_unittest.cc @@ -40,7 +40,7 @@ struct NegotiateRoleParams { SdpType remote_type; }; -class JsepTransport2Test : public testing::Test, public sigslot::has_slots<> { +class JsepTransport2Test : public ::testing::Test, public sigslot::has_slots<> { protected: std::unique_ptr CreateSdesTransport( rtc::PacketTransportInternal* rtp_packet_transport, @@ -156,7 +156,7 @@ class JsepTransport2Test : public testing::Test, public sigslot::has_slots<> { // The parameterized tests cover both cases when RTCP mux is enable and // disabled. class JsepTransport2WithRtcpMux : public JsepTransport2Test, - public testing::WithParamInterface {}; + public ::testing::WithParamInterface {}; // This test verifies the ICE parameters are properly applied to the transports. TEST_P(JsepTransport2WithRtcpMux, SetIceParameters) { @@ -640,7 +640,7 @@ TEST_P(JsepTransport2WithRtcpMux, InvalidDtlsRoleNegotiation) { INSTANTIATE_TEST_SUITE_P(JsepTransport2Test, JsepTransport2WithRtcpMux, - testing::Bool()); + ::testing::Bool()); // Test that a reoffer in the opposite direction is successful as long as the // role isn't changing. Doesn't test every possible combination like the test diff --git a/pc/media_session_unittest.cc b/pc/media_session_unittest.cc index 7c0a7debf2..efd231804d 100644 --- a/pc/media_session_unittest.cc +++ b/pc/media_session_unittest.cc @@ -82,17 +82,17 @@ using rtc::CS_AEAD_AES_256_GCM; using rtc::CS_AES_CM_128_HMAC_SHA1_32; using rtc::CS_AES_CM_128_HMAC_SHA1_80; using rtc::UniqueRandomIdGenerator; -using testing::Contains; -using testing::Each; -using testing::ElementsAreArray; -using testing::Eq; -using testing::Field; -using testing::IsEmpty; -using testing::IsFalse; -using testing::Ne; -using testing::Not; -using testing::Pointwise; -using testing::SizeIs; +using ::testing::Contains; +using ::testing::Each; +using ::testing::ElementsAreArray; +using ::testing::Eq; +using ::testing::Field; +using ::testing::IsEmpty; +using ::testing::IsFalse; +using ::testing::Ne; +using ::testing::Not; +using ::testing::Pointwise; +using ::testing::SizeIs; using webrtc::RtpExtension; using webrtc::RtpTransceiverDirection; @@ -405,7 +405,7 @@ static MediaSessionOptions CreatePlanBMediaSessionOptions() { // was designed for Plan B SDP, where only one audio "m=" section and one video // "m=" section could be generated, and ordering couldn't be controlled. Many of // these tests may be obsolete as a result, and should be refactored or removed. -class MediaSessionDescriptionFactoryTest : public testing::Test { +class MediaSessionDescriptionFactoryTest : public ::testing::Test { public: MediaSessionDescriptionFactoryTest() : f1_(&tdf1_, &ssrc_generator1), f2_(&tdf2_, &ssrc_generator2) { diff --git a/pc/media_stream_unittest.cc b/pc/media_stream_unittest.cc index 4b25e78634..b49481e114 100644 --- a/pc/media_stream_unittest.cc +++ b/pc/media_stream_unittest.cc @@ -50,7 +50,7 @@ class MockObserver : public ObserverInterface { NotifierInterface* notifier_; }; -class MediaStreamTest : public testing::Test { +class MediaStreamTest : public ::testing::Test { protected: virtual void SetUp() { stream_ = MediaStream::Create(kStreamId1); diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index a30319992c..4cd59c8b2e 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc @@ -33,11 +33,11 @@ #include "test/mock_audio_decoder_factory.h" #include "test/mock_audio_encoder_factory.h" -using testing::AtLeast; -using testing::Invoke; -using testing::StrictMock; -using testing::Values; -using testing::_; +using ::testing::_; +using ::testing::AtLeast; +using ::testing::Invoke; +using ::testing::StrictMock; +using ::testing::Values; using webrtc::DataChannelInterface; using webrtc::MediaStreamInterface; @@ -51,7 +51,7 @@ const int kMaxWait = 25000; } // namespace class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>, - public testing::Test { + public ::testing::Test { public: typedef std::vector> DataChannelList; diff --git a/pc/peer_connection_factory_unittest.cc b/pc/peer_connection_factory_unittest.cc index 41a540839c..a19e43020f 100644 --- a/pc/peer_connection_factory_unittest.cc +++ b/pc/peer_connection_factory_unittest.cc @@ -98,7 +98,7 @@ class NullPeerConnectionObserver : public PeerConnectionObserver { } // namespace -class PeerConnectionFactoryTest : public testing::Test { +class PeerConnectionFactoryTest : public ::testing::Test { void SetUp() { #ifdef WEBRTC_ANDROID webrtc::InitializeAndroidObjects(); diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc index 807a8e1cf8..03c11283bb 100644 --- a/pc/peer_connection_ice_unittest.cc +++ b/pc/peer_connection_ice_unittest.cc @@ -975,7 +975,7 @@ INSTANTIATE_TEST_SUITE_P(PeerConnectionIceTest, Values(SdpSemantics::kPlanB, SdpSemantics::kUnifiedPlan)); -class PeerConnectionIceConfigTest : public testing::Test { +class PeerConnectionIceConfigTest : public ::testing::Test { protected: void SetUp() override { pc_factory_ = CreatePeerConnectionFactory( diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index 58c343942e..8aa76754bf 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc @@ -1123,7 +1123,7 @@ class MediaExpectations { // virtual network, fake A/V capture and fake encoder/decoders. The // PeerConnections share the threads/socket servers, but use separate versions // of everything else (including "PeerConnectionFactory"s). -class PeerConnectionIntegrationBaseTest : public testing::Test { +class PeerConnectionIntegrationBaseTest : public ::testing::Test { public: explicit PeerConnectionIntegrationBaseTest(SdpSemantics sdp_semantics) : sdp_semantics_(sdp_semantics), @@ -4841,8 +4841,8 @@ TEST_P(PeerConnectionIntegrationTest, RtcEventLogOutputWriteCalled) { ConnectFakeSignaling(); auto output = absl::make_unique>(); - ON_CALL(*output, IsActive()).WillByDefault(testing::Return(true)); - ON_CALL(*output, Write(::testing::_)).WillByDefault(testing::Return(true)); + ON_CALL(*output, IsActive()).WillByDefault(::testing::Return(true)); + ON_CALL(*output, Write(::testing::_)).WillByDefault(::testing::Return(true)); EXPECT_CALL(*output, Write(::testing::_)).Times(::testing::AtLeast(1)); EXPECT_TRUE(caller()->pc()->StartRtcEventLog( std::move(output), webrtc::RtcEventLog::kImmediateOutput)); diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc index edede253fa..21f6a05e08 100644 --- a/pc/peer_connection_interface_unittest.cc +++ b/pc/peer_connection_interface_unittest.cc @@ -667,7 +667,7 @@ class PeerConnectionFactoryForTest : public webrtc::PeerConnectionFactory { }; // TODO(steveanton): Convert to use the new PeerConnectionWrapper. -class PeerConnectionInterfaceBaseTest : public testing::Test { +class PeerConnectionInterfaceBaseTest : public ::testing::Test { protected: explicit PeerConnectionInterfaceBaseTest(SdpSemantics sdp_semantics) : vss_(new rtc::VirtualSocketServer()), @@ -3959,7 +3959,7 @@ INSTANTIATE_TEST_SUITE_P(PeerConnectionInterfaceTest, Values(SdpSemantics::kPlanB, SdpSemantics::kUnifiedPlan)); -class PeerConnectionMediaConfigTest : public testing::Test { +class PeerConnectionMediaConfigTest : public ::testing::Test { protected: void SetUp() override { pcf_ = PeerConnectionFactoryForTest::CreatePeerConnectionFactoryForTest(); diff --git a/pc/peer_connection_jsep_unittest.cc b/pc/peer_connection_jsep_unittest.cc index 868ff679c0..26d702b700 100644 --- a/pc/peer_connection_jsep_unittest.cc +++ b/pc/peer_connection_jsep_unittest.cc @@ -710,7 +710,7 @@ TEST_F(PeerConnectionJsepTest, CreateOfferRecyclesWhenOfferingTwice) { // - The new transceiver is associated with the new MID value. class RecycleMediaSectionTest : public PeerConnectionJsepTest, - public testing::WithParamInterface< + public ::testing::WithParamInterface< std::tuple> { protected: RecycleMediaSectionTest() { diff --git a/pc/peer_connection_rtp_unittest.cc b/pc/peer_connection_rtp_unittest.cc index 48c14e3ab7..c03bab4317 100644 --- a/pc/peer_connection_rtp_unittest.cc +++ b/pc/peer_connection_rtp_unittest.cc @@ -87,7 +87,7 @@ class OnSuccessObserver : public rtc::RefCountedObject< MethodFunctor on_success_; }; -class PeerConnectionRtpBaseTest : public testing::Test { +class PeerConnectionRtpBaseTest : public ::testing::Test { public: explicit PeerConnectionRtpBaseTest(SdpSemantics sdp_semantics) : sdp_semantics_(sdp_semantics), diff --git a/pc/peer_connection_simulcast_unittest.cc b/pc/peer_connection_simulcast_unittest.cc index 3efc6cbf44..5eaa501fec 100644 --- a/pc/peer_connection_simulcast_unittest.cc +++ b/pc/peer_connection_simulcast_unittest.cc @@ -87,7 +87,7 @@ std::vector CreateLayers(int num_layers, bool active) { } // namespace namespace webrtc { -class PeerConnectionSimulcastTests : public testing::Test { +class PeerConnectionSimulcastTests : public ::testing::Test { public: PeerConnectionSimulcastTests() : pc_factory_( diff --git a/pc/playout_latency_unittest.cc b/pc/playout_latency_unittest.cc index c9912549be..db139f4e76 100644 --- a/pc/playout_latency_unittest.cc +++ b/pc/playout_latency_unittest.cc @@ -27,7 +27,7 @@ constexpr int kSsrc = 1234; namespace webrtc { -class PlayoutLatencyTest : public testing::Test { +class PlayoutLatencyTest : public ::testing::Test { public: PlayoutLatencyTest() : latency_( diff --git a/pc/proxy_unittest.cc b/pc/proxy_unittest.cc index f9b706355b..a00b47ff6b 100644 --- a/pc/proxy_unittest.cc +++ b/pc/proxy_unittest.cc @@ -87,7 +87,7 @@ PROXY_METHOD2(std::string, Method2, std::string, std::string) END_PROXY_MAP() #undef FakeProxy -class SignalingProxyTest : public testing::Test { +class SignalingProxyTest : public ::testing::Test { public: // Checks that the functions are called on the right thread. void CheckSignalingThread() { EXPECT_TRUE(signaling_thread_->IsCurrent()); } @@ -173,7 +173,7 @@ TEST_F(SignalingProxyTest, Method2) { EXPECT_EQ("Method2", fake_signaling_proxy_->Method2(arg1, arg2)); } -class ProxyTest : public testing::Test { +class ProxyTest : public ::testing::Test { public: // Checks that the functions are called on the right thread. void CheckSignalingThread() { EXPECT_TRUE(signaling_thread_->IsCurrent()); } @@ -274,7 +274,7 @@ PROXY_SIGNALING_THREAD_DESTRUCTOR() PROXY_METHOD0(void, Bar) END_PROXY_MAP() -class OwnedProxyTest : public testing::Test { +class OwnedProxyTest : public ::testing::Test { public: OwnedProxyTest() : signaling_thread_(rtc::Thread::Create()), diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index 5b0d1644b4..7e843a6869 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc @@ -38,9 +38,9 @@ #include "rtc_base/logging.h" #include "rtc_base/time_utils.h" -using testing::AtLeast; -using testing::Invoke; -using testing::Return; +using ::testing::AtLeast; +using ::testing::Invoke; +using ::testing::Return; namespace webrtc { @@ -496,7 +496,7 @@ class RTCStatsCollectorWrapper { rtc::scoped_refptr stats_collector_; }; -class RTCStatsCollectorTest : public testing::Test { +class RTCStatsCollectorTest : public ::testing::Test { public: RTCStatsCollectorTest() : pc_(new rtc::RefCountedObject()), diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index 174e78e76a..69357691e2 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -103,7 +103,7 @@ class RTCStatsReportTraceListener { RTCStatsReportTraceListener* RTCStatsReportTraceListener::traced_report_ = nullptr; -class RTCStatsIntegrationTest : public testing::Test { +class RTCStatsIntegrationTest : public ::testing::Test { public: RTCStatsIntegrationTest() : network_thread_(new rtc::Thread(&virtual_socket_server_)), diff --git a/pc/rtc_stats_traversal_unittest.cc b/pc/rtc_stats_traversal_unittest.cc index c08d293a61..c7d097117e 100644 --- a/pc/rtc_stats_traversal_unittest.cc +++ b/pc/rtc_stats_traversal_unittest.cc @@ -22,7 +22,7 @@ namespace webrtc { -class RTCStatsTraversalTest : public testing::Test { +class RTCStatsTraversalTest : public ::testing::Test { public: RTCStatsTraversalTest() { transport_ = new RTCTransportStats("transport", 0); diff --git a/pc/rtp_sender_receiver_unittest.cc b/pc/rtp_sender_receiver_unittest.cc index e6d008378e..38f414cb3b 100644 --- a/pc/rtp_sender_receiver_unittest.cc +++ b/pc/rtp_sender_receiver_unittest.cc @@ -87,8 +87,8 @@ static const int kDefaultTimeout = 10000; // 10 seconds. namespace webrtc { class RtpSenderReceiverTest - : public testing::Test, - public testing::WithParamInterface>, + : public ::testing::Test, + public ::testing::WithParamInterface>, public sigslot::has_slots<> { public: RtpSenderReceiverTest() diff --git a/pc/sctp_transport_unittest.cc b/pc/sctp_transport_unittest.cc index e2bdf449b9..3771b2c37b 100644 --- a/pc/sctp_transport_unittest.cc +++ b/pc/sctp_transport_unittest.cc @@ -76,7 +76,7 @@ class TestSctpTransportObserver : public SctpTransportObserverInterface { std::vector states_; }; -class SctpTransportTest : public testing::Test { +class SctpTransportTest : public ::testing::Test { public: SctpTransport* transport() { return transport_.get(); } SctpTransportObserverInterface* observer() { return &observer_; } diff --git a/pc/sctp_utils_unittest.cc b/pc/sctp_utils_unittest.cc index 01f54349ea..70c627714d 100644 --- a/pc/sctp_utils_unittest.cc +++ b/pc/sctp_utils_unittest.cc @@ -16,7 +16,7 @@ #include "rtc_base/copy_on_write_buffer.h" #include "test/gtest.h" -class SctpUtilsTest : public testing::Test { +class SctpUtilsTest : public ::testing::Test { public: void VerifyOpenMessageFormat(const rtc::CopyOnWriteBuffer& packet, const std::string& label, diff --git a/pc/srtp_filter_unittest.cc b/pc/srtp_filter_unittest.cc index d7368d12cb..796400281f 100644 --- a/pc/srtp_filter_unittest.cc +++ b/pc/srtp_filter_unittest.cc @@ -62,7 +62,7 @@ static const cricket::CryptoParams kTestCryptoParamsGcm4(1, kTestKeyParamsGcm4, ""); -class SrtpFilterTest : public testing::Test { +class SrtpFilterTest : public ::testing::Test { protected: SrtpFilterTest() {} static std::vector MakeVector(const CryptoParams& params) { diff --git a/pc/srtp_session_unittest.cc b/pc/srtp_session_unittest.cc index 8ca5997f7a..8feceb476a 100644 --- a/pc/srtp_session_unittest.cc +++ b/pc/srtp_session_unittest.cc @@ -29,7 +29,7 @@ namespace rtc { std::vector kEncryptedHeaderExtensionIds; -class SrtpSessionTest : public testing::Test { +class SrtpSessionTest : public ::testing::Test { public: SrtpSessionTest() { webrtc::metrics::Reset(); } diff --git a/pc/srtp_transport_unittest.cc b/pc/srtp_transport_unittest.cc index f3fab89a21..a12d2c5904 100644 --- a/pc/srtp_transport_unittest.cc +++ b/pc/srtp_transport_unittest.cc @@ -42,7 +42,7 @@ static const uint8_t kTestKeyGcm256_2[] = "rqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA"; static const int kTestKeyGcm256Len = 44; // 256 bits key + 96 bits salt. -class SrtpTransportTest : public testing::Test, public sigslot::has_slots<> { +class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> { protected: SrtpTransportTest() { bool rtcp_mux_enabled = true; @@ -336,7 +336,7 @@ class SrtpTransportTest : public testing::Test, public sigslot::has_slots<> { class SrtpTransportTestWithExternalAuth : public SrtpTransportTest, - public testing::WithParamInterface {}; + public ::testing::WithParamInterface {}; TEST_P(SrtpTransportTestWithExternalAuth, SendAndRecvPacket_AES_CM_128_HMAC_SHA1_80) { diff --git a/pc/stats_collector_unittest.cc b/pc/stats_collector_unittest.cc index 7ebac7f598..3118ef9cb5 100644 --- a/pc/stats_collector_unittest.cc +++ b/pc/stats_collector_unittest.cc @@ -590,7 +590,7 @@ class StatsCollectorForTest : public StatsCollector { double time_now_; }; -class StatsCollectorTest : public testing::Test { +class StatsCollectorTest : public ::testing::Test { protected: rtc::scoped_refptr CreatePeerConnection() { return new rtc::RefCountedObject(); diff --git a/pc/test/fake_audio_capture_module_unittest.cc b/pc/test/fake_audio_capture_module_unittest.cc index 0130af1f1d..c8be683118 100644 --- a/pc/test/fake_audio_capture_module_unittest.cc +++ b/pc/test/fake_audio_capture_module_unittest.cc @@ -18,7 +18,7 @@ #include "rtc_base/gunit.h" #include "test/gtest.h" -class FakeAdmTest : public testing::Test, public webrtc::AudioTransport { +class FakeAdmTest : public ::testing::Test, public webrtc::AudioTransport { protected: static const int kMsInSecond = 1000; diff --git a/pc/test/mock_data_channel.h b/pc/test/mock_data_channel.h index 2db0c36777..3385ec2f75 100644 --- a/pc/test/mock_data_channel.h +++ b/pc/test/mock_data_channel.h @@ -31,17 +31,17 @@ class MockDataChannel : public rtc::RefCountedObject { uint32_t messages_received, uint64_t bytes_received) : rtc::RefCountedObject(nullptr, cricket::DCT_NONE, label) { - EXPECT_CALL(*this, id()).WillRepeatedly(testing::Return(id)); - EXPECT_CALL(*this, state()).WillRepeatedly(testing::Return(state)); - EXPECT_CALL(*this, protocol()).WillRepeatedly(testing::Return(protocol)); + EXPECT_CALL(*this, id()).WillRepeatedly(::testing::Return(id)); + EXPECT_CALL(*this, state()).WillRepeatedly(::testing::Return(state)); + EXPECT_CALL(*this, protocol()).WillRepeatedly(::testing::Return(protocol)); EXPECT_CALL(*this, messages_sent()) - .WillRepeatedly(testing::Return(messages_sent)); + .WillRepeatedly(::testing::Return(messages_sent)); EXPECT_CALL(*this, bytes_sent()) - .WillRepeatedly(testing::Return(bytes_sent)); + .WillRepeatedly(::testing::Return(bytes_sent)); EXPECT_CALL(*this, messages_received()) - .WillRepeatedly(testing::Return(messages_received)); + .WillRepeatedly(::testing::Return(messages_received)); EXPECT_CALL(*this, bytes_received()) - .WillRepeatedly(testing::Return(bytes_received)); + .WillRepeatedly(::testing::Return(bytes_received)); } MOCK_CONST_METHOD0(id, int()); MOCK_CONST_METHOD0(state, DataState()); diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc index 9edd60e8b9..3b0022c4a5 100644 --- a/pc/track_media_info_map_unittest.cc +++ b/pc/track_media_info_map_unittest.cc @@ -55,13 +55,13 @@ rtc::scoped_refptr CreateMockRtpSender( rtc::scoped_refptr sender( new rtc::RefCountedObject()); EXPECT_CALL(*sender, track()) - .WillRepeatedly(testing::Return(std::move(track))); - EXPECT_CALL(*sender, ssrc()).WillRepeatedly(testing::Return(first_ssrc)); + .WillRepeatedly(::testing::Return(std::move(track))); + EXPECT_CALL(*sender, ssrc()).WillRepeatedly(::testing::Return(first_ssrc)); EXPECT_CALL(*sender, media_type()) - .WillRepeatedly(testing::Return(media_type)); + .WillRepeatedly(::testing::Return(media_type)); EXPECT_CALL(*sender, GetParameters()) - .WillRepeatedly(testing::Return(CreateRtpParametersWithSsrcs(ssrcs))); - EXPECT_CALL(*sender, AttachmentId()).WillRepeatedly(testing::Return(1)); + .WillRepeatedly(::testing::Return(CreateRtpParametersWithSsrcs(ssrcs))); + EXPECT_CALL(*sender, AttachmentId()).WillRepeatedly(::testing::Return(1)); return sender; } @@ -72,16 +72,16 @@ rtc::scoped_refptr CreateMockRtpReceiver( rtc::scoped_refptr receiver( new rtc::RefCountedObject()); EXPECT_CALL(*receiver, track()) - .WillRepeatedly(testing::Return(std::move(track))); + .WillRepeatedly(::testing::Return(std::move(track))); EXPECT_CALL(*receiver, media_type()) - .WillRepeatedly(testing::Return(media_type)); + .WillRepeatedly(::testing::Return(media_type)); EXPECT_CALL(*receiver, GetParameters()) - .WillRepeatedly(testing::Return(CreateRtpParametersWithSsrcs(ssrcs))); - EXPECT_CALL(*receiver, AttachmentId()).WillRepeatedly(testing::Return(1)); + .WillRepeatedly(::testing::Return(CreateRtpParametersWithSsrcs(ssrcs))); + EXPECT_CALL(*receiver, AttachmentId()).WillRepeatedly(::testing::Return(1)); return receiver; } -class TrackMediaInfoMapTest : public testing::Test { +class TrackMediaInfoMapTest : public ::testing::Test { public: TrackMediaInfoMapTest() : voice_media_info_(new cricket::VoiceMediaInfo()), diff --git a/pc/video_track_unittest.cc b/pc/video_track_unittest.cc index c9f9bcbb2b..fc05f66a8e 100644 --- a/pc/video_track_unittest.cc +++ b/pc/video_track_unittest.cc @@ -27,7 +27,7 @@ using webrtc::VideoTrack; using webrtc::VideoTrackInterface; using webrtc::VideoTrackSource; -class VideoTrackTest : public testing::Test { +class VideoTrackTest : public ::testing::Test { public: VideoTrackTest() : frame_source_(640, 480, rtc::kNumMicrosecsPerSec / 30) { static const char kVideoTrackId[] = "track_id"; diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc index 6b3868978f..a700a5a9c9 100644 --- a/pc/webrtc_sdp_unittest.cc +++ b/pc/webrtc_sdp_unittest.cc @@ -998,7 +998,7 @@ static void ReplaceRejected(bool audio_rejected, // WebRtcSdpTest -class WebRtcSdpTest : public testing::Test { +class WebRtcSdpTest : public ::testing::Test { public: WebRtcSdpTest() : jdesc_(kDummyType) { #ifdef WEBRTC_ANDROID @@ -2989,7 +2989,7 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelsAndBandwidth) { } class WebRtcSdpExtmapTest : public WebRtcSdpTest, - public testing::WithParamInterface {}; + public ::testing::WithParamInterface {}; TEST_P(WebRtcSdpExtmapTest, DeserializeSessionDescriptionWithSessionLevelExtmap) { diff --git a/rtc_base/async_tcp_socket_unittest.cc b/rtc_base/async_tcp_socket_unittest.cc index 69b5392773..4fa9d9289e 100644 --- a/rtc_base/async_tcp_socket_unittest.cc +++ b/rtc_base/async_tcp_socket_unittest.cc @@ -17,7 +17,7 @@ namespace rtc { -class AsyncTCPSocketTest : public testing::Test, public sigslot::has_slots<> { +class AsyncTCPSocketTest : public ::testing::Test, public sigslot::has_slots<> { public: AsyncTCPSocketTest() : vss_(new rtc::VirtualSocketServer()), diff --git a/rtc_base/async_udp_socket_unittest.cc b/rtc_base/async_udp_socket_unittest.cc index 0484c3a592..7ef7c86828 100644 --- a/rtc_base/async_udp_socket_unittest.cc +++ b/rtc_base/async_udp_socket_unittest.cc @@ -18,7 +18,7 @@ namespace rtc { -class AsyncUdpSocketTest : public testing::Test, public sigslot::has_slots<> { +class AsyncUdpSocketTest : public ::testing::Test, public sigslot::has_slots<> { public: AsyncUdpSocketTest() : pss_(new rtc::PhysicalSocketServer), diff --git a/rtc_base/helpers_unittest.cc b/rtc_base/helpers_unittest.cc index 1feb9de4a3..8d8f90055d 100644 --- a/rtc_base/helpers_unittest.cc +++ b/rtc_base/helpers_unittest.cc @@ -17,7 +17,7 @@ namespace rtc { -class RandomTest : public testing::Test {}; +class RandomTest : public ::testing::Test {}; TEST_F(RandomTest, TestCreateRandomId) { CreateRandomId(); diff --git a/rtc_base/message_queue_unittest.cc b/rtc_base/message_queue_unittest.cc index 657949c2e3..b7c32e32b0 100644 --- a/rtc_base/message_queue_unittest.cc +++ b/rtc_base/message_queue_unittest.cc @@ -26,7 +26,7 @@ namespace rtc { namespace { -class MessageQueueTest : public testing::Test, public MessageQueue { +class MessageQueueTest : public ::testing::Test, public MessageQueue { public: MessageQueueTest() : MessageQueue(SocketServer::CreateDefault(), true) {} bool IsLocked_Worker() { diff --git a/rtc_base/nat_unittest.cc b/rtc_base/nat_unittest.cc index 7a0761e59c..79f6ea2040 100644 --- a/rtc_base/nat_unittest.cc +++ b/rtc_base/nat_unittest.cc @@ -321,7 +321,7 @@ TEST(NatTest, TestVirtualIPv6) { } } -class NatTcpTest : public testing::Test, public sigslot::has_slots<> { +class NatTcpTest : public ::testing::Test, public sigslot::has_slots<> { public: NatTcpTest() : int_addr_("192.168.0.1", 0), diff --git a/rtc_base/network_unittest.cc b/rtc_base/network_unittest.cc index 08ffb6e909..b35b9f4cb6 100644 --- a/rtc_base/network_unittest.cc +++ b/rtc_base/network_unittest.cc @@ -81,7 +81,7 @@ bool SameNameAndPrefix(const rtc::Network& a, const rtc::Network& b) { } // namespace -class NetworkTest : public testing::Test, public sigslot::has_slots<> { +class NetworkTest : public ::testing::Test, public sigslot::has_slots<> { public: NetworkTest() : callback_called_(false) {} diff --git a/rtc_base/null_socket_server_unittest.cc b/rtc_base/null_socket_server_unittest.cc index 8268911b83..961ab6af35 100644 --- a/rtc_base/null_socket_server_unittest.cc +++ b/rtc_base/null_socket_server_unittest.cc @@ -25,7 +25,7 @@ namespace rtc { static const uint32_t kTimeout = 5000U; -class NullSocketServerTest : public testing::Test, public MessageHandler { +class NullSocketServerTest : public ::testing::Test, public MessageHandler { protected: void OnMessage(Message* message) override { ss_.WakeUp(); } diff --git a/rtc_base/numerics/sample_counter_unittest.cc b/rtc_base/numerics/sample_counter_unittest.cc index e87c8094c3..14b0573de9 100644 --- a/rtc_base/numerics/sample_counter_unittest.cc +++ b/rtc_base/numerics/sample_counter_unittest.cc @@ -15,7 +15,7 @@ #include "test/gmock.h" #include "test/gtest.h" -using testing::Eq; +using ::testing::Eq; namespace rtc { diff --git a/rtc_base/physical_socket_server_unittest.cc b/rtc_base/physical_socket_server_unittest.cc index aed8bf3890..611fb18d37 100644 --- a/rtc_base/physical_socket_server_unittest.cc +++ b/rtc_base/physical_socket_server_unittest.cc @@ -499,7 +499,7 @@ TEST_F(PhysicalSocketTest, server_->set_network_binder(nullptr); } -class PosixSignalDeliveryTest : public testing::Test { +class PosixSignalDeliveryTest : public ::testing::Test { public: static void RecordSignal(int signum) { signals_received_.push_back(signum); diff --git a/rtc_base/proxy_unittest.cc b/rtc_base/proxy_unittest.cc index 229891d52a..59d637aaad 100644 --- a/rtc_base/proxy_unittest.cc +++ b/rtc_base/proxy_unittest.cc @@ -25,7 +25,7 @@ static const SocketAddress kSocksProxyExtAddr("1.2.3.5", 0); static const SocketAddress kBogusProxyIntAddr("1.2.3.4", 999); // Sets up a virtual socket server and a SOCKS5 proxy server. -class ProxyTest : public testing::Test { +class ProxyTest : public ::testing::Test { public: ProxyTest() : ss_(new rtc::VirtualSocketServer()), thread_(ss_.get()) { socks_.reset(new rtc::SocksProxyServer(ss_.get(), kSocksProxyIntAddr, diff --git a/rtc_base/rtc_certificate_generator_unittest.cc b/rtc_base/rtc_certificate_generator_unittest.cc index 69c85976de..959e65a4c4 100644 --- a/rtc_base/rtc_certificate_generator_unittest.cc +++ b/rtc_base/rtc_certificate_generator_unittest.cc @@ -67,7 +67,7 @@ class RTCCertificateGeneratorFixture : public RTCCertificateGeneratorCallback { bool generate_async_completed_; }; -class RTCCertificateGeneratorTest : public testing::Test { +class RTCCertificateGeneratorTest : public ::testing::Test { public: RTCCertificateGeneratorTest() : fixture_(new RefCountedObject()) {} diff --git a/rtc_base/rtc_certificate_unittest.cc b/rtc_base/rtc_certificate_unittest.cc index ab242bbf73..62e9e2c9a2 100644 --- a/rtc_base/rtc_certificate_unittest.cc +++ b/rtc_base/rtc_certificate_unittest.cc @@ -27,7 +27,7 @@ static const char* kTestCertCommonName = "RTCCertificateTest's certificate"; } // namespace -class RTCCertificateTest : public testing::Test { +class RTCCertificateTest : public ::testing::Test { protected: scoped_refptr GenerateECDSA() { std::unique_ptr identity( diff --git a/rtc_base/signal_thread_unittest.cc b/rtc_base/signal_thread_unittest.cc index 2bc0dda8e2..c333ff7a62 100644 --- a/rtc_base/signal_thread_unittest.cc +++ b/rtc_base/signal_thread_unittest.cc @@ -23,7 +23,7 @@ namespace { // 10 seconds. static const int kTimeout = 10000; -class SignalThreadTest : public testing::Test, public sigslot::has_slots<> { +class SignalThreadTest : public ::testing::Test, public sigslot::has_slots<> { public: class SlowSignalThread : public SignalThread { public: diff --git a/rtc_base/sigslot_unittest.cc b/rtc_base/sigslot_unittest.cc index 8edab7c49e..317cd62a45 100644 --- a/rtc_base/sigslot_unittest.cc +++ b/rtc_base/sigslot_unittest.cc @@ -24,7 +24,7 @@ static bool TemplateIsMT(const sigslot::multi_threaded_local* p) { return true; } -class SigslotDefault : public testing::Test, public sigslot::has_slots<> { +class SigslotDefault : public ::testing::Test, public sigslot::has_slots<> { protected: sigslot::signal0<> signal_; }; @@ -64,7 +64,7 @@ class SigslotReceiver : public sigslot::has_slots { template -class SigslotSlotTest : public testing::Test { +class SigslotSlotTest : public ::testing::Test { protected: SigslotSlotTest() { mt_signal_policy mt_policy; diff --git a/rtc_base/socket_unittest.h b/rtc_base/socket_unittest.h index db226c40d3..5197ccd82d 100644 --- a/rtc_base/socket_unittest.h +++ b/rtc_base/socket_unittest.h @@ -19,7 +19,7 @@ namespace rtc { // Generic socket tests, to be used when testing individual socketservers. // Derive your specific test class from SocketTest, install your // socketserver, and call the SocketTest test methods. -class SocketTest : public testing::Test { +class SocketTest : public ::testing::Test { protected: SocketTest() : kIPv4Loopback(INADDR_LOOPBACK), diff --git a/rtc_base/ssl_adapter_unittest.cc b/rtc_base/ssl_adapter_unittest.cc index b459496b58..d723bf1072 100644 --- a/rtc_base/ssl_adapter_unittest.cc +++ b/rtc_base/ssl_adapter_unittest.cc @@ -293,7 +293,7 @@ class SSLAdapterTestDummyServer : public sigslot::has_slots<> { std::string data_; }; -class SSLAdapterTestBase : public testing::Test, public sigslot::has_slots<> { +class SSLAdapterTestBase : public ::testing::Test, public sigslot::has_slots<> { public: explicit SSLAdapterTestBase(const rtc::SSLMode& ssl_mode, const rtc::KeyParams& key_params) diff --git a/rtc_base/ssl_identity_unittest.cc b/rtc_base/ssl_identity_unittest.cc index 748041efa1..8e4d02db41 100644 --- a/rtc_base/ssl_identity_unittest.cc +++ b/rtc_base/ssl_identity_unittest.cc @@ -191,7 +191,7 @@ IdentityAndInfo CreateFakeIdentityAndInfoFromDers( return info; } -class SSLIdentityTest : public testing::Test { +class SSLIdentityTest : public ::testing::Test { public: void SetUp() override { identity_rsa1_.reset(SSLIdentity::Generate("test1", rtc::KT_RSA)); @@ -476,7 +476,7 @@ TEST_F(SSLIdentityTest, SSLCertificateGetStatsWithChain) { } } -class SSLIdentityExpirationTest : public testing::Test { +class SSLIdentityExpirationTest : public ::testing::Test { public: SSLIdentityExpirationTest() { // Set use of the test RNG to get deterministic expiration timestamp. diff --git a/rtc_base/ssl_stream_adapter_unittest.cc b/rtc_base/ssl_stream_adapter_unittest.cc index 7319c015fc..d9cfe1b9bf 100644 --- a/rtc_base/ssl_stream_adapter_unittest.cc +++ b/rtc_base/ssl_stream_adapter_unittest.cc @@ -277,7 +277,7 @@ static const int kFifoBufferSize = 4096; static const int kBufferCapacity = 1; static const size_t kDefaultBufferSize = 2048; -class SSLStreamAdapterTestBase : public testing::Test, +class SSLStreamAdapterTestBase : public ::testing::Test, public sigslot::has_slots<> { public: SSLStreamAdapterTestBase( diff --git a/rtc_base/string_encode_unittest.cc b/rtc_base/string_encode_unittest.cc index cc72e43a28..d4fe2c59c7 100644 --- a/rtc_base/string_encode_unittest.cc +++ b/rtc_base/string_encode_unittest.cc @@ -17,7 +17,7 @@ namespace rtc { -class HexEncodeTest : public testing::Test { +class HexEncodeTest : public ::testing::Test { public: HexEncodeTest() : enc_res_(0), dec_res_(0) { for (size_t i = 0; i < sizeof(data_); ++i) { diff --git a/rtc_base/strings/string_builder_unittest.cc b/rtc_base/strings/string_builder_unittest.cc index 6d8b9f2384..84717ad1d1 100644 --- a/rtc_base/strings/string_builder_unittest.cc +++ b/rtc_base/strings/string_builder_unittest.cc @@ -67,7 +67,7 @@ TEST(SimpleStringBuilder, BufferOverrunConstCharP) { EXPECT_DEATH(sb << msg, ""); #else sb << msg; - EXPECT_THAT(sb.str(), testing::StrEq("Thi")); + EXPECT_THAT(sb.str(), ::testing::StrEq("Thi")); #endif } @@ -80,7 +80,7 @@ TEST(SimpleStringBuilder, BufferOverrunStdString) { EXPECT_DEATH(sb << msg, ""); #else sb << msg; - EXPECT_THAT(sb.str(), testing::StrEq("12A")); + EXPECT_THAT(sb.str(), ::testing::StrEq("12A")); #endif } @@ -96,7 +96,7 @@ TEST(SimpleStringBuilder, BufferOverrunInt) { // the append has no effect or that it's truncated at the point where the // buffer ends. EXPECT_THAT(sb.str(), - testing::AnyOf(testing::StrEq(""), testing::StrEq("-12"))); + ::testing::AnyOf(::testing::StrEq(""), ::testing::StrEq("-12"))); #endif } @@ -109,7 +109,7 @@ TEST(SimpleStringBuilder, BufferOverrunDouble) { #else sb << num; EXPECT_THAT(sb.str(), - testing::AnyOf(testing::StrEq(""), testing::StrEq("123."))); + ::testing::AnyOf(::testing::StrEq(""), ::testing::StrEq("123."))); #endif } @@ -122,7 +122,7 @@ TEST(SimpleStringBuilder, BufferOverrunConstCharPAlreadyFull) { EXPECT_DEATH(sb << msg, ""); #else sb << msg; - EXPECT_THAT(sb.str(), testing::StrEq("123")); + EXPECT_THAT(sb.str(), ::testing::StrEq("123")); #endif } @@ -135,7 +135,7 @@ TEST(SimpleStringBuilder, BufferOverrunIntAlreadyFull) { EXPECT_DEATH(sb << num, ""); #else sb << num; - EXPECT_THAT(sb.str(), testing::StrEq("xyz")); + EXPECT_THAT(sb.str(), ::testing::StrEq("xyz")); #endif } @@ -157,7 +157,7 @@ TEST(StringBuilder, NumbersAndChars) { sb << 1 << ":" << 2.1 << ":" << 2.2f << ":" << 78187493520ll << ":" << 78187493520ul; EXPECT_THAT(sb.str(), - testing::MatchesRegex("1:2.10*:2.20*:78187493520:78187493520")); + ::testing::MatchesRegex("1:2.10*:2.20*:78187493520:78187493520")); } TEST(StringBuilder, Format) { diff --git a/rtc_base/synchronization/yield_policy_unittest.cc b/rtc_base/synchronization/yield_policy_unittest.cc index d7e352b22c..1220808664 100644 --- a/rtc_base/synchronization/yield_policy_unittest.cc +++ b/rtc_base/synchronization/yield_policy_unittest.cc @@ -23,7 +23,7 @@ class MockYieldHandler : public YieldInterface { }; } // namespace TEST(YieldPolicyTest, HandlerReceivesYieldSignalWhenSet) { - testing::StrictMock handler; + ::testing::StrictMock handler; { Event event; EXPECT_CALL(handler, YieldExecution()).Times(1); @@ -42,7 +42,7 @@ TEST(YieldPolicyTest, HandlerReceivesYieldSignalWhenSet) { TEST(YieldPolicyTest, IsThreadLocal) { Event events[3]; std::thread other_thread([&]() { - testing::StrictMock local_handler; + ::testing::StrictMock local_handler; // The local handler is never called as we never Wait on this thread. EXPECT_CALL(local_handler, YieldExecution()).Times(0); ScopedYieldPolicy policy(&local_handler); @@ -58,7 +58,7 @@ TEST(YieldPolicyTest, IsThreadLocal) { events[1].Wait(Event::kForever); // We can set a policy that's active on this thread independently. - testing::StrictMock main_handler; + ::testing::StrictMock main_handler; EXPECT_CALL(main_handler, YieldExecution()).Times(1); ScopedYieldPolicy policy(&main_handler); events[2].Wait(Event::kForever); diff --git a/rtc_base/thread_unittest.cc b/rtc_base/thread_unittest.cc index 63edcf8c19..800f1b1dc3 100644 --- a/rtc_base/thread_unittest.cc +++ b/rtc_base/thread_unittest.cc @@ -425,7 +425,7 @@ TEST(ThreadTest, SetNameOnSignalQueueDestroyed) { delete thread2; } -class AsyncInvokeTest : public testing::Test { +class AsyncInvokeTest : public ::testing::Test { public: void IntCallback(int value) { EXPECT_EQ(expected_thread_, Thread::Current()); @@ -572,7 +572,7 @@ TEST_F(AsyncInvokeTest, FlushWithIds) { EXPECT_TRUE(flag2.get()); } -class GuardedAsyncInvokeTest : public testing::Test { +class GuardedAsyncInvokeTest : public ::testing::Test { public: void IntCallback(int value) { EXPECT_EQ(expected_thread_, Thread::Current()); diff --git a/rtc_base/time_utils_unittest.cc b/rtc_base/time_utils_unittest.cc index b4cefb7e46..b736ad8f51 100644 --- a/rtc_base/time_utils_unittest.cc +++ b/rtc_base/time_utils_unittest.cc @@ -64,7 +64,7 @@ TEST(TimeTest, TestTimeDiff64) { EXPECT_EQ(-ts_diff, rtc::TimeDiff(ts_earlier, ts_later)); } -class TimestampWrapAroundHandlerTest : public testing::Test { +class TimestampWrapAroundHandlerTest : public ::testing::Test { public: TimestampWrapAroundHandlerTest() {} @@ -117,7 +117,7 @@ TEST_F(TimestampWrapAroundHandlerTest, NoNegativeStart) { wraparound_handler_.Unwrap(static_cast(ts & 0xffffffff))); } -class TmToSeconds : public testing::Test { +class TmToSeconds : public ::testing::Test { public: TmToSeconds() { // Set use of the test RNG to get deterministic expiration timestamp. diff --git a/rtc_base/unittest_main.cc b/rtc_base/unittest_main.cc index def010465d..fe3e9e49db 100644 --- a/rtc_base/unittest_main.cc +++ b/rtc_base/unittest_main.cc @@ -74,7 +74,7 @@ int TestCrtReportHandler(int report_type, char* msg, int* retval) { #endif // WEBRTC_WIN int main(int argc, char* argv[]) { - testing::InitGoogleTest(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, false); if (FLAG_help) { rtc::FlagList::Print(nullptr, false); diff --git a/rtc_base/virtual_socket_unittest.cc b/rtc_base/virtual_socket_unittest.cc index ac0af08b3f..94def0d1ae 100644 --- a/rtc_base/virtual_socket_unittest.cc +++ b/rtc_base/virtual_socket_unittest.cc @@ -162,7 +162,7 @@ struct Receiver : public MessageHandler, public sigslot::has_slots<> { }; // Note: This test uses a fake clock in addition to a virtual network. -class VirtualSocketServerTest : public testing::Test { +class VirtualSocketServerTest : public ::testing::Test { public: VirtualSocketServerTest() : ss_(&fake_clock_), diff --git a/rtc_base/win32_unittest.cc b/rtc_base/win32_unittest.cc index 913aa01352..0e2abaac48 100644 --- a/rtc_base/win32_unittest.cc +++ b/rtc_base/win32_unittest.cc @@ -20,7 +20,7 @@ namespace rtc { -class Win32Test : public testing::Test { +class Win32Test : public ::testing::Test { public: Win32Test() {} }; diff --git a/test/mock_audio_decoder_factory.h b/test/mock_audio_decoder_factory.h index e38b1d2fe0..cdf2919543 100644 --- a/test/mock_audio_decoder_factory.h +++ b/test/mock_audio_decoder_factory.h @@ -43,9 +43,9 @@ class MockAudioDecoderFactory : public AudioDecoderFactory { // example. static rtc::scoped_refptr CreateUnusedFactory() { - using testing::_; - using testing::AnyNumber; - using testing::Return; + using ::testing::_; + using ::testing::AnyNumber; + using ::testing::Return; rtc::scoped_refptr factory = new rtc::RefCountedObject; @@ -63,10 +63,10 @@ class MockAudioDecoderFactory : public AudioDecoderFactory { // call, since it supports no codecs. static rtc::scoped_refptr CreateEmptyFactory() { - using testing::_; - using testing::AnyNumber; - using testing::Return; - using testing::SetArgPointee; + using ::testing::_; + using ::testing::AnyNumber; + using ::testing::Return; + using ::testing::SetArgPointee; rtc::scoped_refptr factory = new rtc::RefCountedObject; diff --git a/test/mock_audio_encoder_factory.h b/test/mock_audio_encoder_factory.h index 373bbb6628..3e774a39e9 100644 --- a/test/mock_audio_encoder_factory.h +++ b/test/mock_audio_encoder_factory.h @@ -21,7 +21,8 @@ namespace webrtc { -class MockAudioEncoderFactory : public testing::NiceMock { +class MockAudioEncoderFactory + : public ::testing::NiceMock { public: MOCK_METHOD0(GetSupportedEncoders, std::vector()); MOCK_METHOD1(QueryAudioEncoder, @@ -46,9 +47,9 @@ class MockAudioEncoderFactory : public testing::NiceMock { // example. static rtc::scoped_refptr CreateUnusedFactory() { - using testing::_; - using testing::AnyNumber; - using testing::Return; + using ::testing::_; + using ::testing::AnyNumber; + using ::testing::Return; rtc::scoped_refptr factory = new rtc::RefCountedObject; @@ -68,10 +69,10 @@ class MockAudioEncoderFactory : public testing::NiceMock { // call, since it supports no codecs. static rtc::scoped_refptr CreateEmptyFactory() { - using testing::_; - using testing::AnyNumber; - using testing::Return; - using testing::SetArgPointee; + using ::testing::_; + using ::testing::AnyNumber; + using ::testing::Return; + using ::testing::SetArgPointee; rtc::scoped_refptr factory = new rtc::RefCountedObject; diff --git a/test/scenario/network/network_emulation_unittest.cc b/test/scenario/network/network_emulation_unittest.cc index 5da9ce5f0a..2ed4e6b9f1 100644 --- a/test/scenario/network/network_emulation_unittest.cc +++ b/test/scenario/network/network_emulation_unittest.cc @@ -85,10 +85,10 @@ class NetworkEmulationManagerThreeNodesRoutingTest : public ::testing::Test { } void SendPacketsAndValidateDelivery() { - EXPECT_CALL(r_e1_e2_, OnPacketReceived(testing::_)).Times(1); - EXPECT_CALL(r_e2_e1_, OnPacketReceived(testing::_)).Times(1); - EXPECT_CALL(r_e1_e3_, OnPacketReceived(testing::_)).Times(1); - EXPECT_CALL(r_e3_e1_, OnPacketReceived(testing::_)).Times(1); + EXPECT_CALL(r_e1_e2_, OnPacketReceived(::testing::_)).Times(1); + EXPECT_CALL(r_e2_e1_, OnPacketReceived(::testing::_)).Times(1); + EXPECT_CALL(r_e1_e3_, OnPacketReceived(::testing::_)).Times(1); + EXPECT_CALL(r_e3_e1_, OnPacketReceived(::testing::_)).Times(1); uint16_t common_send_port = 80; uint16_t r_e1_e2_port = e2_->BindReceiver(0, &r_e1_e2_).value(); @@ -148,7 +148,7 @@ EmulatedNetworkNode* CreateEmulatedNodeWithDefaultBuiltInConfig( } // namespace -using testing::_; +using ::testing::_; TEST(NetworkEmulationManagerTest, GeneratedIpv4AddressDoesNotCollide) { NetworkEmulationManagerImpl network_manager; diff --git a/test/scenario/scenario_tests/bbr_performance.cc b/test/scenario/scenario_tests/bbr_performance.cc index 57e17986c1..110bf4bb53 100644 --- a/test/scenario/scenario_tests/bbr_performance.cc +++ b/test/scenario/scenario_tests/bbr_performance.cc @@ -131,7 +131,7 @@ struct CallTestConfig { } // namespace class BbrScenarioTest : public ::testing::Test, - public testing::WithParamInterface> { + public ::testing::WithParamInterface> { public: BbrScenarioTest() { conf_.Parse(::testing::get<0>(GetParam()), ::testing::get<1>(GetParam())); diff --git a/test/testsupport/copy_to_file_audio_capturer_unittest.cc b/test/testsupport/copy_to_file_audio_capturer_unittest.cc index 13c2d009e8..6a4e194ea5 100644 --- a/test/testsupport/copy_to_file_audio_capturer_unittest.cc +++ b/test/testsupport/copy_to_file_audio_capturer_unittest.cc @@ -21,7 +21,7 @@ namespace webrtc { namespace test { -class CopyToFileAudioCapturerTest : public testing::Test { +class CopyToFileAudioCapturerTest : public ::testing::Test { protected: void SetUp() override { temp_filename_ = webrtc::test::TempFilename( diff --git a/test/testsupport/file_utils_unittest.cc b/test/testsupport/file_utils_unittest.cc index 49bc2602e3..d4b4653b45 100644 --- a/test/testsupport/file_utils_unittest.cc +++ b/test/testsupport/file_utils_unittest.cc @@ -68,7 +68,7 @@ void WriteStringInFile(const std::string& what, const std::string& file_path) { // Test fixture to restore the working directory between each test, since some // of them change it with chdir during execution (not restored by the // gtest framework). -class FileUtilsTest : public testing::Test { +class FileUtilsTest : public ::testing::Test { protected: FileUtilsTest() {} ~FileUtilsTest() override {} diff --git a/test/testsupport/perf_test_unittest.cc b/test/testsupport/perf_test_unittest.cc index 6b08a0741c..ecc4258594 100644 --- a/test/testsupport/perf_test_unittest.cc +++ b/test/testsupport/perf_test_unittest.cc @@ -71,7 +71,7 @@ class PerfTest : public ::testing::Test { #define MAYBE_TestPrintResult TestPrintResult #endif TEST_F(PerfTest, MAYBE_TestPrintResult) { - testing::internal::CaptureStdout(); + ::testing::internal::CaptureStdout(); std::string expected; expected += "RESULT measurementmodifier: trace= 42 units\n"; @@ -87,7 +87,7 @@ TEST_F(PerfTest, MAYBE_TestPrintResult) { expected += "RESULT foobar: baz_vl= [1,2,3] units\n"; PrintResultList("foo", "bar", "baz_vl", kListOfScalars, "units", false); - EXPECT_EQ(expected, testing::internal::GetCapturedStdout()); + EXPECT_EQ(expected, ::testing::internal::GetCapturedStdout()); } TEST_F(PerfTest, TestGetPerfResultsJSON) { diff --git a/test/testsupport/video_frame_writer_unittest.cc b/test/testsupport/video_frame_writer_unittest.cc index 8ab931b365..e4a72ddbcc 100644 --- a/test/testsupport/video_frame_writer_unittest.cc +++ b/test/testsupport/video_frame_writer_unittest.cc @@ -86,7 +86,7 @@ void AssertI420BuffersEq( } // namespace -class VideoFrameWriterTest : public testing::Test { +class VideoFrameWriterTest : public ::testing::Test { protected: VideoFrameWriterTest() = default; ~VideoFrameWriterTest() override = default; diff --git a/test/testsupport/y4m_frame_reader_unittest.cc b/test/testsupport/y4m_frame_reader_unittest.cc index 72b421d913..b69a363567 100644 --- a/test/testsupport/y4m_frame_reader_unittest.cc +++ b/test/testsupport/y4m_frame_reader_unittest.cc @@ -35,7 +35,7 @@ const size_t kFrameLength = 3 * kFrameWidth * kFrameHeight / 2; // I420. } // namespace -class Y4mFrameReaderTest : public testing::Test { +class Y4mFrameReaderTest : public ::testing::Test { protected: Y4mFrameReaderTest() = default; ~Y4mFrameReaderTest() override = default; diff --git a/test/testsupport/y4m_frame_writer_unittest.cc b/test/testsupport/y4m_frame_writer_unittest.cc index f1de242c50..7ed84cbe13 100644 --- a/test/testsupport/y4m_frame_writer_unittest.cc +++ b/test/testsupport/y4m_frame_writer_unittest.cc @@ -31,7 +31,7 @@ const std::string kFileHeader = "YUV4MPEG2 W50 H20 F30:1 C420\n"; const std::string kFrameHeader = "FRAME\n"; } // namespace -class Y4mFrameWriterTest : public testing::Test { +class Y4mFrameWriterTest : public ::testing::Test { protected: Y4mFrameWriterTest() = default; ~Y4mFrameWriterTest() override = default; diff --git a/test/testsupport/yuv_frame_reader_unittest.cc b/test/testsupport/yuv_frame_reader_unittest.cc index 9e16307d72..a1937425a2 100644 --- a/test/testsupport/yuv_frame_reader_unittest.cc +++ b/test/testsupport/yuv_frame_reader_unittest.cc @@ -31,7 +31,7 @@ const size_t kFrameHeight = 2; const size_t kFrameLength = 3 * kFrameWidth * kFrameHeight / 2; // I420. } // namespace -class YuvFrameReaderTest : public testing::Test { +class YuvFrameReaderTest : public ::testing::Test { protected: YuvFrameReaderTest() = default; ~YuvFrameReaderTest() override = default; diff --git a/test/testsupport/yuv_frame_writer_unittest.cc b/test/testsupport/yuv_frame_writer_unittest.cc index 12094bb2b7..33980bdea9 100644 --- a/test/testsupport/yuv_frame_writer_unittest.cc +++ b/test/testsupport/yuv_frame_writer_unittest.cc @@ -27,7 +27,7 @@ const size_t kFrameHeight = 20; const size_t kFrameLength = 3 * kFrameWidth * kFrameHeight / 2; // I420. } // namespace -class YuvFrameWriterTest : public testing::Test { +class YuvFrameWriterTest : public ::testing::Test { protected: YuvFrameWriterTest() = default; ~YuvFrameWriterTest() override = default; diff --git a/video/encoder_rtcp_feedback_unittest.cc b/video/encoder_rtcp_feedback_unittest.cc index fd018aeae2..b49a0b9aa1 100644 --- a/video/encoder_rtcp_feedback_unittest.cc +++ b/video/encoder_rtcp_feedback_unittest.cc @@ -32,7 +32,7 @@ class VieKeyRequestTest : public ::testing::Test { const uint32_t kSsrc = 1234; SimulatedClock simulated_clock_; - testing::StrictMock encoder_; + ::testing::StrictMock encoder_; EncoderRtcpFeedback encoder_rtcp_feedback_; }; diff --git a/video/end_to_end_tests/codec_tests.cc b/video/end_to_end_tests/codec_tests.cc index eab9ef7b7c..4149bef79b 100644 --- a/video/end_to_end_tests/codec_tests.cc +++ b/video/end_to_end_tests/codec_tests.cc @@ -35,7 +35,7 @@ enum : int { // The first valid value is 1. } // namespace class CodecEndToEndTest : public test::CallTest, - public testing::WithParamInterface { + public ::testing::WithParamInterface { public: CodecEndToEndTest() : field_trial_(GetParam()) { RegisterRtpExtension( @@ -233,7 +233,7 @@ TEST_P(CodecEndToEndTest, SendsAndReceivesMultiplexVideoRotation90) { #if defined(WEBRTC_USE_H264) class EndToEndTestH264 : public test::CallTest, - public testing::WithParamInterface { + public ::testing::WithParamInterface { public: EndToEndTestH264() : field_trial_(GetParam()) { RegisterRtpExtension(RtpExtension(RtpExtension::kVideoRotationUri, diff --git a/video/overuse_frame_detector_unittest.cc b/video/overuse_frame_detector_unittest.cc index c9ba11ce8c..ebabf113ee 100644 --- a/video/overuse_frame_detector_unittest.cc +++ b/video/overuse_frame_detector_unittest.cc @@ -250,7 +250,7 @@ TEST_F(OveruseFrameDetectorTest, OveruseAndRecover) { EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(1); TriggerOveruse(options_.high_threshold_consecutive_count); // usage < low => underuse - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); TriggerUnderuse(); } @@ -259,7 +259,7 @@ TEST_F(OveruseFrameDetectorTest, DoubleOveruseAndRecover) { EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(2); TriggerOveruse(options_.high_threshold_consecutive_count); TriggerOveruse(options_.high_threshold_consecutive_count); - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); TriggerUnderuse(); } @@ -370,7 +370,7 @@ TEST_F(OveruseFrameDetectorTest, InitialProcessingUsage) { TEST_F(OveruseFrameDetectorTest, MeasuresMultipleConcurrentSamples) { overuse_detector_->SetOptions(options_); - EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(::testing::AtLeast(1)); static const int kIntervalUs = 33 * rtc::kNumMicrosecsPerMillisec; static const size_t kNumFramesEncodingDelay = 3; VideoFrame frame = @@ -397,7 +397,7 @@ TEST_F(OveruseFrameDetectorTest, MeasuresMultipleConcurrentSamples) { TEST_F(OveruseFrameDetectorTest, UpdatesExistingSamples) { // >85% encoding time should trigger overuse. overuse_detector_->SetOptions(options_); - EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(::testing::AtLeast(1)); static const int kIntervalUs = 33 * rtc::kNumMicrosecsPerMillisec; static const int kDelayUs = 30 * rtc::kNumMicrosecsPerMillisec; VideoFrame frame = @@ -576,7 +576,7 @@ TEST_F(OveruseFrameDetectorTest, NoOveruseForLargeRandomFrameInterval) { // EXPECT_CALL(mock_observer_, AdaptDown(_)).Times(0); // EXPECT_CALL(mock_observer_, AdaptUp(reason_)) - // .Times(testing::AtLeast(1)); + // .Times(::testing::AtLeast(1)); overuse_detector_->SetOptions(options_); const int kNumFrames = 500; @@ -605,7 +605,7 @@ TEST_F(OveruseFrameDetectorTest, NoOveruseForRandomFrameIntervalWithReset) { overuse_detector_->SetOptions(options_); EXPECT_CALL(mock_observer_, AdaptDown(_)).Times(0); // EXPECT_CALL(mock_observer_, AdaptUp(reason_)) - // .Times(testing::AtLeast(1)); + // .Times(::testing::AtLeast(1)); const int kNumFrames = 500; const int kEncodeTimeUs = 100 * rtc::kNumMicrosecsPerMillisec; @@ -728,7 +728,7 @@ TEST_F(OveruseFrameDetectorTest2, OveruseAndRecover) { EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(1); TriggerOveruse(options_.high_threshold_consecutive_count); // usage < low => underuse - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); TriggerUnderuse(); } @@ -737,7 +737,7 @@ TEST_F(OveruseFrameDetectorTest2, DoubleOveruseAndRecover) { EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(2); TriggerOveruse(options_.high_threshold_consecutive_count); TriggerOveruse(options_.high_threshold_consecutive_count); - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); TriggerUnderuse(); } @@ -848,7 +848,7 @@ TEST_F(OveruseFrameDetectorTest2, InitialProcessingUsage) { TEST_F(OveruseFrameDetectorTest2, MeasuresMultipleConcurrentSamples) { overuse_detector_->SetOptions(options_); - EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(::testing::AtLeast(1)); static const int kIntervalUs = 33 * rtc::kNumMicrosecsPerMillisec; static const size_t kNumFramesEncodingDelay = 3; VideoFrame frame = @@ -875,7 +875,7 @@ TEST_F(OveruseFrameDetectorTest2, MeasuresMultipleConcurrentSamples) { TEST_F(OveruseFrameDetectorTest2, UpdatesExistingSamples) { // >85% encoding time should trigger overuse. overuse_detector_->SetOptions(options_); - EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptDown(reason_)).Times(::testing::AtLeast(1)); static const int kIntervalUs = 33 * rtc::kNumMicrosecsPerMillisec; static const int kDelayUs = 30 * rtc::kNumMicrosecsPerMillisec; VideoFrame frame = @@ -936,7 +936,7 @@ TEST_F(OveruseFrameDetectorTest2, RunOnTqNormalUsage) { TEST_F(OveruseFrameDetectorTest2, NoOveruseForLargeRandomFrameInterval) { overuse_detector_->SetOptions(options_); EXPECT_CALL(mock_observer_, AdaptDown(_)).Times(0); - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); const int kNumFrames = 500; const int kEncodeTimeUs = 100 * rtc::kNumMicrosecsPerMillisec; @@ -956,7 +956,7 @@ TEST_F(OveruseFrameDetectorTest2, NoOveruseForLargeRandomFrameInterval) { TEST_F(OveruseFrameDetectorTest2, NoOveruseForRandomFrameIntervalWithReset) { overuse_detector_->SetOptions(options_); EXPECT_CALL(mock_observer_, AdaptDown(_)).Times(0); - EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(testing::AtLeast(1)); + EXPECT_CALL(mock_observer_, AdaptUp(reason_)).Times(::testing::AtLeast(1)); const int kNumFrames = 500; const int kEncodeTimeUs = 100 * rtc::kNumMicrosecsPerMillisec; diff --git a/video/receive_statistics_proxy_unittest.cc b/video/receive_statistics_proxy_unittest.cc index 6f04588278..b8293aa7c7 100644 --- a/video/receive_statistics_proxy_unittest.cc +++ b/video/receive_statistics_proxy_unittest.cc @@ -1031,7 +1031,7 @@ TEST_F(ReceiveStatisticsProxyTest, RtcpHistogramsAreUpdated) { class ReceiveStatisticsProxyTestWithFreezeDuration : public ReceiveStatisticsProxyTest, - public testing::WithParamInterface< + public ::testing::WithParamInterface< std::tuple> { protected: const uint32_t frame_duration_ms_ = {std::get<0>(GetParam())}; diff --git a/video/rtp_video_stream_receiver_unittest.cc b/video/rtp_video_stream_receiver_unittest.cc index 34519e3265..5fb1a8c58b 100644 --- a/video/rtp_video_stream_receiver_unittest.cc +++ b/video/rtp_video_stream_receiver_unittest.cc @@ -118,7 +118,7 @@ MATCHER_P(SamePacketAs, other, "") { } // namespace -class RtpVideoStreamReceiverTest : public testing::Test { +class RtpVideoStreamReceiverTest : public ::testing::Test { public: RtpVideoStreamReceiverTest() : RtpVideoStreamReceiverTest("") {} explicit RtpVideoStreamReceiverTest(std::string field_trials) @@ -279,7 +279,7 @@ TEST_F(RtpVideoStreamReceiverTest, GenericKeyFrameBitstreamError) { class RtpVideoStreamReceiverTestH264 : public RtpVideoStreamReceiverTest, - public testing::WithParamInterface { + public ::testing::WithParamInterface { protected: RtpVideoStreamReceiverTestH264() : RtpVideoStreamReceiverTest(GetParam()) {} }; diff --git a/video/video_receive_stream_unittest.cc b/video/video_receive_stream_unittest.cc index 642143a967..0284627102 100644 --- a/video/video_receive_stream_unittest.cc +++ b/video/video_receive_stream_unittest.cc @@ -32,8 +32,8 @@ namespace webrtc { namespace { -using testing::_; -using testing::Invoke; +using ::testing::_; +using ::testing::Invoke; constexpr int kDefaultTimeOutMs = 50; @@ -70,7 +70,7 @@ class FrameObjectFake : public video_coding::EncodedFrame { } // namespace -class VideoReceiveStreamTest : public testing::Test { +class VideoReceiveStreamTest : public ::testing::Test { public: VideoReceiveStreamTest() : process_thread_(ProcessThread::Create("TestThread")), diff --git a/video/video_send_stream_impl_unittest.cc b/video/video_send_stream_impl_unittest.cc index fc0f785bf6..a5e5cd43ff 100644 --- a/video/video_send_stream_impl_unittest.cc +++ b/video/video_send_stream_impl_unittest.cc @@ -32,10 +32,10 @@ namespace webrtc { namespace internal { namespace { -using testing::_; -using testing::Invoke; -using testing::NiceMock; -using testing::Return; +using ::testing::_; +using ::testing::Invoke; +using ::testing::NiceMock; +using ::testing::Return; constexpr int64_t kDefaultInitialBitrateBps = 333000; const double kDefaultBitratePriority = 0.5; @@ -105,11 +105,11 @@ class VideoSendStreamImplTest : public ::testing::Test { CreateRtpVideoSender(_, _, _, _, _, _, _, _, _)) .WillRepeatedly(Return(&rtp_video_sender_)); EXPECT_CALL(rtp_video_sender_, SetActive(_)) - .WillRepeatedly(testing::Invoke( + .WillRepeatedly(::testing::Invoke( [&](bool active) { rtp_video_sender_active_ = active; })); EXPECT_CALL(rtp_video_sender_, IsActive()) .WillRepeatedly( - testing::Invoke([&]() { return rtp_video_sender_active_; })); + ::testing::Invoke([&]() { return rtp_video_sender_active_; })); } ~VideoSendStreamImplTest() {} diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc index 39406c6f7b..0793843940 100644 --- a/video/video_send_stream_tests.cc +++ b/video/video_send_stream_tests.cc @@ -732,9 +732,9 @@ class FlexfecObserver : public test::EndToEndTest { } else { EXPECT_EQ(VideoSendStreamTest::kFakeVideoSendPayloadType, header.payloadType); - EXPECT_THAT(testing::make_tuple(VideoSendStreamTest::kVideoSendSsrcs, - num_video_streams_), - testing::Contains(header.ssrc)); + EXPECT_THAT(::testing::make_tuple(VideoSendStreamTest::kVideoSendSsrcs, + num_video_streams_), + ::testing::Contains(header.ssrc)); sent_media_ = true; } diff --git a/video/video_stream_encoder_unittest.cc b/video/video_stream_encoder_unittest.cc index 71e80631c4..f9b23555ba 100644 --- a/video/video_stream_encoder_unittest.cc +++ b/video/video_stream_encoder_unittest.cc @@ -3697,14 +3697,14 @@ TEST_F(VideoStreamEncoderTest, SetsFrameTypes) { WaitForEncodedFrame(1); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); // Insert delta frame. video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr)); WaitForEncodedFrame(2); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameDelta})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameDelta})); // Request next frame be a key-frame. video_stream_encoder_->SendKeyFrame(); @@ -3712,7 +3712,7 @@ TEST_F(VideoStreamEncoderTest, SetsFrameTypes) { WaitForEncodedFrame(3); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); video_stream_encoder_->Stop(); } @@ -3730,17 +3730,17 @@ TEST_F(VideoStreamEncoderTest, SetsFrameTypesSimulcast) { video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); WaitForEncodedFrame(1); EXPECT_THAT(fake_encoder_.LastFrameTypes(), - testing::ElementsAreArray({VideoFrameType::kVideoFrameKey, - VideoFrameType::kVideoFrameKey, - VideoFrameType::kVideoFrameKey})); + ::testing::ElementsAreArray({VideoFrameType::kVideoFrameKey, + VideoFrameType::kVideoFrameKey, + VideoFrameType::kVideoFrameKey})); // Insert delta frame. video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr)); WaitForEncodedFrame(2); EXPECT_THAT(fake_encoder_.LastFrameTypes(), - testing::ElementsAreArray({VideoFrameType::kVideoFrameDelta, - VideoFrameType::kVideoFrameDelta, - VideoFrameType::kVideoFrameDelta})); + ::testing::ElementsAreArray({VideoFrameType::kVideoFrameDelta, + VideoFrameType::kVideoFrameDelta, + VideoFrameType::kVideoFrameDelta})); // Request next frame be a key-frame. // Only first stream is configured to produce key-frame. @@ -3748,9 +3748,9 @@ TEST_F(VideoStreamEncoderTest, SetsFrameTypesSimulcast) { video_source_.IncomingCapturedFrame(CreateFrame(3, nullptr)); WaitForEncodedFrame(3); EXPECT_THAT(fake_encoder_.LastFrameTypes(), - testing::ElementsAreArray({VideoFrameType::kVideoFrameKey, - VideoFrameType::kVideoFrameDelta, - VideoFrameType::kVideoFrameDelta})); + ::testing::ElementsAreArray({VideoFrameType::kVideoFrameKey, + VideoFrameType::kVideoFrameDelta, + VideoFrameType::kVideoFrameDelta})); video_stream_encoder_->Stop(); } @@ -3768,7 +3768,7 @@ TEST_F(VideoStreamEncoderTest, RequestKeyframeInternalSource) { EXPECT_TRUE(WaitForFrame(kDefaultTimeoutMs)); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); const std::vector kDeltaFrame = { VideoFrameType::kVideoFrameDelta}; @@ -3779,7 +3779,7 @@ TEST_F(VideoStreamEncoderTest, RequestKeyframeInternalSource) { EXPECT_TRUE(WaitForFrame(kDefaultTimeoutMs)); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameDelta})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameDelta})); // Request key-frame. The forces a dummy frame down into the encoder. fake_encoder_.ExpectNullFrame(); @@ -3787,7 +3787,7 @@ TEST_F(VideoStreamEncoderTest, RequestKeyframeInternalSource) { EXPECT_TRUE(WaitForFrame(kDefaultTimeoutMs)); EXPECT_THAT( fake_encoder_.LastFrameTypes(), - testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); + ::testing::ElementsAre(VideoFrameType{VideoFrameType::kVideoFrameKey})); video_stream_encoder_->Stop(); }