Remove duplicated implementations of Mock classes
Bug: None Change-Id: Ifc163d26c798cfeb511951ea4ee7bd1b5e82d81b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227349 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34636}
This commit is contained in:
parent
deac4dea4f
commit
9cd4d4953f
@ -644,6 +644,7 @@ if (rtc_include_tests) {
|
||||
"../api:mock_fec_controller_override",
|
||||
"../api:mock_frame_decryptor",
|
||||
"../api:mock_video_codec_factory",
|
||||
"../api:mock_video_decoder",
|
||||
"../api:mock_video_encoder",
|
||||
"../api:rtp_headers",
|
||||
"../api:rtp_parameters",
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
#include "api/video/video_codec_type.h"
|
||||
#include "api/video/video_frame_type.h"
|
||||
#include "call/test/mock_rtp_packet_sink_interface.h"
|
||||
#include "common_video/h264/h264_common.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h"
|
||||
@ -38,6 +39,7 @@
|
||||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_frame_transformer.h"
|
||||
#include "test/mock_transport.h"
|
||||
#include "test/time_controller/simulated_task_queue.h"
|
||||
#include "test/time_controller/simulated_time_controller.h"
|
||||
|
||||
@ -73,15 +75,6 @@ RTPVideoHeader GetGenericVideoHeader(VideoFrameType frame_type) {
|
||||
return video_header;
|
||||
}
|
||||
|
||||
class MockTransport : public Transport {
|
||||
public:
|
||||
MOCK_METHOD(bool,
|
||||
SendRtp,
|
||||
(const uint8_t*, size_t length, const PacketOptions& options),
|
||||
(override));
|
||||
MOCK_METHOD(bool, SendRtcp, (const uint8_t*, size_t length), (override));
|
||||
};
|
||||
|
||||
class MockNackSender : public NackSender {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
@ -130,11 +123,6 @@ class MockOnCompleteFrameCallback
|
||||
rtc::ByteBufferWriter buffer_;
|
||||
};
|
||||
|
||||
class MockRtpPacketSink : public RtpPacketSinkInterface {
|
||||
public:
|
||||
MOCK_METHOD(void, OnRtpPacket, (const RtpPacketReceived&), (override));
|
||||
};
|
||||
|
||||
constexpr uint32_t kSsrc = 111;
|
||||
constexpr int kPayloadType = 100;
|
||||
constexpr int kRedPayloadType = 125;
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "api/video/video_codec_type.h"
|
||||
#include "api/video/video_frame_type.h"
|
||||
#include "call/test/mock_rtp_packet_sink_interface.h"
|
||||
#include "common_video/h264/h264_common.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_descriptor_authentication.h"
|
||||
@ -37,6 +38,7 @@
|
||||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_frame_transformer.h"
|
||||
#include "test/mock_transport.h"
|
||||
|
||||
using ::testing::_;
|
||||
using ::testing::ElementsAre;
|
||||
@ -70,15 +72,6 @@ RTPVideoHeader GetGenericVideoHeader(VideoFrameType frame_type) {
|
||||
return video_header;
|
||||
}
|
||||
|
||||
class MockTransport : public Transport {
|
||||
public:
|
||||
MOCK_METHOD(bool,
|
||||
SendRtp,
|
||||
(const uint8_t*, size_t length, const PacketOptions& options),
|
||||
(override));
|
||||
MOCK_METHOD(bool, SendRtcp, (const uint8_t*, size_t length), (override));
|
||||
};
|
||||
|
||||
class MockNackSender : public NackSender {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
@ -127,11 +120,6 @@ class MockOnCompleteFrameCallback
|
||||
rtc::ByteBufferWriter buffer_;
|
||||
};
|
||||
|
||||
class MockRtpPacketSink : public RtpPacketSinkInterface {
|
||||
public:
|
||||
MOCK_METHOD(void, OnRtpPacket, (const RtpPacketReceived&), (override));
|
||||
};
|
||||
|
||||
constexpr uint32_t kSsrc = 111;
|
||||
constexpr uint16_t kSequenceNumber = 222;
|
||||
constexpr int kPayloadType = 100;
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/mock_video_decoder_factory.h"
|
||||
#include "api/test/video/function_video_decoder_factory.h"
|
||||
#include "api/video/video_frame.h"
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
@ -34,6 +36,7 @@
|
||||
#include "test/field_trial.h"
|
||||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_transport.h"
|
||||
#include "test/run_loop.h"
|
||||
#include "test/time_controller/simulated_time_controller.h"
|
||||
#include "test/video_decoder_proxy_factory.h"
|
||||
@ -54,43 +57,6 @@ using ::testing::SizeIs;
|
||||
|
||||
constexpr int kDefaultTimeOutMs = 50;
|
||||
|
||||
class MockTransport : public Transport {
|
||||
public:
|
||||
MOCK_METHOD(bool,
|
||||
SendRtp,
|
||||
(const uint8_t*, size_t length, const PacketOptions& options),
|
||||
(override));
|
||||
MOCK_METHOD(bool, SendRtcp, (const uint8_t*, size_t length), (override));
|
||||
};
|
||||
|
||||
class MockVideoDecoder : public VideoDecoder {
|
||||
public:
|
||||
MOCK_METHOD(int32_t,
|
||||
InitDecode,
|
||||
(const VideoCodec*, int32_t number_of_cores),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t,
|
||||
Decode,
|
||||
(const EncodedImage& input,
|
||||
bool missing_frames,
|
||||
int64_t render_time_ms),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t,
|
||||
RegisterDecodeCompleteCallback,
|
||||
(DecodedImageCallback*),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t, Release, (), (override));
|
||||
const char* ImplementationName() const { return "MockVideoDecoder"; }
|
||||
};
|
||||
|
||||
class MockVideoDecoderFactory : public VideoDecoderFactory {
|
||||
public:
|
||||
MOCK_CONST_METHOD0(GetSupportedFormats, std::vector<SdpVideoFormat>());
|
||||
|
||||
MOCK_METHOD1(CreateVideoDecoder,
|
||||
std::unique_ptr<VideoDecoder>(const SdpVideoFormat& format));
|
||||
};
|
||||
|
||||
class FrameObjectFake : public EncodedFrame {
|
||||
public:
|
||||
void SetPayloadType(uint8_t payload_type) { _payloadType = payload_type; }
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/mock_video_decoder.h"
|
||||
#include "api/test/video/function_video_decoder_factory.h"
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "call/rtp_stream_receiver_controller.h"
|
||||
@ -31,6 +32,7 @@
|
||||
#include "test/field_trial.h"
|
||||
#include "test/gmock.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/mock_transport.h"
|
||||
#include "test/time_controller/simulated_time_controller.h"
|
||||
#include "test/video_decoder_proxy_factory.h"
|
||||
#include "video/call_stats.h"
|
||||
@ -46,36 +48,6 @@ using ::testing::SizeIs;
|
||||
|
||||
constexpr int kDefaultTimeOutMs = 50;
|
||||
|
||||
class MockTransport : public Transport {
|
||||
public:
|
||||
MOCK_METHOD(bool,
|
||||
SendRtp,
|
||||
(const uint8_t*, size_t length, const PacketOptions& options),
|
||||
(override));
|
||||
MOCK_METHOD(bool, SendRtcp, (const uint8_t*, size_t length), (override));
|
||||
};
|
||||
|
||||
class MockVideoDecoder : public VideoDecoder {
|
||||
public:
|
||||
MOCK_METHOD(int32_t,
|
||||
InitDecode,
|
||||
(const VideoCodec*, int32_t number_of_cores),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t,
|
||||
Decode,
|
||||
(const EncodedImage& input,
|
||||
bool missing_frames,
|
||||
int64_t render_time_ms),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t,
|
||||
RegisterDecodeCompleteCallback,
|
||||
(DecodedImageCallback*),
|
||||
(override));
|
||||
MOCK_METHOD(int32_t, Release, (), (override));
|
||||
MOCK_METHOD(VideoDecoder::DecoderInfo, GetDetcoderInfo, (), (const override));
|
||||
const char* ImplementationName() const { return "MockVideoDecoder"; }
|
||||
};
|
||||
|
||||
class FrameObjectFake : public EncodedFrame {
|
||||
public:
|
||||
void SetPayloadType(uint8_t payload_type) { _payloadType = payload_type; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user