mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Fix -Wextra-semi warnings.
Starting from https://chromium-review.googlesource.com/c/1485012, -Wextra-semi is enabled and WebRTC has some violations to fix. This is a follow-up of https://webrtc-review.googlesource.com/c/123560. Bug: webrtc:10355 Change-Id: I012b7497fc8991037fd77aa98f1579c22e08206f Reviewed-on: https://webrtc-review.googlesource.com/c/124126 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26831}
This commit is contained in:
parent
3812fa949a
commit
c4dd730765
18 changed files with 74 additions and 74 deletions
|
@ -44,7 +44,7 @@ class FakeMediaTransport : public MediaTransportInterface {
|
||||||
|
|
||||||
RTCError RequestKeyFrame(uint64_t channel_id) override {
|
RTCError RequestKeyFrame(uint64_t channel_id) override {
|
||||||
return RTCError::OK();
|
return RTCError::OK();
|
||||||
};
|
}
|
||||||
|
|
||||||
void SetReceiveAudioSink(MediaTransportAudioSinkInterface* sink) override {}
|
void SetReceiveAudioSink(MediaTransportAudioSinkInterface* sink) override {}
|
||||||
void SetReceiveVideoSink(MediaTransportVideoSinkInterface* sink) override {}
|
void SetReceiveVideoSink(MediaTransportVideoSinkInterface* sink) override {}
|
||||||
|
|
|
@ -171,14 +171,14 @@ void TestSps(SpsMode mode, SpsVuiRewriter::ParseResult expected_parse_result) {
|
||||||
|
|
||||||
REWRITE_TEST(VuiAlreadyOptimal,
|
REWRITE_TEST(VuiAlreadyOptimal,
|
||||||
kNoRewriteRequired_VuiOptimal,
|
kNoRewriteRequired_VuiOptimal,
|
||||||
SpsVuiRewriter::ParseResult::kVuiOk);
|
SpsVuiRewriter::ParseResult::kVuiOk)
|
||||||
REWRITE_TEST(RewriteFullVui,
|
REWRITE_TEST(RewriteFullVui,
|
||||||
kRewriteRequired_NoVui,
|
kRewriteRequired_NoVui,
|
||||||
SpsVuiRewriter::ParseResult::kVuiRewritten);
|
SpsVuiRewriter::ParseResult::kVuiRewritten)
|
||||||
REWRITE_TEST(AddBitstreamRestriction,
|
REWRITE_TEST(AddBitstreamRestriction,
|
||||||
kRewriteRequired_NoBitstreamRestriction,
|
kRewriteRequired_NoBitstreamRestriction,
|
||||||
SpsVuiRewriter::ParseResult::kVuiRewritten);
|
SpsVuiRewriter::ParseResult::kVuiRewritten)
|
||||||
REWRITE_TEST(RewriteSuboptimalVui,
|
REWRITE_TEST(RewriteSuboptimalVui,
|
||||||
kRewriteRequired_VuiSuboptimal,
|
kRewriteRequired_VuiSuboptimal,
|
||||||
SpsVuiRewriter::ParseResult::kVuiRewritten);
|
SpsVuiRewriter::ParseResult::kVuiRewritten)
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Conductor : public webrtc::PeerConnectionObserver,
|
||||||
//
|
//
|
||||||
|
|
||||||
void OnSignalingChange(
|
void OnSignalingChange(
|
||||||
webrtc::PeerConnectionInterface::SignalingState new_state) override{};
|
webrtc::PeerConnectionInterface::SignalingState new_state) override {}
|
||||||
void OnAddTrack(
|
void OnAddTrack(
|
||||||
rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
|
rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
|
||||||
const std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>>&
|
const std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>>&
|
||||||
|
@ -74,9 +74,9 @@ class Conductor : public webrtc::PeerConnectionObserver,
|
||||||
rtc::scoped_refptr<webrtc::DataChannelInterface> channel) override {}
|
rtc::scoped_refptr<webrtc::DataChannelInterface> channel) override {}
|
||||||
void OnRenegotiationNeeded() override {}
|
void OnRenegotiationNeeded() override {}
|
||||||
void OnIceConnectionChange(
|
void OnIceConnectionChange(
|
||||||
webrtc::PeerConnectionInterface::IceConnectionState new_state) override{};
|
webrtc::PeerConnectionInterface::IceConnectionState new_state) override {}
|
||||||
void OnIceGatheringChange(
|
void OnIceGatheringChange(
|
||||||
webrtc::PeerConnectionInterface::IceGatheringState new_state) override{};
|
webrtc::PeerConnectionInterface::IceGatheringState new_state) override {}
|
||||||
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override;
|
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override;
|
||||||
void OnIceConnectionReceivingChange(bool receiving) override {}
|
void OnIceConnectionReceivingChange(bool receiving) override {}
|
||||||
|
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ const std::string payload_checksum =
|
||||||
"ab88b1a049c36bdfeb7e8b057ef6982a",
|
"ab88b1a049c36bdfeb7e8b057ef6982a",
|
||||||
"27fef7b799393347ec3b5694369a1c36",
|
"27fef7b799393347ec3b5694369a1c36",
|
||||||
"27fef7b799393347ec3b5694369a1c36");
|
"27fef7b799393347ec3b5694369a1c36");
|
||||||
}; // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) {
|
TEST_F(AcmSenderBitExactnessOldApi, Opus_stereo_20ms) {
|
||||||
ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
|
ASSERT_NO_FATAL_FAILURE(SetUpTest("opus", 48000, 2, 120, 960, 960));
|
||||||
|
|
|
@ -96,17 +96,17 @@ constexpr size_t kDurationSec = 400;
|
||||||
EncodeDecode(kDurationSec); \
|
EncodeDecode(kDurationSec); \
|
||||||
}
|
}
|
||||||
|
|
||||||
ADD_TEST(10);
|
ADD_TEST(10)
|
||||||
ADD_TEST(9);
|
ADD_TEST(9)
|
||||||
ADD_TEST(8);
|
ADD_TEST(8)
|
||||||
ADD_TEST(7);
|
ADD_TEST(7)
|
||||||
ADD_TEST(6);
|
ADD_TEST(6)
|
||||||
ADD_TEST(5);
|
ADD_TEST(5)
|
||||||
ADD_TEST(4);
|
ADD_TEST(4)
|
||||||
ADD_TEST(3);
|
ADD_TEST(3)
|
||||||
ADD_TEST(2);
|
ADD_TEST(2)
|
||||||
ADD_TEST(1);
|
ADD_TEST(1)
|
||||||
ADD_TEST(0);
|
ADD_TEST(0)
|
||||||
|
|
||||||
#define ADD_BANDWIDTH_TEST(bandwidth) \
|
#define ADD_BANDWIDTH_TEST(bandwidth) \
|
||||||
TEST_P(OpusSpeedTest, OpusSetBandwidthTest##bandwidth) { \
|
TEST_P(OpusSpeedTest, OpusSetBandwidthTest##bandwidth) { \
|
||||||
|
@ -116,11 +116,11 @@ ADD_TEST(0);
|
||||||
EncodeDecode(kDurationSec); \
|
EncodeDecode(kDurationSec); \
|
||||||
}
|
}
|
||||||
|
|
||||||
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_NARROWBAND);
|
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_NARROWBAND)
|
||||||
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_MEDIUMBAND);
|
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_MEDIUMBAND)
|
||||||
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_WIDEBAND);
|
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_WIDEBAND)
|
||||||
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_SUPERWIDEBAND);
|
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_SUPERWIDEBAND)
|
||||||
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_FULLBAND);
|
ADD_BANDWIDTH_TEST(OPUS_BANDWIDTH_FULLBAND)
|
||||||
|
|
||||||
// List all test cases: (channel, bit rat, filename, extension).
|
// List all test cases: (channel, bit rat, filename, extension).
|
||||||
const coding_param param_set[] = {
|
const coding_param param_set[] = {
|
||||||
|
|
|
@ -34,7 +34,7 @@ enum LossModes {
|
||||||
|
|
||||||
class LossModel {
|
class LossModel {
|
||||||
public:
|
public:
|
||||||
virtual ~LossModel(){};
|
virtual ~LossModel() {}
|
||||||
virtual bool Lost(int now_ms) = 0;
|
virtual bool Lost(int now_ms) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Sender {
|
||||||
class Receiver {
|
class Receiver {
|
||||||
public:
|
public:
|
||||||
Receiver();
|
Receiver();
|
||||||
virtual ~Receiver() {};
|
virtual ~Receiver() {}
|
||||||
void Setup(AudioCodingModule *acm, RTPStream *rtpStream,
|
void Setup(AudioCodingModule *acm, RTPStream *rtpStream,
|
||||||
std::string out_file_name, size_t channels, int file_num);
|
std::string out_file_name, size_t channels, int file_num);
|
||||||
void Teardown();
|
void Teardown();
|
||||||
|
|
|
@ -50,7 +50,7 @@ void WebrtcAlsaErrorHandler(const char* file,
|
||||||
const char* function,
|
const char* function,
|
||||||
int err,
|
int err,
|
||||||
const char* fmt,
|
const char* fmt,
|
||||||
...){};
|
...) {}
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
static const unsigned int ALSA_PLAYOUT_FREQ = 48000;
|
static const unsigned int ALSA_PLAYOUT_FREQ = 48000;
|
||||||
|
|
|
@ -131,8 +131,8 @@ class AudioDeviceLinuxALSA : public AudioDeviceGeneric {
|
||||||
|
|
||||||
bool KeyPressed() const;
|
bool KeyPressed() const;
|
||||||
|
|
||||||
void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); };
|
void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION(_critSect) { _critSect.Enter(); }
|
||||||
void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); };
|
void UnLock() RTC_UNLOCK_FUNCTION(_critSect) { _critSect.Leave(); }
|
||||||
|
|
||||||
inline int32_t InputSanityCheckAfterUnlockedPeriod() const;
|
inline int32_t InputSanityCheckAfterUnlockedPeriod() const;
|
||||||
inline int32_t OutputSanityCheckAfterUnlockedPeriod() const;
|
inline int32_t OutputSanityCheckAfterUnlockedPeriod() const;
|
||||||
|
|
|
@ -104,7 +104,7 @@ class CaptureTransportVerificationProcessor : public BlockProcessor {
|
||||||
|
|
||||||
void GetMetrics(EchoControl::Metrics* metrics) const override {}
|
void GetMetrics(EchoControl::Metrics* metrics) const override {}
|
||||||
|
|
||||||
void SetAudioBufferDelay(size_t delay_ms) override{};
|
void SetAudioBufferDelay(size_t delay_ms) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor);
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor);
|
||||||
|
@ -134,7 +134,7 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
|
||||||
|
|
||||||
void GetMetrics(EchoControl::Metrics* metrics) const override {}
|
void GetMetrics(EchoControl::Metrics* metrics) const override {}
|
||||||
|
|
||||||
void SetAudioBufferDelay(size_t delay_ms) override{};
|
void SetAudioBufferDelay(size_t delay_ms) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::deque<std::vector<std::vector<float>>> received_render_blocks_;
|
std::deque<std::vector<std::vector<float>>> received_render_blocks_;
|
||||||
|
|
|
@ -133,7 +133,7 @@ class TestRenderPreProcessor : public CustomProcessing {
|
||||||
std::transform(channel_view.begin(), channel_view.end(),
|
std::transform(channel_view.begin(), channel_view.end(),
|
||||||
channel_view.begin(), ProcessSample);
|
channel_view.begin(), ProcessSample);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
std::string ToString() const override { return "TestRenderPreProcessor"; }
|
std::string ToString() const override { return "TestRenderPreProcessor"; }
|
||||||
void SetRuntimeSetting(AudioProcessing::RuntimeSetting setting) override {}
|
void SetRuntimeSetting(AudioProcessing::RuntimeSetting setting) override {}
|
||||||
// Modifies a sample. This member is used in Process() to modify a frame and
|
// Modifies a sample. This member is used in Process() to modify a frame and
|
||||||
|
|
|
@ -42,7 +42,7 @@ class FakeEncodedImageCallback : public EncodedImageCallback {
|
||||||
encoded_image.timing_.flags != VideoSendTiming::kNotTriggered;
|
encoded_image.timing_.flags != VideoSendTiming::kNotTriggered;
|
||||||
last_capture_timestamp_ = encoded_image.capture_time_ms_;
|
last_capture_timestamp_ = encoded_image.capture_time_ms_;
|
||||||
return Result(Result::OK);
|
return Result(Result::OK);
|
||||||
};
|
}
|
||||||
|
|
||||||
void OnDroppedFrame(DropReason reason) override { ++num_frames_dropped_; }
|
void OnDroppedFrame(DropReason reason) override { ++num_frames_dropped_; }
|
||||||
|
|
||||||
|
|
|
@ -214,8 +214,8 @@ class FakeVideoTrackForStats : public MediaStreamTrack<VideoTrackInterface> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
||||||
const rtc::VideoSinkWants& wants) override{};
|
const rtc::VideoSinkWants& wants) override {}
|
||||||
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override{};
|
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
|
||||||
|
|
||||||
VideoTrackSourceInterface* GetSource() const override { return nullptr; }
|
VideoTrackSourceInterface* GetSource() const override { return nullptr; }
|
||||||
};
|
};
|
||||||
|
@ -2197,7 +2197,7 @@ class RTCTestStats : public RTCStats {
|
||||||
RTCStatsMember<int32_t> dummy_stat;
|
RTCStatsMember<int32_t> dummy_stat;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCTestStats, RTCStats, "test-stats", &dummy_stat);
|
WEBRTC_RTCSTATS_IMPL(RTCTestStats, RTCStats, "test-stats", &dummy_stat)
|
||||||
|
|
||||||
// Overrides the stats collection to verify thread usage and that the resulting
|
// Overrides the stats collection to verify thread usage and that the resulting
|
||||||
// partial reports are merged.
|
// partial reports are merged.
|
||||||
|
|
|
@ -731,7 +731,7 @@ class SSLStreamAdapterTestTLS
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
void ReadData(rtc::StreamInterface* stream) override {
|
void ReadData(rtc::StreamInterface* stream) override {
|
||||||
char buffer[1600];
|
char buffer[1600];
|
||||||
|
@ -880,7 +880,7 @@ class SSLStreamAdapterTestDTLS
|
||||||
RTC_LOG(LS_INFO) << "Sent " << sent_ << " packets; received "
|
RTC_LOG(LS_INFO) << "Sent " << sent_ << " packets; received "
|
||||||
<< received_.size();
|
<< received_.size();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BufferQueueStream client_buffer_;
|
BufferQueueStream client_buffer_;
|
||||||
|
@ -907,7 +907,7 @@ rtc::StreamResult SSLDummyStreamBase::Write(const void* data,
|
||||||
}
|
}
|
||||||
|
|
||||||
return test_base_->DataWritten(this, data, data_len, written, error);
|
return test_base_->DataWritten(this, data, data_len, written, error);
|
||||||
};
|
}
|
||||||
|
|
||||||
class SSLStreamAdapterTestDTLSFromPEMStrings : public SSLStreamAdapterTestDTLS {
|
class SSLStreamAdapterTestDTLSFromPEMStrings : public SSLStreamAdapterTestDTLS {
|
||||||
public:
|
public:
|
||||||
|
@ -919,7 +919,7 @@ class SSLStreamAdapterTestDTLSFromPEMStrings : public SSLStreamAdapterTestDTLS {
|
||||||
// certificate.
|
// certificate.
|
||||||
class SSLStreamAdapterTestDTLSCertChain : public SSLStreamAdapterTestDTLS {
|
class SSLStreamAdapterTestDTLSCertChain : public SSLStreamAdapterTestDTLS {
|
||||||
public:
|
public:
|
||||||
SSLStreamAdapterTestDTLSCertChain() : SSLStreamAdapterTestDTLS("", ""){};
|
SSLStreamAdapterTestDTLSCertChain() : SSLStreamAdapterTestDTLS("", "") {}
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
CreateStreams();
|
CreateStreams();
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ class SSLStreamAdapterTestDTLSCertChain : public SSLStreamAdapterTestDTLS {
|
||||||
// Test that we can make a handshake work
|
// Test that we can make a handshake work
|
||||||
TEST_P(SSLStreamAdapterTestTLS, TestTLSConnect) {
|
TEST_P(SSLStreamAdapterTestTLS, TestTLSConnect) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestTLS, GetPeerCertChainWithOneCertificate) {
|
TEST_P(SSLStreamAdapterTestTLS, GetPeerCertChainWithOneCertificate) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
|
@ -1009,13 +1009,13 @@ TEST_P(SSLStreamAdapterTestTLS, TestTLSClose) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
client_ssl_->Close();
|
client_ssl_->Close();
|
||||||
EXPECT_EQ_WAIT(rtc::SS_CLOSED, server_ssl_->GetState(), handshake_wait_);
|
EXPECT_EQ_WAIT(rtc::SS_CLOSED, server_ssl_->GetState(), handshake_wait_);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test transfer -- trivial
|
// Test transfer -- trivial
|
||||||
TEST_P(SSLStreamAdapterTestTLS, TestTLSTransfer) {
|
TEST_P(SSLStreamAdapterTestTLS, TestTLSTransfer) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
TestTransfer(100000);
|
TestTransfer(100000);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test read-write after close.
|
// Test read-write after close.
|
||||||
TEST_P(SSLStreamAdapterTestTLS, ReadWriteAfterClose) {
|
TEST_P(SSLStreamAdapterTestTLS, ReadWriteAfterClose) {
|
||||||
|
@ -1034,21 +1034,21 @@ TEST_P(SSLStreamAdapterTestTLS, ReadWriteAfterClose) {
|
||||||
// But after closed read gives you EOS.
|
// But after closed read gives you EOS.
|
||||||
rv = client_ssl_->Read(block, sizeof(block), &dummy, nullptr);
|
rv = client_ssl_->Read(block, sizeof(block), &dummy, nullptr);
|
||||||
ASSERT_EQ(rtc::SR_EOS, rv);
|
ASSERT_EQ(rtc::SR_EOS, rv);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test a handshake with a bogus peer digest
|
// Test a handshake with a bogus peer digest
|
||||||
TEST_P(SSLStreamAdapterTestTLS, TestTLSBogusDigest) {
|
TEST_P(SSLStreamAdapterTestTLS, TestTLSBogusDigest) {
|
||||||
SetPeerIdentitiesByDigest(false, true);
|
SetPeerIdentitiesByDigest(false, true);
|
||||||
TestHandshake(false);
|
TestHandshake(false);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestTLS, TestTLSDelayedIdentity) {
|
TEST_P(SSLStreamAdapterTestTLS, TestTLSDelayedIdentity) {
|
||||||
TestHandshakeWithDelayedIdentity(true);
|
TestHandshakeWithDelayedIdentity(true);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestTLS, TestTLSDelayedIdentityWithBogusDigest) {
|
TEST_P(SSLStreamAdapterTestTLS, TestTLSDelayedIdentityWithBogusDigest) {
|
||||||
TestHandshakeWithDelayedIdentity(false);
|
TestHandshakeWithDelayedIdentity(false);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test that the correct error is returned when SetPeerCertificateDigest is
|
// Test that the correct error is returned when SetPeerCertificateDigest is
|
||||||
// called with an unknown algorithm.
|
// called with an unknown algorithm.
|
||||||
|
@ -1093,7 +1093,7 @@ TEST_P(SSLStreamAdapterTestTLS, TestSetPeerCertificateDigestWithInvalidLength) {
|
||||||
// Test that we can make a handshake work
|
// Test that we can make a handshake work
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnect) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnect) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test that we can make a handshake work if the first packet in
|
// Test that we can make a handshake work if the first packet in
|
||||||
// each direction is lost. This gives us predictable loss
|
// each direction is lost. This gives us predictable loss
|
||||||
|
@ -1101,7 +1101,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnect) {
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacket) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacket) {
|
||||||
SetLoseFirstPacket(true);
|
SetLoseFirstPacket(true);
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test a handshake with loss and delay
|
// Test a handshake with loss and delay
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacketDelay2s) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacketDelay2s) {
|
||||||
|
@ -1109,7 +1109,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacketDelay2s) {
|
||||||
SetDelay(2000);
|
SetDelay(2000);
|
||||||
SetHandshakeWait(20000);
|
SetHandshakeWait(20000);
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test a handshake with small MTU
|
// Test a handshake with small MTU
|
||||||
// Disabled due to https://code.google.com/p/webrtc/issues/detail?id=3910
|
// Disabled due to https://code.google.com/p/webrtc/issues/detail?id=3910
|
||||||
|
@ -1117,34 +1117,34 @@ TEST_P(SSLStreamAdapterTestDTLS, DISABLED_TestDTLSConnectWithSmallMtu) {
|
||||||
SetMtu(700);
|
SetMtu(700);
|
||||||
SetHandshakeWait(20000);
|
SetHandshakeWait(20000);
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test transfer -- trivial
|
// Test transfer -- trivial
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransfer) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransfer) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
TestTransfer(100);
|
TestTransfer(100);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithLoss) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithLoss) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
SetLoss(10);
|
SetLoss(10);
|
||||||
TestTransfer(100);
|
TestTransfer(100);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithDamage) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithDamage) {
|
||||||
SetDamage(); // Must be called first because first packet
|
SetDamage(); // Must be called first because first packet
|
||||||
// write happens at end of handshake.
|
// write happens at end of handshake.
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
TestTransfer(100);
|
TestTransfer(100);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentity) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentity) {
|
||||||
TestHandshakeWithDelayedIdentity(true);
|
TestHandshakeWithDelayedIdentity(true);
|
||||||
};
|
}
|
||||||
|
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentityWithBogusDigest) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentityWithBogusDigest) {
|
||||||
TestHandshakeWithDelayedIdentity(false);
|
TestHandshakeWithDelayedIdentity(false);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with all high ciphers
|
// Test DTLS-SRTP with all high ciphers
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) {
|
||||||
|
@ -1161,7 +1161,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with all low ciphers
|
// Test DTLS-SRTP with all low ciphers
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) {
|
||||||
|
@ -1178,7 +1178,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_32);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_32);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with a mismatch -- should not converge
|
// Test DTLS-SRTP with a mismatch -- should not converge
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) {
|
||||||
|
@ -1194,7 +1194,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) {
|
||||||
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(true, &client_cipher));
|
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(true, &client_cipher));
|
||||||
int server_cipher;
|
int server_cipher;
|
||||||
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(false, &server_cipher));
|
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(false, &server_cipher));
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with each side being mixed -- should select high
|
// Test DTLS-SRTP with each side being mixed -- should select high
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) {
|
||||||
|
@ -1212,7 +1212,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with all GCM-128 ciphers.
|
// Test DTLS-SRTP with all GCM-128 ciphers.
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) {
|
||||||
|
@ -1229,7 +1229,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_128_GCM);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_128_GCM);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with all GCM-256 ciphers.
|
// Test DTLS-SRTP with all GCM-256 ciphers.
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) {
|
||||||
|
@ -1246,7 +1246,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with mixed GCM-128/-256 ciphers -- should not converge.
|
// Test DTLS-SRTP with mixed GCM-128/-256 ciphers -- should not converge.
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) {
|
||||||
|
@ -1262,7 +1262,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) {
|
||||||
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(true, &client_cipher));
|
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(true, &client_cipher));
|
||||||
int server_cipher;
|
int server_cipher;
|
||||||
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(false, &server_cipher));
|
ASSERT_FALSE(GetDtlsSrtpCryptoSuite(false, &server_cipher));
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test DTLS-SRTP with both GCM-128/-256 ciphers -- should select GCM-256.
|
// Test DTLS-SRTP with both GCM-128/-256 ciphers -- should select GCM-256.
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) {
|
||||||
|
@ -1280,7 +1280,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) {
|
||||||
|
|
||||||
ASSERT_EQ(client_cipher, server_cipher);
|
ASSERT_EQ(client_cipher, server_cipher);
|
||||||
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM);
|
ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test SRTP cipher suite lengths.
|
// Test SRTP cipher suite lengths.
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpKeyAndSaltLengths) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpKeyAndSaltLengths) {
|
||||||
|
@ -1309,7 +1309,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpKeyAndSaltLengths) {
|
||||||
&key_len, &salt_len));
|
&key_len, &salt_len));
|
||||||
ASSERT_EQ(256 / 8, key_len);
|
ASSERT_EQ(256 / 8, key_len);
|
||||||
ASSERT_EQ(96 / 8, salt_len);
|
ASSERT_EQ(96 / 8, salt_len);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Test an exporter
|
// Test an exporter
|
||||||
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSExporter) {
|
TEST_P(SSLStreamAdapterTestDTLS, TestDTLSExporter) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ class RTCTestStats1 : public RTCStats {
|
||||||
RTCStatsMember<int32_t> integer;
|
RTCStatsMember<int32_t> integer;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCTestStats1, RTCStats, "test-stats-1", &integer);
|
WEBRTC_RTCSTATS_IMPL(RTCTestStats1, RTCStats, "test-stats-1", &integer)
|
||||||
|
|
||||||
class RTCTestStats2 : public RTCStats {
|
class RTCTestStats2 : public RTCStats {
|
||||||
public:
|
public:
|
||||||
|
@ -38,7 +38,7 @@ class RTCTestStats2 : public RTCStats {
|
||||||
RTCStatsMember<double> number;
|
RTCStatsMember<double> number;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCTestStats2, RTCStats, "test-stats-2", &number);
|
WEBRTC_RTCSTATS_IMPL(RTCTestStats2, RTCStats, "test-stats-2", &number)
|
||||||
|
|
||||||
class RTCTestStats3 : public RTCStats {
|
class RTCTestStats3 : public RTCStats {
|
||||||
public:
|
public:
|
||||||
|
@ -50,7 +50,7 @@ class RTCTestStats3 : public RTCStats {
|
||||||
RTCStatsMember<std::string> string;
|
RTCStatsMember<std::string> string;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCTestStats3, RTCStats, "test-stats-3", &string);
|
WEBRTC_RTCSTATS_IMPL(RTCTestStats3, RTCStats, "test-stats-3", &string)
|
||||||
|
|
||||||
TEST(RTCStatsReport, AddAndGetStats) {
|
TEST(RTCStatsReport, AddAndGetStats) {
|
||||||
rtc::scoped_refptr<RTCStatsReport> report = RTCStatsReport::Create(1337);
|
rtc::scoped_refptr<RTCStatsReport> report = RTCStatsReport::Create(1337);
|
||||||
|
|
|
@ -49,7 +49,7 @@ class RTCChildStats : public RTCStats {
|
||||||
RTCStatsMember<int32_t> child_int;
|
RTCStatsMember<int32_t> child_int;
|
||||||
};
|
};
|
||||||
|
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCChildStats, RTCStats, "child-stats", &child_int);
|
WEBRTC_RTCSTATS_IMPL(RTCChildStats, RTCStats, "child-stats", &child_int)
|
||||||
|
|
||||||
class RTCGrandChildStats : public RTCChildStats {
|
class RTCGrandChildStats : public RTCChildStats {
|
||||||
public:
|
public:
|
||||||
|
@ -64,7 +64,7 @@ class RTCGrandChildStats : public RTCChildStats {
|
||||||
WEBRTC_RTCSTATS_IMPL(RTCGrandChildStats,
|
WEBRTC_RTCSTATS_IMPL(RTCGrandChildStats,
|
||||||
RTCChildStats,
|
RTCChildStats,
|
||||||
"grandchild-stats",
|
"grandchild-stats",
|
||||||
&grandchild_int);
|
&grandchild_int)
|
||||||
|
|
||||||
TEST(RTCStatsTest, RTCStatsAndMembers) {
|
TEST(RTCStatsTest, RTCStatsAndMembers) {
|
||||||
RTCTestStats stats("testId", 42);
|
RTCTestStats stats("testId", 42);
|
||||||
|
|
|
@ -346,4 +346,4 @@ TEST(RtpToNtpTests, AveragesErrorOut) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace {
|
||||||
|
|
||||||
class NullReceiver : public EmulatedNetworkReceiverInterface {
|
class NullReceiver : public EmulatedNetworkReceiverInterface {
|
||||||
public:
|
public:
|
||||||
void OnPacketReceived(EmulatedIpPacket packet) override{};
|
void OnPacketReceived(EmulatedIpPacket packet) override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ActionReceiver : public EmulatedNetworkReceiverInterface {
|
class ActionReceiver : public EmulatedNetworkReceiverInterface {
|
||||||
|
@ -36,7 +36,7 @@ class ActionReceiver : public EmulatedNetworkReceiverInterface {
|
||||||
RTC_DCHECK(port_);
|
RTC_DCHECK(port_);
|
||||||
action_();
|
action_();
|
||||||
endpoint_->UnbindReceiver(port_.value());
|
endpoint_->UnbindReceiver(port_.value());
|
||||||
};
|
}
|
||||||
|
|
||||||
// We can't set port in constructor, because port will be provided by
|
// We can't set port in constructor, because port will be provided by
|
||||||
// endpoint, when this receiver will be binded to that endpoint.
|
// endpoint, when this receiver will be binded to that endpoint.
|
||||||
|
|
Loading…
Reference in a new issue