mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Fully qualify googletest symbols.
Semi-automatically created with: git grep -l " testing::" | xargs sed -i "s/ testing::/ ::testing::/g" git grep -l "(testing::" | xargs sed -i "s/(testing::/(::testing::/g" git cl format After this, two .cc files failed to compile and I have fixed them manually. Bug: webrtc:10523 Change-Id: I4741d3bcedc831b6c5fdc04485678617eb4ce031 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132018 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27526}
This commit is contained in:
parent
a857698d54
commit
6a489f22c7
210 changed files with 818 additions and 808 deletions
|
@ -66,7 +66,7 @@ struct AudioDecoderFakeApi {
|
|||
absl::optional<AudioCodecPairId> /*codec_pair_id*/ = absl::nullopt) {
|
||||
auto dec = absl::make_unique<testing::StrictMock<MockAudioDecoder>>();
|
||||
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<AudioDecoderFactory> 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<AudioDecoderFakeApi<BogusParams>>();
|
||||
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<BogusParams>,
|
||||
AudioDecoderFakeApi<ShamParams>>();
|
||||
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<AudioDecoderG711>();
|
||||
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<AudioDecoderG722>();
|
||||
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<AudioDecoderIlbc>();
|
||||
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<AudioDecoderIsacFix>();
|
||||
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<AudioDecoderIsacFloat>();
|
||||
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<AudioDecoderL16>();
|
||||
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,
|
||||
|
|
|
@ -67,7 +67,7 @@ struct AudioEncoderFakeApi {
|
|||
absl::optional<AudioCodecPairId> /*codec_pair_id*/ = absl::nullopt) {
|
||||
auto enc = absl::make_unique<testing::StrictMock<MockAudioEncoder>>();
|
||||
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<AudioEncoderFactory> 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<AudioEncoderFakeApi<BogusParams>>();
|
||||
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<BogusParams>,
|
||||
AudioEncoderFakeApi<ShamParams>>();
|
||||
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<AudioEncoderG711>();
|
||||
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<AudioEncoderG722>();
|
||||
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<AudioEncoderIlbc>();
|
||||
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<AudioEncoderIsacFix>();
|
||||
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<AudioEncoderIsacFloat>();
|
||||
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<AudioEncoderL16>();
|
||||
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}));
|
||||
|
|
|
@ -86,11 +86,11 @@ TEST(LoopbackMediaTransport, AudioDeliveredToSink) {
|
|||
std::unique_ptr<rtc::Thread> thread = rtc::Thread::Create();
|
||||
thread->Start();
|
||||
MediaTransportPair transport_pair(thread.get());
|
||||
testing::StrictMock<MockMediaTransportAudioSinkInterface> sink;
|
||||
::testing::StrictMock<MockMediaTransportAudioSinkInterface> 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<rtc::Thread> thread = rtc::Thread::Create();
|
||||
thread->Start();
|
||||
MediaTransportPair transport_pair(thread.get());
|
||||
testing::StrictMock<MockMediaTransportVideoSinkInterface> sink;
|
||||
::testing::StrictMock<MockMediaTransportVideoSinkInterface> 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<rtc::Thread> thread = rtc::Thread::Create();
|
||||
thread->Start();
|
||||
MediaTransportPair transport_pair(thread.get());
|
||||
testing::StrictMock<MockMediaTransportKeyFrameRequestCallback> callback1;
|
||||
testing::StrictMock<MockMediaTransportKeyFrameRequestCallback> callback2;
|
||||
::testing::StrictMock<MockMediaTransportKeyFrameRequestCallback> callback1;
|
||||
::testing::StrictMock<MockMediaTransportKeyFrameRequestCallback> 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, const char*>(
|
||||
&rtc::CopyOnWriteBuffer::cdata, testing::StrEq("foo"))));
|
||||
EXPECT_CALL(
|
||||
sink, OnDataReceived(
|
||||
channel_id, DataMessageType::kText,
|
||||
::testing::Property<rtc::CopyOnWriteBuffer, const char*>(
|
||||
&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));
|
||||
|
|
|
@ -552,8 +552,8 @@ TEST_F(ForcedFallbackTestEnabled, ScalingDisabledIfResizeOff) {
|
|||
}
|
||||
|
||||
TEST(SoftwareFallbackEncoderTest, BothRateControllersNotTrusted) {
|
||||
auto* sw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
|
||||
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<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
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<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
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<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
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<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
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<MockVideoEncoder>();
|
||||
auto* hw_encoder = new testing::NiceMock<MockVideoEncoder>();
|
||||
auto* sw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
auto* hw_encoder = new ::testing::NiceMock<MockVideoEncoder>();
|
||||
EXPECT_CALL(*sw_encoder, GetEncoderInfo())
|
||||
.WillRepeatedly(Return(GetEncoderInfoWithInternalSource(false)));
|
||||
EXPECT_CALL(*hw_encoder, GetEncoderInfo())
|
||||
|
|
|
@ -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<MockAudioMixer> 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<testing::NiceMock<MockAudioDeviceModule>>();
|
||||
audio_state_ = AudioState::Create(config);
|
||||
|
||||
channel_receive_ = new testing::StrictMock<MockChannelReceive>();
|
||||
channel_receive_ = new ::testing::StrictMock<MockChannelReceive>();
|
||||
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<int, SdpAudioFormat>& 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<AudioState> audio_state_;
|
||||
rtc::scoped_refptr<MockAudioMixer> audio_mixer_;
|
||||
AudioReceiveStream::Config stream_config_;
|
||||
testing::StrictMock<MockChannelReceive>* channel_receive_ = nullptr;
|
||||
::testing::StrictMock<MockChannelReceive>* 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);
|
||||
}
|
||||
|
|
|
@ -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<MockAudioEncoder> SetupAudioEncoderMock(
|
|||
for (const auto& spec : kCodecSpecs) {
|
||||
if (format == spec.format) {
|
||||
std::unique_ptr<MockAudioEncoder> encoder(
|
||||
new testing::NiceMock<MockAudioEncoder>());
|
||||
new ::testing::NiceMock<MockAudioEncoder>());
|
||||
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<MockChannelSend>();
|
||||
channel_send_ = new ::testing::StrictMock<MockChannelSend>();
|
||||
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<ReportBlock> report_blocks;
|
||||
webrtc::ReportBlock block = kReportBlock;
|
||||
|
@ -295,15 +295,15 @@ struct ConfigHelper {
|
|||
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
||||
rtc::scoped_refptr<AudioState> audio_state_;
|
||||
AudioSendStream::Config stream_config_;
|
||||
testing::StrictMock<MockChannelSend>* channel_send_ = nullptr;
|
||||
::testing::StrictMock<MockChannelSend>* channel_send_ = nullptr;
|
||||
rtc::scoped_refptr<MockAudioProcessing> audio_processing_;
|
||||
AudioProcessingStats audio_processing_stats_;
|
||||
testing::StrictMock<MockRtcpBandwidthObserver> bandwidth_observer_;
|
||||
testing::NiceMock<MockRtcEventLog> event_log_;
|
||||
testing::NiceMock<MockRtpTransportControllerSend> rtp_transport_;
|
||||
testing::NiceMock<MockRtpRtcp> rtp_rtcp_;
|
||||
::testing::StrictMock<MockRtcpBandwidthObserver> bandwidth_observer_;
|
||||
::testing::NiceMock<MockRtcEventLog> event_log_;
|
||||
::testing::NiceMock<MockRtpTransportControllerSend> rtp_transport_;
|
||||
::testing::NiceMock<MockRtpRtcp> rtp_rtcp_;
|
||||
MockRtcpRttStats rtcp_rtt_stats_;
|
||||
testing::NiceMock<MockLimitObserver> limit_observer_;
|
||||
::testing::NiceMock<MockLimitObserver> 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);
|
||||
|
|
|
@ -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<MockAudioProcessing*>(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<MockAudioProcessing*>(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;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace webrtc {
|
|||
namespace test {
|
||||
|
||||
namespace {
|
||||
using testing::NiceMock;
|
||||
using ::testing::NiceMock;
|
||||
|
||||
constexpr int kPayloadTypeOpus = 17;
|
||||
constexpr int kSamplingFrequency = 48000;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -143,7 +143,7 @@ TEST_F(FlexfecReceiveStreamTest, RecoversPacket) {
|
|||
kPayloadBits, kPayloadBits, kPayloadBits, kPayloadBits};
|
||||
// clang-format on
|
||||
|
||||
testing::StrictMock<MockRecoveredPacketReceiver> recovered_packet_receiver;
|
||||
::testing::StrictMock<MockRecoveredPacketReceiver> recovered_packet_receiver;
|
||||
EXPECT_CALL(process_thread_, RegisterModule(_, _)).Times(1);
|
||||
FlexfecReceiveStreamImpl receive_stream(
|
||||
Clock::GetRealTimeClock(), &rtp_stream_receiver_controller_, config_,
|
||||
|
|
|
@ -39,7 +39,7 @@ class MockRtcpPacketSink : public RtcpPacketSinkInterface {
|
|||
MOCK_METHOD1(OnRtcpPacket, void(rtc::ArrayView<const uint8_t>));
|
||||
};
|
||||
|
||||
class RtcpDemuxerTest : public testing::Test {
|
||||
class RtcpDemuxerTest : public ::testing::Test {
|
||||
protected:
|
||||
~RtcpDemuxerTest() {
|
||||
for (auto* sink : sinks_to_tear_down_) {
|
||||
|
|
|
@ -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())) {}
|
||||
|
|
|
@ -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_) {
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -74,11 +74,11 @@ TEST(RtxReceiveStreamTest, RestoresPacketPayload) {
|
|||
EXPECT_TRUE(rtx_packet.Parse(rtc::ArrayView<const uint8_t>(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<const uint8_t>(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<VideoOrientation>(&rotation));
|
||||
EXPECT_EQ(rotation, kVideoRotation_90);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<int, int, double, double> SincResamplerTestData;
|
||||
class SincResamplerTest : public testing::TestWithParam<SincResamplerTestData> {
|
||||
class SincResamplerTest
|
||||
: public ::testing::TestWithParam<SincResamplerTestData> {
|
||||
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),
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace webrtc_event_logging {
|
|||
namespace {
|
||||
|
||||
template <typename T>
|
||||
class SignednessConversionTest : public testing::Test {
|
||||
class SignednessConversionTest : public ::testing::Test {
|
||||
public:
|
||||
static_assert(std::is_integral<T>::value, "");
|
||||
static_assert(std::is_signed<T>::value, "");
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
class RtcEventLogEncoderTest
|
||||
: public testing::TestWithParam<std::tuple<int, bool, size_t, bool>> {
|
||||
: public ::testing::TestWithParam<std::tuple<int, bool, size_t, bool>> {
|
||||
protected:
|
||||
RtcEventLogEncoderTest()
|
||||
: seed_(std::get<0>(GetParam())),
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<bool> {
|
||||
public:
|
||||
VideoAdapterTest()
|
||||
|
|
|
@ -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<webrtc::MockRtpTransportControllerSend>
|
||||
::testing::NiceMock<webrtc::MockRtpTransportControllerSend>
|
||||
transport_controller_send_;
|
||||
|
||||
webrtc::NetworkState audio_network_state_;
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace cricket {
|
|||
TEST(NullWebRtcVideoEngineTest, CheckInterface) {
|
||||
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
|
||||
webrtc::CreateDefaultTaskQueueFactory();
|
||||
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
auto audio_engine = absl::make_unique<WebRtcVoiceEngine>(
|
||||
task_queue_factory.get(), &adm,
|
||||
webrtc::MockAudioEncoderFactory::CreateUnusedFactory(),
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
namespace cricket {
|
||||
|
||||
class PayloadTypeMapperTest : public testing::Test {
|
||||
class PayloadTypeMapperTest : public ::testing::Test {
|
||||
protected:
|
||||
PayloadTypeMapper mapper_;
|
||||
};
|
||||
|
|
|
@ -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<MockVideoSource> video_source;
|
||||
::testing::NiceMock<MockVideoSource> 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<MockVideoSource> video_source;
|
||||
::testing::NiceMock<MockVideoSource> 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<MockVideoSource> video_source;
|
||||
::testing::NiceMock<MockVideoSource> 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<webrtc::VideoEncoderFactory>(encoder_factory)),
|
||||
(std::unique_ptr<webrtc::VideoDecoderFactory>(decoder_factory)),
|
||||
|
@ -1062,7 +1062,7 @@ TEST(WebRtcVideoEngineNewVideoCodecFactoryTest, Vp8) {
|
|||
const webrtc::SdpVideoFormat vp8_format("VP8");
|
||||
const std::vector<webrtc::SdpVideoFormat> 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<VideoCodec> 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<webrtc::SdpVideoFormat> 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_(),
|
||||
|
|
|
@ -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::WindowsDeviceType>(
|
||||
webrtc::AudioDeviceModule::kDefaultCommunicationDevice)))
|
||||
*adm,
|
||||
SetPlayoutDevice(
|
||||
::testing::Matcher<webrtc::AudioDeviceModule::WindowsDeviceType>(
|
||||
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::WindowsDeviceType>(
|
||||
webrtc::AudioDeviceModule::kDefaultCommunicationDevice)))
|
||||
*adm,
|
||||
SetRecordingDevice(
|
||||
::testing::Matcher<webrtc::AudioDeviceModule::WindowsDeviceType>(
|
||||
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<cricket::WebRtcVoiceMediaChannel> channel1(
|
||||
static_cast<cricket::WebRtcVoiceMediaChannel*>(
|
||||
|
@ -3084,7 +3087,7 @@ TEST_F(WebRtcVoiceEngineTestFake, TestSetDscpOptions) {
|
|||
std::unique_ptr<cricket::WebRtcVoiceMediaChannel> channel;
|
||||
webrtc::RtpParameters parameters;
|
||||
|
||||
EXPECT_CALL(*apm_, SetExtraOptions(testing::_)).Times(3);
|
||||
EXPECT_CALL(*apm_, SetExtraOptions(::testing::_)).Times(3);
|
||||
|
||||
channel.reset(static_cast<cricket::WebRtcVoiceMediaChannel*>(
|
||||
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<webrtc::TaskQueueFactory> task_queue_factory =
|
||||
webrtc::CreateDefaultTaskQueueFactory();
|
||||
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> apm =
|
||||
webrtc::AudioProcessingBuilder().Create();
|
||||
cricket::WebRtcVoiceEngine engine(
|
||||
|
@ -3530,7 +3533,7 @@ TEST(WebRtcVoiceEngineTest, StartupShutdown) {
|
|||
TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) {
|
||||
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
|
||||
webrtc::CreateDefaultTaskQueueFactory();
|
||||
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> 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<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> apm =
|
||||
webrtc::AudioProcessingBuilder().Create();
|
||||
cricket::WebRtcVoiceEngine engine(
|
||||
|
@ -3608,7 +3611,7 @@ TEST(WebRtcVoiceEngineTest, HasCorrectPayloadTypeMapping) {
|
|||
TEST(WebRtcVoiceEngineTest, Has32Channels) {
|
||||
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory =
|
||||
webrtc::CreateDefaultTaskQueueFactory();
|
||||
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> 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<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> apm =
|
||||
webrtc::AudioProcessingBuilder().Create();
|
||||
cricket::WebRtcVoiceEngine engine(
|
||||
|
@ -3695,7 +3698,7 @@ TEST(WebRtcVoiceEngineTest, CollectRecvCodecs) {
|
|||
new rtc::RefCountedObject<webrtc::MockAudioDecoderFactory>;
|
||||
EXPECT_CALL(*mock_decoder_factory.get(), GetSupportedDecoders())
|
||||
.WillOnce(Return(specs));
|
||||
testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
::testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
|
||||
|
||||
rtc::scoped_refptr<webrtc::AudioProcessing> apm =
|
||||
webrtc::AudioProcessingBuilder().Create();
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -48,7 +48,7 @@ struct EventLogWriterStates {
|
|||
|
||||
EventLogWriterStates CreateEventLogWriter() {
|
||||
EventLogWriterStates state;
|
||||
state.event_log.reset(new testing::StrictMock<MockRtcEventLog>());
|
||||
state.event_log.reset(new ::testing::StrictMock<MockRtcEventLog>());
|
||||
state.event_log_writer.reset(new EventLogWriter(
|
||||
state.event_log.get(), kMinBitrateChangeBps, kMinBitrateChangeFraction,
|
||||
kMinPacketLossChangeFraction));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(); }
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ struct IsacTestParam {
|
|||
}
|
||||
};
|
||||
|
||||
class IsacCommonTest : public testing::TestWithParam<IsacTestParam> {};
|
||||
class IsacCommonTest : public ::testing::TestWithParam<IsacTestParam> {};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -252,6 +252,6 @@ std::vector<IsacTestParam> TestCases() {
|
|||
return cases;
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(, IsacCommonTest, testing::ValuesIn(TestCases()));
|
||||
INSTANTIATE_TEST_SUITE_P(, IsacCommonTest, ::testing::ValuesIn(TestCases()));
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
|
@ -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<unsigned char>({3, 1, 2, 0})));
|
||||
::testing::ContainerEq(std::vector<unsigned char>({3, 1, 2, 0})));
|
||||
}
|
||||
|
||||
TEST(AudioDecoderMultiOpusTest, InvalidSdpToConfigDoesNotProduceConfig) {
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace webrtc {
|
|||
// <channels, bit_rate, file_name, extension, if_save_output>.
|
||||
typedef std::tuple<size_t, int, std::string, std::string, bool> coding_param;
|
||||
|
||||
class AudioCodecSpeedTest : public testing::TestWithParam<coding_param> {
|
||||
class AudioCodecSpeedTest : public ::testing::TestWithParam<coding_param> {
|
||||
protected:
|
||||
AudioCodecSpeedTest(int block_duration_ms,
|
||||
int input_sampling_khz,
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -59,7 +59,7 @@ void RunTestViaRtcPlatformFileAPI(
|
|||
std::vector<int16_t> 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()));
|
||||
}
|
||||
|
|
|
@ -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<AudioMixer::Source> {
|
||||
class MockMixerAudioSource : public ::testing::NiceMock<AudioMixer::Source> {
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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<webrtc::test::MockRenderDelayBuffer>(rate));
|
||||
std::unique_ptr<
|
||||
testing::StrictMock<webrtc::test::MockRenderDelayController>>
|
||||
::testing::StrictMock<webrtc::test::MockRenderDelayController>>
|
||||
render_delay_controller_mock(
|
||||
new StrictMock<webrtc::test::MockRenderDelayController>());
|
||||
std::unique_ptr<testing::StrictMock<webrtc::test::MockEchoRemover>>
|
||||
|
|
|
@ -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, _))
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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<webrtc::AudioProcessing> CreateAudioProcessing() {
|
||||
|
|
|
@ -683,7 +683,7 @@ TEST_F(AgcManagerDirectTest, TakesNoActionOnZeroMicVolume) {
|
|||
}
|
||||
|
||||
TEST(AgcManagerDirectStandaloneTest, DisableDigitalDisablesDigital) {
|
||||
auto agc = std::unique_ptr<Agc>(new testing::NiceMock<MockAgc>());
|
||||
auto agc = std::unique_ptr<Agc>(new ::testing::NiceMock<MockAgc>());
|
||||
test::MockGainControl gctrl;
|
||||
TestVolumeCallbacks volume;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ constexpr std::array<float, 2> kTestPitchGains = {0.35f, 0.75f};
|
|||
} // namespace
|
||||
|
||||
class ComputePitchGainThresholdTest
|
||||
: public testing::Test,
|
||||
: public ::testing::Test,
|
||||
public ::testing::WithParamInterface<
|
||||
std::tuple<size_t, size_t, size_t, float, size_t, float, float>> {};
|
||||
|
||||
|
@ -124,7 +124,7 @@ TEST(RnnVadTest, RefinePitchPeriod48kHzBitExactness) {
|
|||
}
|
||||
|
||||
class CheckLowerPitchPeriodsAndComputePitchGainTest
|
||||
: public testing::Test,
|
||||
: public ::testing::Test,
|
||||
public ::testing::WithParamInterface<
|
||||
std::tuple<int, int, float, int, float>> {};
|
||||
|
||||
|
|
|
@ -2142,7 +2142,7 @@ void UpdateBestSNR(const float* ref,
|
|||
// case SNR which corresponds to inf, or zero error.
|
||||
typedef std::tuple<int, int, int, int, double, double> AudioProcessingTestData;
|
||||
class AudioProcessingTest
|
||||
: public testing::TestWithParam<AudioProcessingTestData> {
|
||||
: public ::testing::TestWithParam<AudioProcessingTestData> {
|
||||
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<test::MockCustomProcessing>();
|
||||
new ::testing::NiceMock<test::MockCustomProcessing>();
|
||||
auto mock_post_processor =
|
||||
std::unique_ptr<CustomProcessing>(mock_post_processor_ptr);
|
||||
rtc::scoped_refptr<AudioProcessing> 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<test::MockCustomProcessing>();
|
||||
new ::testing::NiceMock<test::MockCustomProcessing>();
|
||||
auto mock_pre_processor =
|
||||
std::unique_ptr<CustomProcessing>(mock_pre_processor_ptr);
|
||||
rtc::scoped_refptr<AudioProcessing> 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<test::MockCustomAudioAnalyzer>();
|
||||
new ::testing::NiceMock<test::MockCustomAudioAnalyzer>();
|
||||
auto mock_capture_analyzer =
|
||||
std::unique_ptr<CustomAudioAnalyzer>(mock_capture_analyzer_ptr);
|
||||
rtc::scoped_refptr<AudioProcessing> 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<test::MockCustomProcessing>();
|
||||
new ::testing::NiceMock<test::MockCustomProcessing>();
|
||||
auto mock_pre_processor =
|
||||
std::unique_ptr<CustomProcessing>(mock_pre_processor_ptr);
|
||||
rtc::scoped_refptr<AudioProcessing> 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<EchoControl> 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<EchoControl>(ec);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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<test::MockAudioProcessing>>()),
|
||||
::testing::StrictMock<test::MockAudioProcessing>>()),
|
||||
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<testing::StrictMock<test::MockAudioProcessing>> apm_;
|
||||
testing::StrictMock<test::MockGainControl> agc_;
|
||||
::testing::StrictMock<test::MockGainControl> 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());
|
||||
|
|
|
@ -202,8 +202,8 @@ struct FixedDigitalTestParams {
|
|||
};
|
||||
|
||||
class FixedDigitalTest
|
||||
: public testing::Test,
|
||||
public testing::WithParamInterface<FixedDigitalTestParams> {};
|
||||
: public ::testing::Test,
|
||||
public ::testing::WithParamInterface<FixedDigitalTestParams> {};
|
||||
|
||||
TEST_P(FixedDigitalTest, CheckSaturationBehaviorWithLimiter) {
|
||||
const float kInputLevel = 32767.f;
|
||||
|
|
|
@ -103,13 +103,13 @@ class MockVoiceDetection : public VoiceDetection {
|
|||
MOCK_CONST_METHOD0(frame_size_ms, int());
|
||||
};
|
||||
|
||||
class MockAudioProcessing : public testing::NiceMock<AudioProcessing> {
|
||||
class MockAudioProcessing : public ::testing::NiceMock<AudioProcessing> {
|
||||
public:
|
||||
MockAudioProcessing()
|
||||
: gain_control_(new testing::NiceMock<MockGainControl>()),
|
||||
level_estimator_(new testing::NiceMock<MockLevelEstimator>()),
|
||||
noise_suppression_(new testing::NiceMock<MockNoiseSuppression>()),
|
||||
voice_detection_(new testing::NiceMock<MockVoiceDetection>()) {}
|
||||
: gain_control_(new ::testing::NiceMock<MockGainControl>()),
|
||||
level_estimator_(new ::testing::NiceMock<MockLevelEstimator>()),
|
||||
noise_suppression_(new ::testing::NiceMock<MockNoiseSuppression>()),
|
||||
voice_detection_(new ::testing::NiceMock<MockVoiceDetection>()) {}
|
||||
|
||||
virtual ~MockAudioProcessing() {}
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<size_t> {};
|
||||
|
||||
TEST_P(PffftInvalidSizeTest, DoNotCreateRealWrapper) {
|
||||
|
|
|
@ -94,7 +94,7 @@ class BitrateControllerTest : public ::testing::Test {
|
|||
TestBitrateObserver bitrate_observer_;
|
||||
std::unique_ptr<BitrateController> controller_;
|
||||
RtcpBandwidthObserver* bandwidth_observer_;
|
||||
testing::NiceMock<webrtc::MockRtcEventLog> event_log_;
|
||||
::testing::NiceMock<webrtc::MockRtcEventLog> event_log_;
|
||||
};
|
||||
|
||||
TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) {
|
||||
|
|
|
@ -34,7 +34,7 @@ MATCHER(LossBasedBweUpdateWithBitrateAndLossFraction, "") {
|
|||
}
|
||||
|
||||
void TestProbing(bool use_delay_based) {
|
||||
testing::NiceMock<MockRtcEventLog> event_log;
|
||||
::testing::NiceMock<MockRtcEventLog> event_log;
|
||||
SendSideBandwidthEstimation bwe(&event_log);
|
||||
int64_t now_ms = 0;
|
||||
bwe.SetMinMaxBitrate(DataRate::bps(100000), DataRate::bps(1500000));
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
|
||||
using testing::_;
|
||||
using ::testing::_;
|
||||
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -109,10 +109,10 @@ TEST(PccBitrateControllerTest, IncreaseRateWhenNoChangesForTestBitrates) {
|
|||
TEST(PccBitrateControllerTest, NoChangesWhenUtilityFunctionDoesntChange) {
|
||||
std::unique_ptr<MockUtilityFunction> mock_utility_function =
|
||||
absl::make_unique<MockUtilityFunction>();
|
||||
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<MockUtilityFunction> mock_utility_function =
|
||||
absl::make_unique<MockUtilityFunction>();
|
||||
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<PccMonitorInterval> monitor_block{
|
||||
PccMonitorInterval(kTargetSendingRate * (1 + kEpsilon), kStartTime,
|
||||
kIntervalDuration),
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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, _, _, _));
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
namespace webrtc {
|
||||
|
||||
class BlankDetectorDesktopCapturerWrapperTest
|
||||
: public testing::Test,
|
||||
: public ::testing::Test,
|
||||
public DesktopCapturer::Callback {
|
||||
public:
|
||||
BlankDetectorDesktopCapturerWrapperTest();
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -117,21 +117,22 @@ void ExecuteDifferWrapperCase(BlackWhiteDesktopFramePainter* frame_painter,
|
|||
const T<DesktopRect, Rect...>& 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<DesktopFrame>* 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<DesktopFrame>* 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<DesktopFrame>* frame) {
|
||||
.WillOnce(::testing::Invoke([](DesktopCapturer::Result result,
|
||||
std::unique_ptr<DesktopFrame>* frame) {
|
||||
ASSERT_EQ(result, DesktopCapturer::Result::SUCCESS);
|
||||
AssertUpdatedRegionIs(**frame,
|
||||
{DesktopRect::MakeSize((*frame)->size())});
|
||||
|
|
|
@ -65,7 +65,7 @@ std::unique_ptr<SharedMemory> FakeSharedMemoryFactory::CreateSharedMemory(
|
|||
|
||||
} // namespace
|
||||
|
||||
class FallbackDesktopCapturerWrapperTest : public testing::Test,
|
||||
class FallbackDesktopCapturerWrapperTest : public ::testing::Test,
|
||||
public DesktopCapturer::Callback {
|
||||
public:
|
||||
FallbackDesktopCapturerWrapperTest();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class MouseCursorMonitorTest : public testing::Test,
|
||||
class MouseCursorMonitorTest : public ::testing::Test,
|
||||
public MouseCursorMonitor::Callback {
|
||||
public:
|
||||
MouseCursorMonitorTest() : position_received_(false) {}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class ScreenCapturerHelperTest : public testing::Test {
|
||||
class ScreenCapturerHelperTest : public ::testing::Test {
|
||||
protected:
|
||||
ScreenCapturerHelper capturer_helper_;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class WindowCapturerTest : public testing::Test,
|
||||
class WindowCapturerTest : public ::testing::Test,
|
||||
public DesktopCapturer::Callback {
|
||||
public:
|
||||
void SetUp() override {
|
||||
|
|
|
@ -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<std::string> {
|
||||
class PacedSenderTest : public ::testing::TestWithParam<std::string> {
|
||||
protected:
|
||||
PacedSenderTest() : clock_(123456) {
|
||||
srand(0);
|
||||
|
@ -141,7 +141,7 @@ class PacedSenderTest : public testing::TestWithParam<std::string> {
|
|||
std::unique_ptr<PacedSender> 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).
|
||||
|
|
|
@ -83,7 +83,7 @@ class RemoteEstimatorProxyTest : public ::testing::Test {
|
|||
}
|
||||
|
||||
SimulatedClock clock_;
|
||||
testing::StrictMock<MockTransportFeedbackSender> router_;
|
||||
::testing::StrictMock<MockTransportFeedbackSender> router_;
|
||||
RemoteEstimatorProxy proxy_;
|
||||
};
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class FlexfecReceiverTest : public ::testing::Test {
|
|||
std::unique_ptr<ForwardErrorCorrection> erasure_code_;
|
||||
|
||||
FlexfecPacketGenerator packet_generator_;
|
||||
testing::StrictMock<MockRecoveredPacketReceiver> recovered_packet_receiver_;
|
||||
::testing::StrictMock<MockRecoveredPacketReceiver> recovered_packet_receiver_;
|
||||
};
|
||||
|
||||
void FlexfecReceiverTest::PacketizeFrame(size_t num_media_packets,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -201,11 +201,12 @@ class RtpSenderTest : public ::testing::TestWithParam<bool> {
|
|||
}
|
||||
|
||||
SimulatedClock fake_clock_;
|
||||
testing::NiceMock<MockRtcEventLog> mock_rtc_event_log_;
|
||||
::testing::NiceMock<MockRtcEventLog> mock_rtc_event_log_;
|
||||
MockRtpPacketSender mock_paced_sender_;
|
||||
testing::StrictMock<MockTransportSequenceNumberAllocator> seq_num_allocator_;
|
||||
testing::StrictMock<MockSendPacketObserver> send_packet_observer_;
|
||||
testing::StrictMock<MockTransportFeedbackObserver> feedback_observer_;
|
||||
::testing::StrictMock<MockTransportSequenceNumberAllocator>
|
||||
seq_num_allocator_;
|
||||
::testing::StrictMock<MockSendPacketObserver> send_packet_observer_;
|
||||
::testing::StrictMock<MockTransportFeedbackObserver> feedback_observer_;
|
||||
RateLimiter retransmission_rate_limiter_;
|
||||
std::unique_ptr<RTPSender> 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<MockOverheadObserver> mock_overhead_observer;
|
||||
::testing::NiceMock<MockOverheadObserver> 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<MockSendSideDelayObserver> send_side_delay_observer_;
|
||||
::testing::StrictMock<MockSendSideDelayObserver> 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));
|
||||
|
|
|
@ -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) {}
|
||||
|
||||
|
|
|
@ -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<bool /* supports_augmenting_data */> {
|
||||
class TestMultiplexAdapter : public VideoCodecUnitTest,
|
||||
public ::testing::WithParamInterface<
|
||||
bool /* supports_augmenting_data */> {
|
||||
public:
|
||||
TestMultiplexAdapter()
|
||||
: decoder_factory_(new webrtc::MockVideoDecoderFactory),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<uint8_t, webrtc::kMaxTemporalStreams>;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue