mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Revert "Add checks for api/test mocks to make sure they're complete"
This reverts commit e87ec28b80
.
Reason for revert: Breaks upstream.
Original change's description:
> Add checks for api/test mocks to make sure they're complete
>
> Also unifies the mock inheritance if they inherited from a ref counted
> interface:
> - it should only inherit from the interface
> - it should use make_ref_counted
>
> Bug: webrtc:14594
> Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38602}
Bug: webrtc:14594
Change-Id: I9f2d9c3656b43e3006ec03ae7d792d0a53f47ebd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282940
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38604}
This commit is contained in:
parent
389228d0f0
commit
123a0ed604
25 changed files with 62 additions and 154 deletions
40
api/BUILD.gn
40
api/BUILD.gn
|
@ -979,7 +979,6 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_audio_mixer.h" ]
|
||||
|
||||
deps = [
|
||||
":make_ref_counted",
|
||||
"../test:test_support",
|
||||
"audio:audio_mixer_api",
|
||||
]
|
||||
|
@ -991,7 +990,7 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_audio_sink.h" ]
|
||||
|
||||
deps = [
|
||||
":media_stream_interface",
|
||||
"../api:media_stream_interface",
|
||||
"../test:test_support",
|
||||
]
|
||||
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
||||
|
@ -1004,7 +1003,6 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -1016,7 +1014,6 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -1036,7 +1033,8 @@ if (rtc_include_tests) {
|
|||
testonly = true
|
||||
sources = [ "test/mock_frame_encryptor.h" ]
|
||||
deps = [
|
||||
":make_ref_counted",
|
||||
# For api/crypto/frame_encryptor_interface.h
|
||||
":libjingle_peerconnection_api",
|
||||
"../test:test_support",
|
||||
"crypto:frame_encryptor_interface",
|
||||
]
|
||||
|
@ -1047,7 +1045,7 @@ if (rtc_include_tests) {
|
|||
testonly = true
|
||||
sources = [ "test/mock_frame_decryptor.h" ]
|
||||
deps = [
|
||||
":make_ref_counted",
|
||||
":libjingle_peerconnection_api",
|
||||
"../test:test_support",
|
||||
"crypto:frame_decryptor_interface",
|
||||
]
|
||||
|
@ -1058,8 +1056,9 @@ if (rtc_include_tests) {
|
|||
testonly = true
|
||||
sources = [ "test/mock_encoder_selector.h" ]
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../test:test_support",
|
||||
"video_codecs:video_codecs_api",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1072,6 +1071,8 @@ if (rtc_include_tests) {
|
|||
]
|
||||
deps = [
|
||||
":array_view",
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
":rtp_parameters",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:refcount",
|
||||
|
@ -1088,6 +1089,8 @@ if (rtc_include_tests) {
|
|||
]
|
||||
deps = [
|
||||
":array_view",
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
":rtp_parameters",
|
||||
"../rtc_base:checks",
|
||||
"crypto:frame_decryptor_interface",
|
||||
|
@ -1100,7 +1103,6 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_media_stream_interface.h" ]
|
||||
|
||||
deps = [
|
||||
":make_ref_counted",
|
||||
":media_stream_interface",
|
||||
"../test:test_support",
|
||||
]
|
||||
|
@ -1124,8 +1126,8 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
":scoped_refptr",
|
||||
"../api:scoped_refptr",
|
||||
"../rtc_base:refcount",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -1137,7 +1139,6 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -1173,7 +1174,6 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
":libjingle_peerconnection_api",
|
||||
":make_ref_counted",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -1195,8 +1195,8 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_video_bitrate_allocator.h" ]
|
||||
|
||||
deps = [
|
||||
"../api/video:video_bitrate_allocator",
|
||||
"../test:test_support",
|
||||
"video:video_bitrate_allocator",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1206,8 +1206,8 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_video_bitrate_allocator_factory.h" ]
|
||||
|
||||
deps = [
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
"../test:test_support",
|
||||
"video:video_bitrate_allocator_factory",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1220,8 +1220,8 @@ if (rtc_include_tests) {
|
|||
]
|
||||
|
||||
deps = [
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../test:test_support",
|
||||
"video_codecs:video_codecs_api",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1231,8 +1231,8 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_video_decoder.h" ]
|
||||
|
||||
deps = [
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../test:test_support",
|
||||
"video_codecs:video_codecs_api",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1242,8 +1242,8 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_video_encoder.h" ]
|
||||
|
||||
deps = [
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../test:test_support",
|
||||
"video_codecs:video_codecs_api",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1253,9 +1253,9 @@ if (rtc_include_tests) {
|
|||
sources = [ "test/mock_video_track.h" ]
|
||||
|
||||
deps = [
|
||||
":make_ref_counted",
|
||||
":media_stream_interface",
|
||||
":scoped_refptr",
|
||||
"../api:media_stream_interface",
|
||||
"../api:scoped_refptr",
|
||||
"../rtc_base:refcount",
|
||||
"../test:test_support",
|
||||
]
|
||||
}
|
||||
|
|
8
api/DEPS
8
api/DEPS
|
@ -250,6 +250,14 @@ specific_include_rules = {
|
|||
"+test/gmock.h",
|
||||
],
|
||||
|
||||
"mock_peerconnectioninterface\.h": [
|
||||
"+rtc_base/ref_counted_object.h",
|
||||
],
|
||||
|
||||
"mock_video_track\.h": [
|
||||
"+rtc_base/ref_counted_object.h",
|
||||
],
|
||||
|
||||
"notifier\.h": [
|
||||
"+rtc_base/system/no_unique_address.h",
|
||||
],
|
||||
|
|
|
@ -32,8 +32,6 @@ class MockTaskQueueBase : public TaskQueueBase {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockTaskQueueBase>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TASK_QUEUE_TEST_MOCK_TASK_QUEUE_BASE_H_
|
||||
|
|
|
@ -28,8 +28,6 @@ class MockAsyncDnsResolverResult : public AsyncDnsResolverResult {
|
|||
MOCK_METHOD(int, GetError, (), (const, override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockAsyncDnsResolverResult>);
|
||||
|
||||
class MockAsyncDnsResolver : public AsyncDnsResolverInterface {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
|
@ -43,8 +41,6 @@ class MockAsyncDnsResolver : public AsyncDnsResolverInterface {
|
|||
MOCK_METHOD(AsyncDnsResolverResult&, result, (), (const, override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockAsyncDnsResolver>);
|
||||
|
||||
class MockAsyncDnsResolverFactory : public AsyncDnsResolverFactoryInterface {
|
||||
public:
|
||||
MOCK_METHOD(std::unique_ptr<webrtc::AsyncDnsResolverInterface>,
|
||||
|
@ -61,8 +57,6 @@ class MockAsyncDnsResolverFactory : public AsyncDnsResolverFactoryInterface {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockAsyncDnsResolverFactory>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_ASYNC_DNS_RESOLVER_H_
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#define API_TEST_MOCK_AUDIO_MIXER_H_
|
||||
|
||||
#include "api/audio/audio_mixer.h"
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -20,20 +19,10 @@ namespace test {
|
|||
|
||||
class MockAudioMixer : public AudioMixer {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockAudioMixer> Create() {
|
||||
return rtc::make_ref_counted<MockAudioMixer>();
|
||||
}
|
||||
|
||||
MOCK_METHOD(bool, AddSource, (Source*), (override));
|
||||
MOCK_METHOD(void, RemoveSource, (Source*), (override));
|
||||
MOCK_METHOD(void, Mix, (size_t number_of_channels, AudioFrame*), (override));
|
||||
|
||||
protected:
|
||||
MockAudioMixer() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockAudioMixer>>);
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@ class MockAudioSink final : public webrtc::AudioTrackSinkInterface {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockAudioSink>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_AUDIO_SINK_H_
|
||||
|
|
|
@ -14,15 +14,16 @@
|
|||
#include <string>
|
||||
|
||||
#include "api/data_channel_interface.h"
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockDataChannelInterface : public webrtc::DataChannelInterface {
|
||||
class MockDataChannelInterface final
|
||||
: public rtc::RefCountedObject<webrtc::DataChannelInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockDataChannelInterface> Create() {
|
||||
return rtc::make_ref_counted<MockDataChannelInterface>();
|
||||
return rtc::scoped_refptr<MockDataChannelInterface>(
|
||||
new MockDataChannelInterface());
|
||||
}
|
||||
|
||||
MOCK_METHOD(void,
|
||||
|
@ -55,9 +56,6 @@ class MockDataChannelInterface : public webrtc::DataChannelInterface {
|
|||
MockDataChannelInterface() = default;
|
||||
};
|
||||
|
||||
static_assert(
|
||||
!std::is_abstract_v<rtc::RefCountedObject<MockDataChannelInterface>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_DATA_CHANNEL_H_
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "api/dtmf_sender_interface.h"
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -28,7 +27,7 @@ class MockDtmfSenderObserver : public DtmfSenderObserverInterface {
|
|||
MOCK_METHOD(void, OnToneChange, (const std::string&), (override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockDtmfSenderObserver>);
|
||||
static_assert(!std::is_abstract_v<MockDtmfSenderObserver>, "");
|
||||
|
||||
class MockDtmfSender : public DtmfSenderInterface {
|
||||
public:
|
||||
|
@ -50,7 +49,7 @@ class MockDtmfSender : public DtmfSenderInterface {
|
|||
MockDtmfSender() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockDtmfSender>>);
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockDtmfSender>>, "");
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ class MockFecControllerOverride : public FecControllerOverride {
|
|||
MOCK_METHOD(void, SetFecAllowed, (bool fec_allowed), (override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockFecControllerOverride>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_FEC_CONTROLLER_OVERRIDE_H_
|
||||
|
|
|
@ -14,17 +14,12 @@
|
|||
#include <vector>
|
||||
|
||||
#include "api/crypto/frame_decryptor_interface.h"
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockFrameDecryptor : public FrameDecryptorInterface {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockFrameDecryptor> Create() {
|
||||
return rtc::make_ref_counted<MockFrameDecryptor>();
|
||||
}
|
||||
|
||||
MOCK_METHOD(Result,
|
||||
Decrypt,
|
||||
(cricket::MediaType,
|
||||
|
@ -38,13 +33,8 @@ class MockFrameDecryptor : public FrameDecryptorInterface {
|
|||
GetMaxPlaintextByteSize,
|
||||
(cricket::MediaType, size_t encrypted_frame_size),
|
||||
(override));
|
||||
|
||||
protected:
|
||||
MockFrameDecryptor() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockFrameDecryptor>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_FRAME_DECRYPTOR_H_
|
||||
|
|
|
@ -12,17 +12,12 @@
|
|||
#define API_TEST_MOCK_FRAME_ENCRYPTOR_H_
|
||||
|
||||
#include "api/crypto/frame_encryptor_interface.h"
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockFrameEncryptor : public FrameEncryptorInterface {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockFrameEncryptor> Create() {
|
||||
return rtc::make_ref_counted<MockFrameEncryptor>();
|
||||
}
|
||||
|
||||
MOCK_METHOD(int,
|
||||
Encrypt,
|
||||
(cricket::MediaType,
|
||||
|
@ -37,13 +32,8 @@ class MockFrameEncryptor : public FrameEncryptorInterface {
|
|||
GetMaxCiphertextByteSize,
|
||||
(cricket::MediaType media_type, size_t frame_size),
|
||||
(override));
|
||||
|
||||
protected:
|
||||
MockFrameEncryptor() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockFrameEncryptor>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_FRAME_ENCRYPTOR_H_
|
||||
|
|
|
@ -13,16 +13,16 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockAudioSource : public AudioSourceInterface {
|
||||
class MockAudioSource final
|
||||
: public rtc::RefCountedObject<AudioSourceInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockAudioSource> Create() {
|
||||
return rtc::make_ref_counted<MockAudioSource>();
|
||||
return rtc::scoped_refptr<MockAudioSource>(new MockAudioSource());
|
||||
}
|
||||
|
||||
MOCK_METHOD(void,
|
||||
|
@ -48,16 +48,14 @@ class MockAudioSource : public AudioSourceInterface {
|
|||
MOCK_METHOD(void, RemoveSink, (AudioTrackSinkInterface * sink), (override));
|
||||
MOCK_METHOD(const cricket::AudioOptions, options, (), (const, override));
|
||||
|
||||
protected:
|
||||
private:
|
||||
MockAudioSource() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockAudioSource>>);
|
||||
|
||||
class MockAudioTrack : public AudioTrackInterface {
|
||||
class MockAudioTrack final : public rtc::RefCountedObject<AudioTrackInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockAudioTrack> Create() {
|
||||
return rtc::make_ref_counted<MockAudioTrack>();
|
||||
return rtc::scoped_refptr<MockAudioTrack>(new MockAudioTrack());
|
||||
}
|
||||
|
||||
MOCK_METHOD(void,
|
||||
|
@ -82,18 +80,12 @@ class MockAudioTrack : public AudioTrackInterface {
|
|||
(),
|
||||
(override));
|
||||
|
||||
protected:
|
||||
private:
|
||||
MockAudioTrack() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockAudioTrack>>);
|
||||
|
||||
class MockMediaStream : public MediaStreamInterface {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockMediaStream> Create() {
|
||||
return rtc::make_ref_counted<MockMediaStream>();
|
||||
}
|
||||
|
||||
MOCK_METHOD(std::string, id, (), (const override));
|
||||
MOCK_METHOD(AudioTrackVector, GetAudioTracks, (), (override));
|
||||
MOCK_METHOD(VideoTrackVector, GetVideoTracks, (), (override));
|
||||
|
@ -136,7 +128,7 @@ class MockMediaStream : public MediaStreamInterface {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockMediaStream>>);
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockMediaStream>>, "");
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
|
|
@ -14,17 +14,17 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockPeerConnectionFactoryInterface
|
||||
: public PeerConnectionFactoryInterface {
|
||||
class MockPeerConnectionFactoryInterface final
|
||||
: public rtc::RefCountedObject<webrtc::PeerConnectionFactoryInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockPeerConnectionFactoryInterface> Create() {
|
||||
return rtc::make_ref_counted<MockPeerConnectionFactoryInterface>();
|
||||
return rtc::scoped_refptr<MockPeerConnectionFactoryInterface>(
|
||||
new MockPeerConnectionFactoryInterface());
|
||||
}
|
||||
|
||||
MOCK_METHOD(void, SetOptions, (const Options&), (override));
|
||||
|
@ -76,9 +76,6 @@ class MockPeerConnectionFactoryInterface
|
|||
MockPeerConnectionFactoryInterface() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<
|
||||
rtc::RefCountedObject<MockPeerConnectionFactoryInterface>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_PEER_CONNECTION_FACTORY_INTERFACE_H_
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/sctp_transport_interface.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -205,7 +205,8 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface {
|
|||
};
|
||||
|
||||
static_assert(
|
||||
!std::is_abstract_v<rtc::RefCountedObject<MockPeerConnectionInterface>>);
|
||||
!std::is_abstract_v<rtc::RefCountedObject<MockPeerConnectionInterface>>,
|
||||
"");
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/rtp_transceiver_interface.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
|
@ -22,6 +21,8 @@ namespace webrtc {
|
|||
|
||||
class MockRtpTransceiver : public RtpTransceiverInterface {
|
||||
public:
|
||||
MockRtpTransceiver() = default;
|
||||
|
||||
static rtc::scoped_refptr<MockRtpTransceiver> Create() {
|
||||
return rtc::make_ref_counted<MockRtpTransceiver>();
|
||||
}
|
||||
|
@ -79,13 +80,8 @@ class MockRtpTransceiver : public RtpTransceiverInterface {
|
|||
(rtc::ArrayView<const RtpHeaderExtensionCapability>
|
||||
header_extensions_to_offer),
|
||||
(override));
|
||||
|
||||
protected:
|
||||
MockRtpTransceiver() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpTransceiver>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_RTP_TRANSCEIVER_H_
|
||||
|
|
|
@ -19,12 +19,8 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class MockRtpReceiver : public RtpReceiverInterface {
|
||||
class MockRtpReceiver : public rtc::RefCountedObject<RtpReceiverInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockRtpReceiver> Create() {
|
||||
return rtc::make_ref_counted<MockRtpReceiver>();
|
||||
}
|
||||
|
||||
MOCK_METHOD(rtc::scoped_refptr<MediaStreamTrackInterface>,
|
||||
track,
|
||||
(),
|
||||
|
@ -42,13 +38,8 @@ class MockRtpReceiver : public RtpReceiverInterface {
|
|||
(absl::optional<double>),
|
||||
(override));
|
||||
MOCK_METHOD(std::vector<RtpSource>, GetSources, (), (const, override));
|
||||
|
||||
protected:
|
||||
MockRtpReceiver() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpReceiver>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_RTPRECEIVER_H_
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/rtp_sender_interface.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
|
@ -69,8 +68,7 @@ class MockRtpSender : public RtpSenderInterface {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpSender>>);
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpSender>>, "");
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_RTPSENDER_H_
|
||||
|
|
|
@ -18,20 +18,13 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class MockTransformableVideoFrame : public TransformableVideoFrameInterface {
|
||||
class MockTransformableVideoFrame
|
||||
: public webrtc::TransformableVideoFrameInterface {
|
||||
public:
|
||||
// TransformableFrameInterface
|
||||
MOCK_METHOD(rtc::ArrayView<const uint8_t>, GetData, (), (const, override));
|
||||
MOCK_METHOD(void, SetData, (rtc::ArrayView<const uint8_t> data), (override));
|
||||
MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override));
|
||||
MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
|
||||
MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override));
|
||||
MOCK_METHOD(TransformableVideoFrameInterface::Direction,
|
||||
GetDirection,
|
||||
(),
|
||||
(const, override));
|
||||
|
||||
// TransformableVideoFrameInterface
|
||||
MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
|
||||
MOCK_METHOD(bool, IsKeyFrame, (), (const, override));
|
||||
MOCK_METHOD(std::vector<uint8_t>, GetAdditionalData, (), (const, override));
|
||||
MOCK_METHOD(const webrtc::VideoFrameMetadata&,
|
||||
|
@ -40,8 +33,6 @@ class MockTransformableVideoFrame : public TransformableVideoFrameInterface {
|
|||
(const, override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockTransformableVideoFrame>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_
|
||||
|
|
|
@ -23,8 +23,6 @@ class MockVideoBitrateAllocator : public webrtc::VideoBitrateAllocator {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoBitrateAllocator>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_BITRATE_ALLOCATOR_H_
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class MockVideoBitrateAllocatorFactory : public VideoBitrateAllocatorFactory {
|
||||
class MockVideoBitrateAllocatorFactory
|
||||
: public webrtc::VideoBitrateAllocatorFactory {
|
||||
public:
|
||||
~MockVideoBitrateAllocatorFactory() override { Die(); }
|
||||
MOCK_METHOD(std::unique_ptr<VideoBitrateAllocator>,
|
||||
|
@ -28,8 +29,6 @@ class MockVideoBitrateAllocatorFactory : public VideoBitrateAllocatorFactory {
|
|||
MOCK_METHOD(void, Die, ());
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoBitrateAllocatorFactory>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_BITRATE_ALLOCATOR_FACTORY_H_
|
||||
|
|
|
@ -37,8 +37,6 @@ class MockDecodedImageCallback : public DecodedImageCallback {
|
|||
(override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockDecodedImageCallback>);
|
||||
|
||||
class MockVideoDecoder : public VideoDecoder {
|
||||
public:
|
||||
MockVideoDecoder() {
|
||||
|
@ -67,8 +65,6 @@ class MockVideoDecoder : public VideoDecoder {
|
|||
MOCK_METHOD(void, Destruct, (), ());
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoDecoder>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_DECODER_H_
|
||||
|
|
|
@ -35,9 +35,6 @@ class MockVideoDecoderFactory : public webrtc::VideoDecoderFactory {
|
|||
(override));
|
||||
MOCK_METHOD(void, Die, ());
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoDecoderFactory>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_DECODER_FACTORY_H_
|
||||
|
|
|
@ -27,8 +27,6 @@ class MockEncodedImageCallback : public EncodedImageCallback {
|
|||
MOCK_METHOD(void, OnDroppedFrame, (DropReason reason), (override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockEncodedImageCallback>);
|
||||
|
||||
class MockVideoEncoder : public VideoEncoder {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
|
@ -70,8 +68,6 @@ class MockVideoEncoder : public VideoEncoder {
|
|||
MOCK_METHOD(EncoderInfo, GetEncoderInfo, (), (const, override));
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoEncoder>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_ENCODER_H_
|
||||
|
|
|
@ -37,8 +37,6 @@ class MockVideoEncoderFactory : public webrtc::VideoEncoderFactory {
|
|||
MOCK_METHOD(void, Die, ());
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<MockVideoEncoderFactory>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_ENCODER_FACTORY_H_
|
||||
|
|
|
@ -13,17 +13,18 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "api/make_ref_counted.h"
|
||||
#include "api/media_stream_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "rtc_base/ref_counted_object.h"
|
||||
#include "test/gmock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MockVideoTrack : public webrtc::VideoTrackInterface {
|
||||
class MockVideoTrack final
|
||||
: public rtc::RefCountedObject<webrtc::VideoTrackInterface> {
|
||||
public:
|
||||
static rtc::scoped_refptr<MockVideoTrack> Create() {
|
||||
return rtc::make_ref_counted<MockVideoTrack>();
|
||||
return rtc::scoped_refptr<MockVideoTrack>(new MockVideoTrack());
|
||||
}
|
||||
|
||||
// NotifierInterface
|
||||
|
@ -61,13 +62,8 @@ class MockVideoTrack : public webrtc::VideoTrackInterface {
|
|||
|
||||
MOCK_METHOD(ContentHint, content_hint, (), (const, override));
|
||||
MOCK_METHOD(void, set_content_hint, (ContentHint hint), (override));
|
||||
|
||||
protected:
|
||||
MockVideoTrack() = default;
|
||||
};
|
||||
|
||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockVideoTrack>>);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_TEST_MOCK_VIDEO_TRACK_H_
|
||||
|
|
Loading…
Reference in a new issue