Reland "Enable and fix chromium clang warnings in rtp_rtcp test targets"
This reverts commit 01aa210fad68f1006528d32d388b307c22990734. Reason for revert: downstream project adjusted Original change's description: > Revert "Enable and fix chromium clang warnings in rtp_rtcp test targets" > > This reverts commit 9486b117daac09c9f7ac8450ccda835938cf3150. > > Reason for revert: Breaks downstream project > > Original change's description: > > Enable and fix chromium clang warnings in rtp_rtcp test targets > > > > Bug: webrtc:163 > > Change-Id: I4ed3e63296d8bf06536a83196d597c7a906ba11c > > Reviewed-on: https://webrtc-review.googlesource.com/60802 > > Reviewed-by: Björn Terelius <terelius@webrtc.org> > > Reviewed-by: Patrik Höglund <phoglund@webrtc.org> > > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#22357} > > TBR=danilchap@webrtc.org,phoglund@webrtc.org,terelius@webrtc.org > > Change-Id: I2c3777ea9f26813bdb395e7fd68f6b49443586ea > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:163 > Reviewed-on: https://webrtc-review.googlesource.com/61060 > Reviewed-by: Oleh Prypin <oprypin@webrtc.org> > Commit-Queue: Oleh Prypin <oprypin@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#22365} TBR=danilchap@webrtc.org,phoglund@webrtc.org,oprypin@webrtc.org,terelius@webrtc.org Change-Id: I0b4cb6d05b37caeb52cca9abf95417ad3ad6f76b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:163 Reviewed-on: https://webrtc-review.googlesource.com/61080 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22368}
This commit is contained in:
parent
5081c0cc6d
commit
dd7e284ce8
@ -421,6 +421,7 @@ if (rtc_include_tests) {
|
|||||||
rtc_source_set("mocks") {
|
rtc_source_set("mocks") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
|
"rtc_event_log/mock/mock_rtc_event_log.cc",
|
||||||
"rtc_event_log/mock/mock_rtc_event_log.h",
|
"rtc_event_log/mock/mock_rtc_event_log.h",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
|
|||||||
19
logging/rtc_event_log/mock/mock_rtc_event_log.cc
Normal file
19
logging/rtc_event_log/mock/mock_rtc_event_log.cc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockRtcEventLog::MockRtcEventLog() = default;
|
||||||
|
MockRtcEventLog::~MockRtcEventLog() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
|
|
||||||
@ -20,6 +20,9 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockRtcEventLog : public RtcEventLog {
|
class MockRtcEventLog : public RtcEventLog {
|
||||||
public:
|
public:
|
||||||
|
MockRtcEventLog();
|
||||||
|
~MockRtcEventLog();
|
||||||
|
|
||||||
virtual bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
|
virtual bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
|
||||||
int64_t output_period_ms) {
|
int64_t output_period_ms) {
|
||||||
return StartLoggingProxy(output.get(), output_period_ms);
|
return StartLoggingProxy(output.get(), output_period_ms);
|
||||||
|
|||||||
@ -264,15 +264,17 @@ rtc_source_set("fec_test_helper") {
|
|||||||
|
|
||||||
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
|
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
|
||||||
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||||||
if (!build_with_chromium && is_clang) {
|
|
||||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
|
||||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_source_set("mock_rtp_rtcp") {
|
rtc_source_set("mock_rtp_rtcp") {
|
||||||
testonly = true
|
testonly = true
|
||||||
sources = [
|
sources = [
|
||||||
|
"mocks/mock_recovered_packet_receiver.cc",
|
||||||
|
"mocks/mock_rtcp_bandwidth_observer.cc",
|
||||||
|
"mocks/mock_rtcp_rtt_stats.cc",
|
||||||
|
"mocks/mock_rtp_rtcp.cc",
|
||||||
|
]
|
||||||
|
public = [
|
||||||
"mocks/mock_recovered_packet_receiver.h",
|
"mocks/mock_recovered_packet_receiver.h",
|
||||||
"mocks/mock_rtcp_bandwidth_observer.h",
|
"mocks/mock_rtcp_bandwidth_observer.h",
|
||||||
"mocks/mock_rtcp_rtt_stats.h",
|
"mocks/mock_rtcp_rtt_stats.h",
|
||||||
@ -317,10 +319,6 @@ if (rtc_include_tests) {
|
|||||||
"../../rtc_base:rtc_base_approved",
|
"../../rtc_base:rtc_base_approved",
|
||||||
"../../test:test_support",
|
"../../test:test_support",
|
||||||
]
|
]
|
||||||
if (!build_with_chromium && is_clang) {
|
|
||||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
|
||||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rtc_source_set("rtp_rtcp_unittests") {
|
rtc_source_set("rtp_rtcp_unittests") {
|
||||||
@ -422,9 +420,5 @@ if (rtc_include_tests) {
|
|||||||
|
|
||||||
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
|
# TODO(jschuh): bugs.webrtc.org/1348: fix this warning.
|
||||||
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||||||
if (!build_with_chromium && is_clang) {
|
|
||||||
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
|
|
||||||
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.cc
Normal file
18
modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.cc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "modules/rtp_rtcp/mocks/mock_recovered_packet_receiver.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockRecoveredPacketReceiver::MockRecoveredPacketReceiver() = default;
|
||||||
|
MockRecoveredPacketReceiver::~MockRecoveredPacketReceiver() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
@ -19,6 +19,8 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockRecoveredPacketReceiver : public RecoveredPacketReceiver {
|
class MockRecoveredPacketReceiver : public RecoveredPacketReceiver {
|
||||||
public:
|
public:
|
||||||
|
MockRecoveredPacketReceiver();
|
||||||
|
~MockRecoveredPacketReceiver();
|
||||||
MOCK_METHOD2(OnRecoveredPacket, void(const uint8_t* packet, size_t length));
|
MOCK_METHOD2(OnRecoveredPacket, void(const uint8_t* packet, size_t length));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
18
modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.cc
Normal file
18
modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.cc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "modules/rtp_rtcp/mocks/mock_rtcp_bandwidth_observer.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockRtcpBandwidthObserver::MockRtcpBandwidthObserver() = default;
|
||||||
|
MockRtcpBandwidthObserver::~MockRtcpBandwidthObserver() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
@ -18,6 +18,9 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockRtcpBandwidthObserver : public RtcpBandwidthObserver {
|
class MockRtcpBandwidthObserver : public RtcpBandwidthObserver {
|
||||||
public:
|
public:
|
||||||
|
MockRtcpBandwidthObserver();
|
||||||
|
~MockRtcpBandwidthObserver();
|
||||||
|
|
||||||
MOCK_METHOD1(OnReceivedEstimatedBitrate, void(uint32_t));
|
MOCK_METHOD1(OnReceivedEstimatedBitrate, void(uint32_t));
|
||||||
MOCK_METHOD3(OnReceivedRtcpReceiverReport,
|
MOCK_METHOD3(OnReceivedRtcpReceiverReport,
|
||||||
void(const ReportBlockList&, int64_t, int64_t));
|
void(const ReportBlockList&, int64_t, int64_t));
|
||||||
|
|||||||
18
modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.cc
Normal file
18
modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.cc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockRtcpRttStats::MockRtcpRttStats() = default;
|
||||||
|
MockRtcpRttStats::~MockRtcpRttStats() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
@ -18,6 +18,9 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockRtcpRttStats : public RtcpRttStats {
|
class MockRtcpRttStats : public RtcpRttStats {
|
||||||
public:
|
public:
|
||||||
|
MockRtcpRttStats();
|
||||||
|
~MockRtcpRttStats();
|
||||||
|
|
||||||
MOCK_METHOD1(OnRttUpdate, void(int64_t rtt));
|
MOCK_METHOD1(OnRttUpdate, void(int64_t rtt));
|
||||||
MOCK_CONST_METHOD0(LastProcessedRtt, int64_t());
|
MOCK_CONST_METHOD0(LastProcessedRtt, int64_t());
|
||||||
};
|
};
|
||||||
|
|||||||
21
modules/rtp_rtcp/mocks/mock_rtp_rtcp.cc
Normal file
21
modules/rtp_rtcp/mocks/mock_rtp_rtcp.cc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockRtpData::MockRtpData() = default;
|
||||||
|
MockRtpData::~MockRtpData() = default;
|
||||||
|
|
||||||
|
MockRtpRtcp::MockRtpRtcp() = default;
|
||||||
|
MockRtpRtcp::~MockRtpRtcp() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
@ -27,6 +27,9 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockRtpData : public RtpData {
|
class MockRtpData : public RtpData {
|
||||||
public:
|
public:
|
||||||
|
MockRtpData();
|
||||||
|
~MockRtpData();
|
||||||
|
|
||||||
MOCK_METHOD3(OnReceivedPayloadData,
|
MOCK_METHOD3(OnReceivedPayloadData,
|
||||||
int32_t(const uint8_t* payload_data,
|
int32_t(const uint8_t* payload_data,
|
||||||
size_t payload_size,
|
size_t payload_size,
|
||||||
@ -35,6 +38,9 @@ class MockRtpData : public RtpData {
|
|||||||
|
|
||||||
class MockRtpRtcp : public RtpRtcp {
|
class MockRtpRtcp : public RtpRtcp {
|
||||||
public:
|
public:
|
||||||
|
MockRtpRtcp();
|
||||||
|
~MockRtpRtcp();
|
||||||
|
|
||||||
MOCK_METHOD1(RegisterDefaultModule, int32_t(RtpRtcp* module));
|
MOCK_METHOD1(RegisterDefaultModule, int32_t(RtpRtcp* module));
|
||||||
MOCK_METHOD0(DeRegisterDefaultModule, int32_t());
|
MOCK_METHOD0(DeRegisterDefaultModule, int32_t());
|
||||||
MOCK_METHOD0(DefaultModuleRegistered, bool());
|
MOCK_METHOD0(DefaultModuleRegistered, bool());
|
||||||
|
|||||||
@ -18,8 +18,8 @@ namespace {
|
|||||||
|
|
||||||
class ByteIoTest : public ::testing::Test {
|
class ByteIoTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
ByteIoTest() {}
|
ByteIoTest() = default;
|
||||||
virtual ~ByteIoTest() {}
|
~ByteIoTest() override = default;
|
||||||
|
|
||||||
enum { kAlignments = sizeof(uint64_t) - 1 };
|
enum { kAlignments = sizeof(uint64_t) - 1 };
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,17 @@ constexpr uint8_t kVp8PayloadType = 120;
|
|||||||
constexpr int kPacketTimestampIncrement = 3000;
|
constexpr int kPacketTimestampIncrement = 3000;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
MediaPacketGenerator::MediaPacketGenerator(uint32_t min_packet_size,
|
||||||
|
uint32_t max_packet_size,
|
||||||
|
uint32_t ssrc,
|
||||||
|
Random* random)
|
||||||
|
: min_packet_size_(min_packet_size),
|
||||||
|
max_packet_size_(max_packet_size),
|
||||||
|
ssrc_(ssrc),
|
||||||
|
random_(random) {}
|
||||||
|
|
||||||
|
MediaPacketGenerator::~MediaPacketGenerator() = default;
|
||||||
|
|
||||||
ForwardErrorCorrection::PacketList MediaPacketGenerator::ConstructMediaPackets(
|
ForwardErrorCorrection::PacketList MediaPacketGenerator::ConstructMediaPackets(
|
||||||
int num_media_packets,
|
int num_media_packets,
|
||||||
uint16_t start_seq_num) {
|
uint16_t start_seq_num) {
|
||||||
|
|||||||
@ -36,11 +36,8 @@ class MediaPacketGenerator {
|
|||||||
MediaPacketGenerator(uint32_t min_packet_size,
|
MediaPacketGenerator(uint32_t min_packet_size,
|
||||||
uint32_t max_packet_size,
|
uint32_t max_packet_size,
|
||||||
uint32_t ssrc,
|
uint32_t ssrc,
|
||||||
Random* random)
|
Random* random);
|
||||||
: min_packet_size_(min_packet_size),
|
~MediaPacketGenerator();
|
||||||
max_packet_size_(max_packet_size),
|
|
||||||
ssrc_(ssrc),
|
|
||||||
random_(random) {}
|
|
||||||
|
|
||||||
// Construct the media packets, up to |num_media_packets| packets.
|
// Construct the media packets, up to |num_media_packets| packets.
|
||||||
ForwardErrorCorrection::PacketList ConstructMediaPackets(
|
ForwardErrorCorrection::PacketList ConstructMediaPackets(
|
||||||
|
|||||||
@ -211,7 +211,7 @@ TEST_F(FlexfecReceiverTest, ReceivesMultiplePackets) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Receive FEC packet.
|
// Receive FEC packet.
|
||||||
auto fec_packet = fec_packets.front();
|
auto* fec_packet = fec_packets.front();
|
||||||
std::unique_ptr<Packet> packet_with_rtp_header =
|
std::unique_ptr<Packet> packet_with_rtp_header =
|
||||||
packet_generator_.BuildFlexfecPacket(*fec_packet);
|
packet_generator_.BuildFlexfecPacket(*fec_packet);
|
||||||
std::unique_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet =
|
std::unique_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet =
|
||||||
@ -354,7 +354,7 @@ TEST_F(FlexfecReceiverTest, RecoversFrom50PercentLoss) {
|
|||||||
|
|
||||||
// Receive all FEC packets.
|
// Receive all FEC packets.
|
||||||
media_it = media_packets.begin();
|
media_it = media_packets.begin();
|
||||||
for (const auto& fec_packet : fec_packets) {
|
for (const auto* fec_packet : fec_packets) {
|
||||||
std::unique_ptr<Packet> fec_packet_with_rtp_header =
|
std::unique_ptr<Packet> fec_packet_with_rtp_header =
|
||||||
packet_generator_.BuildFlexfecPacket(*fec_packet);
|
packet_generator_.BuildFlexfecPacket(*fec_packet);
|
||||||
++media_it;
|
++media_it;
|
||||||
@ -453,7 +453,7 @@ TEST_F(FlexfecReceiverTest, SurvivesOldRecoveredPacketBeingReinserted) {
|
|||||||
void SetReceiver(FlexfecReceiver* receiver) { receiver_ = receiver; }
|
void SetReceiver(FlexfecReceiver* receiver) { receiver_ = receiver; }
|
||||||
|
|
||||||
// Implements RecoveredPacketReceiver.
|
// Implements RecoveredPacketReceiver.
|
||||||
void OnRecoveredPacket(const uint8_t* packet, size_t length) {
|
void OnRecoveredPacket(const uint8_t* packet, size_t length) override {
|
||||||
RtpPacketReceived parsed_packet;
|
RtpPacketReceived parsed_packet;
|
||||||
EXPECT_TRUE(parsed_packet.Parse(packet, length));
|
EXPECT_TRUE(parsed_packet.Parse(packet, length));
|
||||||
parsed_packet.set_recovered(true);
|
parsed_packet.set_recovered(true);
|
||||||
@ -567,7 +567,7 @@ TEST_F(FlexfecReceiverTest, RecoveryCallbackDoesNotLoopInfinitely) {
|
|||||||
bool DeepRecursion() const { return deep_recursion_; }
|
bool DeepRecursion() const { return deep_recursion_; }
|
||||||
|
|
||||||
// Implements RecoveredPacketReceiver.
|
// Implements RecoveredPacketReceiver.
|
||||||
void OnRecoveredPacket(const uint8_t* packet, size_t length) {
|
void OnRecoveredPacket(const uint8_t* packet, size_t length) override {
|
||||||
RtpPacketReceived parsed_packet;
|
RtpPacketReceived parsed_packet;
|
||||||
EXPECT_TRUE(parsed_packet.Parse(packet, length));
|
EXPECT_TRUE(parsed_packet.Parse(packet, length));
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
|||||||
payload_data_length(sizeof(payload_data)),
|
payload_data_length(sizeof(payload_data)),
|
||||||
fake_clock(123456),
|
fake_clock(123456),
|
||||||
retransmission_rate_limiter_(&fake_clock, kMaxRttMs) {}
|
retransmission_rate_limiter_(&fake_clock, kMaxRttMs) {}
|
||||||
~RtpRtcpRtxNackTest() {}
|
~RtpRtcpRtxNackTest() override {}
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
RtpRtcp::Configuration configuration;
|
RtpRtcp::Configuration configuration;
|
||||||
|
|||||||
@ -195,7 +195,7 @@ TEST_F(ReceiveStatisticsTest, RtcpCallbacks) {
|
|||||||
public:
|
public:
|
||||||
TestCallback()
|
TestCallback()
|
||||||
: RtcpStatisticsCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
: RtcpStatisticsCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
||||||
virtual ~TestCallback() {}
|
~TestCallback() override {}
|
||||||
|
|
||||||
void StatisticsUpdated(const RtcpStatistics& statistics,
|
void StatisticsUpdated(const RtcpStatistics& statistics,
|
||||||
uint32_t ssrc) override {
|
uint32_t ssrc) override {
|
||||||
@ -283,10 +283,10 @@ class RtpTestCallback : public StreamDataCountersCallback {
|
|||||||
public:
|
public:
|
||||||
RtpTestCallback()
|
RtpTestCallback()
|
||||||
: StreamDataCountersCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
: StreamDataCountersCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
||||||
virtual ~RtpTestCallback() {}
|
~RtpTestCallback() override = default;
|
||||||
|
|
||||||
virtual void DataCountersUpdated(const StreamDataCounters& counters,
|
void DataCountersUpdated(const StreamDataCounters& counters,
|
||||||
uint32_t ssrc) {
|
uint32_t ssrc) override {
|
||||||
ssrc_ = ssrc;
|
ssrc_ = ssrc;
|
||||||
stats_ = counters;
|
stats_ = counters;
|
||||||
++num_calls_;
|
++num_calls_;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class RemoteNtpTimeEstimatorTest : public ::testing::Test {
|
|||||||
: local_clock_(kLocalClockInitialTimeMs * 1000),
|
: local_clock_(kLocalClockInitialTimeMs * 1000),
|
||||||
remote_clock_(kRemoteClockInitialTimeMs * 1000),
|
remote_clock_(kRemoteClockInitialTimeMs * 1000),
|
||||||
estimator_(new RemoteNtpTimeEstimator(&local_clock_)) {}
|
estimator_(new RemoteNtpTimeEstimator(&local_clock_)) {}
|
||||||
~RemoteNtpTimeEstimatorTest() {}
|
~RemoteNtpTimeEstimatorTest() override = default;
|
||||||
|
|
||||||
void AdvanceTimeMilliseconds(int64_t ms) {
|
void AdvanceTimeMilliseconds(int64_t ms) {
|
||||||
local_clock_.AdvanceTimeMilliseconds(ms);
|
local_clock_.AdvanceTimeMilliseconds(ms);
|
||||||
|
|||||||
@ -185,7 +185,7 @@ TEST(NACKStringBuilderTest, TestCase13) {
|
|||||||
class RtcpPacketTypeCounterObserverImpl : public RtcpPacketTypeCounterObserver {
|
class RtcpPacketTypeCounterObserverImpl : public RtcpPacketTypeCounterObserver {
|
||||||
public:
|
public:
|
||||||
RtcpPacketTypeCounterObserverImpl() : ssrc_(0) {}
|
RtcpPacketTypeCounterObserverImpl() : ssrc_(0) {}
|
||||||
virtual ~RtcpPacketTypeCounterObserverImpl() {}
|
~RtcpPacketTypeCounterObserverImpl() override = default;
|
||||||
void RtcpPacketTypesCounterUpdated(
|
void RtcpPacketTypesCounterUpdated(
|
||||||
uint32_t ssrc,
|
uint32_t ssrc,
|
||||||
const RtcpPacketTypeCounter& packet_counter) override {
|
const RtcpPacketTypeCounter& packet_counter) override {
|
||||||
|
|||||||
@ -82,7 +82,7 @@ void VerifyExtensions(RTPTypeHeader* type,
|
|||||||
class RtpPacketizerVp8Test : public ::testing::Test {
|
class RtpPacketizerVp8Test : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
RtpPacketizerVp8Test() : helper_(NULL) {}
|
RtpPacketizerVp8Test() : helper_(NULL) {}
|
||||||
virtual void TearDown() { delete helper_; }
|
void TearDown() override { delete helper_; }
|
||||||
bool Init(const size_t* partition_sizes, size_t num_partitions) {
|
bool Init(const size_t* partition_sizes, size_t num_partitions) {
|
||||||
hdr_info_.pictureId = kNoPictureId;
|
hdr_info_.pictureId = kNoPictureId;
|
||||||
hdr_info_.nonReference = false;
|
hdr_info_.nonReference = false;
|
||||||
|
|||||||
@ -127,9 +127,7 @@ class RtpPacketizerVp9Test : public ::testing::Test {
|
|||||||
static constexpr size_t kMaxPacketSize = 1200;
|
static constexpr size_t kMaxPacketSize = 1200;
|
||||||
|
|
||||||
RtpPacketizerVp9Test() : packet_(kNoExtensions, kMaxPacketSize) {}
|
RtpPacketizerVp9Test() : packet_(kNoExtensions, kMaxPacketSize) {}
|
||||||
virtual void SetUp() {
|
void SetUp() override { expected_.InitRTPVideoHeaderVP9(); }
|
||||||
expected_.InitRTPVideoHeaderVP9();
|
|
||||||
}
|
|
||||||
|
|
||||||
RtpPacketToSend packet_;
|
RtpPacketToSend packet_;
|
||||||
std::unique_ptr<uint8_t[]> payload_;
|
std::unique_ptr<uint8_t[]> payload_;
|
||||||
@ -584,9 +582,7 @@ class RtpDepacketizerVp9Test : public ::testing::Test {
|
|||||||
RtpDepacketizerVp9Test()
|
RtpDepacketizerVp9Test()
|
||||||
: depacketizer_(new RtpDepacketizerVp9()) {}
|
: depacketizer_(new RtpDepacketizerVp9()) {}
|
||||||
|
|
||||||
virtual void SetUp() {
|
void SetUp() override { expected_.InitRTPVideoHeaderVP9(); }
|
||||||
expected_.InitRTPVideoHeaderVP9();
|
|
||||||
}
|
|
||||||
|
|
||||||
RTPVideoHeaderVP9 expected_;
|
RTPVideoHeaderVP9 expected_;
|
||||||
std::unique_ptr<RtpDepacketizer> depacketizer_;
|
std::unique_ptr<RtpDepacketizer> depacketizer_;
|
||||||
|
|||||||
@ -236,7 +236,7 @@ TEST_F(RtpReceiverTest, GetSourcesRemoveOutdatedSource) {
|
|||||||
header.arrOfCSRCs[0] = kCsrc1;
|
header.arrOfCSRCs[0] = kCsrc1;
|
||||||
EXPECT_TRUE(rtp_receiver_->IncomingRtpPacket(
|
EXPECT_TRUE(rtp_receiver_->IncomingRtpPacket(
|
||||||
header, kTestPayload, sizeof(kTestPayload), payload_specific));
|
header, kTestPayload, sizeof(kTestPayload), payload_specific));
|
||||||
auto rtp_receiver_impl = static_cast<RtpReceiverImpl*>(rtp_receiver_.get());
|
auto* rtp_receiver_impl = static_cast<RtpReceiverImpl*>(rtp_receiver_.get());
|
||||||
auto ssrc_sources = rtp_receiver_impl->ssrc_sources_for_testing();
|
auto ssrc_sources = rtp_receiver_impl->ssrc_sources_for_testing();
|
||||||
ASSERT_EQ(1u, ssrc_sources.size());
|
ASSERT_EQ(1u, ssrc_sources.size());
|
||||||
EXPECT_EQ(kSsrc1, ssrc_sources.begin()->source_id());
|
EXPECT_EQ(kSsrc1, ssrc_sources.begin()->source_id());
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const int64_t kMaxRttMs = 1000;
|
|||||||
class RtcpRttStatsTestImpl : public RtcpRttStats {
|
class RtcpRttStatsTestImpl : public RtcpRttStats {
|
||||||
public:
|
public:
|
||||||
RtcpRttStatsTestImpl() : rtt_ms_(0) {}
|
RtcpRttStatsTestImpl() : rtt_ms_(0) {}
|
||||||
virtual ~RtcpRttStatsTestImpl() {}
|
~RtcpRttStatsTestImpl() override = default;
|
||||||
|
|
||||||
void OnRttUpdate(int64_t rtt_ms) override { rtt_ms_ = rtt_ms; }
|
void OnRttUpdate(int64_t rtt_ms) override { rtt_ms_ = rtt_ms; }
|
||||||
int64_t LastProcessedRtt() const override { return rtt_ms_; }
|
int64_t LastProcessedRtt() const override { return rtt_ms_; }
|
||||||
|
|||||||
@ -1196,7 +1196,7 @@ TEST_P(RtpSenderTest, FrameCountCallbacks) {
|
|||||||
class TestCallback : public FrameCountObserver {
|
class TestCallback : public FrameCountObserver {
|
||||||
public:
|
public:
|
||||||
TestCallback() : FrameCountObserver(), num_calls_(0), ssrc_(0) {}
|
TestCallback() : FrameCountObserver(), num_calls_(0), ssrc_(0) {}
|
||||||
virtual ~TestCallback() {}
|
~TestCallback() override = default;
|
||||||
|
|
||||||
void FrameCountUpdated(const FrameCounts& frame_counts,
|
void FrameCountUpdated(const FrameCounts& frame_counts,
|
||||||
uint32_t ssrc) override {
|
uint32_t ssrc) override {
|
||||||
@ -1256,7 +1256,7 @@ TEST_P(RtpSenderTest, BitrateCallbacks) {
|
|||||||
ssrc_(0),
|
ssrc_(0),
|
||||||
total_bitrate_(0),
|
total_bitrate_(0),
|
||||||
retransmit_bitrate_(0) {}
|
retransmit_bitrate_(0) {}
|
||||||
virtual ~TestCallback() {}
|
~TestCallback() override = default;
|
||||||
|
|
||||||
void Notify(uint32_t total_bitrate,
|
void Notify(uint32_t total_bitrate,
|
||||||
uint32_t retransmit_bitrate,
|
uint32_t retransmit_bitrate,
|
||||||
@ -1344,7 +1344,7 @@ TEST_P(RtpSenderTestWithoutPacer, StreamDataCountersCallbacks) {
|
|||||||
class TestCallback : public StreamDataCountersCallback {
|
class TestCallback : public StreamDataCountersCallback {
|
||||||
public:
|
public:
|
||||||
TestCallback() : StreamDataCountersCallback(), ssrc_(0), counters_() {}
|
TestCallback() : StreamDataCountersCallback(), ssrc_(0), counters_() {}
|
||||||
virtual ~TestCallback() {}
|
~TestCallback() override = default;
|
||||||
|
|
||||||
void DataCountersUpdated(const StreamDataCounters& counters,
|
void DataCountersUpdated(const StreamDataCounters& counters,
|
||||||
uint32_t ssrc) override {
|
uint32_t ssrc) override {
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class RtpRtcpAPITest : public ::testing::Test {
|
|||||||
test_timestamp_ = 4567;
|
test_timestamp_ = 4567;
|
||||||
test_sequence_number_ = 2345;
|
test_sequence_number_ = 2345;
|
||||||
}
|
}
|
||||||
~RtpRtcpAPITest() {}
|
~RtpRtcpAPITest() override = default;
|
||||||
|
|
||||||
const uint32_t initial_ssrc = 8888;
|
const uint32_t initial_ssrc = 8888;
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class RtpRtcpAudioTest : public ::testing::Test {
|
|||||||
test_timestamp = 4567;
|
test_timestamp = 4567;
|
||||||
test_sequence_number = 2345;
|
test_sequence_number = 2345;
|
||||||
}
|
}
|
||||||
~RtpRtcpAudioTest() {}
|
~RtpRtcpAudioTest() override = default;
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
receive_statistics1_.reset(ReceiveStatistics::Create(&fake_clock));
|
receive_statistics1_.reset(ReceiveStatistics::Create(&fake_clock));
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class RtcpCallback : public RtcpIntraFrameObserver {
|
|||||||
}
|
}
|
||||||
virtual void OnLipSyncUpdate(const int32_t id,
|
virtual void OnLipSyncUpdate(const int32_t id,
|
||||||
const int32_t audioVideoOffset) {}
|
const int32_t audioVideoOffset) {}
|
||||||
virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) {}
|
void OnReceivedIntraFrameRequest(uint32_t ssrc) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RtpRtcp* _rtpRtcpModule;
|
RtpRtcp* _rtpRtcpModule;
|
||||||
@ -44,7 +44,7 @@ class RtcpCallback : public RtcpIntraFrameObserver {
|
|||||||
class TestRtpFeedback : public NullRtpFeedback {
|
class TestRtpFeedback : public NullRtpFeedback {
|
||||||
public:
|
public:
|
||||||
explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
|
explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
|
||||||
virtual ~TestRtpFeedback() {}
|
~TestRtpFeedback() override = default;
|
||||||
|
|
||||||
void OnIncomingSSRCChanged(uint32_t ssrc) override {
|
void OnIncomingSSRCChanged(uint32_t ssrc) override {
|
||||||
rtp_rtcp_->SetRemoteSSRC(ssrc);
|
rtp_rtcp_->SetRemoteSSRC(ssrc);
|
||||||
@ -64,9 +64,9 @@ class RtpRtcpRtcpTest : public ::testing::Test {
|
|||||||
test_timestamp = 4567;
|
test_timestamp = 4567;
|
||||||
test_sequence_number = 2345;
|
test_sequence_number = 2345;
|
||||||
}
|
}
|
||||||
~RtpRtcpRtcpTest() {}
|
~RtpRtcpRtcpTest() override = default;
|
||||||
|
|
||||||
virtual void SetUp() {
|
void SetUp() override {
|
||||||
receiver = new TestRtpReceiver();
|
receiver = new TestRtpReceiver();
|
||||||
transport1 = new LoopBackTransport();
|
transport1 = new LoopBackTransport();
|
||||||
transport2 = new LoopBackTransport();
|
transport2 = new LoopBackTransport();
|
||||||
@ -149,7 +149,7 @@ class RtpRtcpRtcpTest : public ::testing::Test {
|
|||||||
test, 8, nullptr, nullptr, nullptr));
|
test, 8, nullptr, nullptr, nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
void TearDown() override {
|
||||||
delete module1;
|
delete module1;
|
||||||
delete module2;
|
delete module2;
|
||||||
delete myRTCPFeedback1;
|
delete myRTCPFeedback1;
|
||||||
|
|||||||
@ -40,9 +40,9 @@ class RtpRtcpVideoTest : public ::testing::Test {
|
|||||||
test_sequence_number_(2345),
|
test_sequence_number_(2345),
|
||||||
fake_clock(123456),
|
fake_clock(123456),
|
||||||
retransmission_rate_limiter_(&fake_clock, 1000) {}
|
retransmission_rate_limiter_(&fake_clock, 1000) {}
|
||||||
~RtpRtcpVideoTest() {}
|
~RtpRtcpVideoTest() override = default;
|
||||||
|
|
||||||
virtual void SetUp() {
|
void SetUp() override {
|
||||||
transport_ = new LoopBackTransport();
|
transport_ = new LoopBackTransport();
|
||||||
receiver_ = new TestRtpReceiver();
|
receiver_ = new TestRtpReceiver();
|
||||||
receive_statistics_.reset(ReceiveStatistics::Create(&fake_clock));
|
receive_statistics_.reset(ReceiveStatistics::Create(&fake_clock));
|
||||||
@ -118,7 +118,7 @@ class RtpRtcpVideoTest : public ::testing::Test {
|
|||||||
return padding_bytes_in_packet + header_length;
|
return padding_bytes_in_packet + header_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
void TearDown() override {
|
||||||
delete video_module_;
|
delete video_module_;
|
||||||
delete transport_;
|
delete transport_;
|
||||||
delete receiver_;
|
delete receiver_;
|
||||||
|
|||||||
@ -567,6 +567,7 @@ rtc_source_set("test_common") {
|
|||||||
"fake_videorenderer.h",
|
"fake_videorenderer.h",
|
||||||
"layer_filtering_transport.cc",
|
"layer_filtering_transport.cc",
|
||||||
"layer_filtering_transport.h",
|
"layer_filtering_transport.h",
|
||||||
|
"mock_transport.cc",
|
||||||
"mock_transport.h",
|
"mock_transport.h",
|
||||||
"null_transport.cc",
|
"null_transport.cc",
|
||||||
"null_transport.h",
|
"null_transport.h",
|
||||||
|
|||||||
18
test/mock_transport.cc
Normal file
18
test/mock_transport.cc
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "test/mock_transport.h"
|
||||||
|
|
||||||
|
namespace webrtc {
|
||||||
|
|
||||||
|
MockTransport::MockTransport() = default;
|
||||||
|
MockTransport::~MockTransport() = default;
|
||||||
|
|
||||||
|
} // namespace webrtc
|
||||||
@ -18,6 +18,9 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockTransport : public Transport {
|
class MockTransport : public Transport {
|
||||||
public:
|
public:
|
||||||
|
MockTransport();
|
||||||
|
~MockTransport();
|
||||||
|
|
||||||
MOCK_METHOD3(SendRtp,
|
MOCK_METHOD3(SendRtp,
|
||||||
bool(const uint8_t* data,
|
bool(const uint8_t* data,
|
||||||
size_t len,
|
size_t len,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user