In common_audio/ and modules/audio_* replace mock macros with unified MOCK_METHOD macro

Bug: webrtc:11564
Change-Id: Ib0ffce4de50a13b018926f6ea2865a2ec2fb2ec7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175621
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31333}
This commit is contained in:
Danil Chapovalov
2020-05-18 15:10:15 +02:00
committed by Commit Bot
parent b46df3da44
commit 704fb55255
31 changed files with 511 additions and 396 deletions

View File

@ -23,22 +23,28 @@ class MockDecoderDatabase : public DecoderDatabase {
explicit MockDecoderDatabase(
rtc::scoped_refptr<AudioDecoderFactory> factory = nullptr)
: DecoderDatabase(factory, absl::nullopt) {}
virtual ~MockDecoderDatabase() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_CONST_METHOD0(Empty, bool());
MOCK_CONST_METHOD0(Size, int());
MOCK_METHOD0(Reset, void());
MOCK_METHOD2(RegisterPayload,
int(int rtp_payload_type, const SdpAudioFormat& audio_format));
MOCK_METHOD1(Remove, int(uint8_t rtp_payload_type));
MOCK_METHOD0(RemoveAll, void());
MOCK_CONST_METHOD1(GetDecoderInfo,
const DecoderInfo*(uint8_t rtp_payload_type));
MOCK_METHOD2(SetActiveDecoder,
int(uint8_t rtp_payload_type, bool* new_decoder));
MOCK_CONST_METHOD0(GetActiveDecoder, AudioDecoder*());
MOCK_METHOD1(SetActiveCngDecoder, int(uint8_t rtp_payload_type));
MOCK_CONST_METHOD0(GetActiveCngDecoder, ComfortNoiseDecoder*());
~MockDecoderDatabase() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(bool, Empty, (), (const, override));
MOCK_METHOD(int, Size, (), (const, override));
MOCK_METHOD(void, Reset, (), (override));
MOCK_METHOD(int,
RegisterPayload,
(int rtp_payload_type, const SdpAudioFormat& audio_format),
(override));
MOCK_METHOD(int, Remove, (uint8_t rtp_payload_type), (override));
MOCK_METHOD(void, RemoveAll, (), (override));
MOCK_METHOD(const DecoderInfo*,
GetDecoderInfo,
(uint8_t rtp_payload_type),
(const, override));
MOCK_METHOD(int,
SetActiveDecoder,
(uint8_t rtp_payload_type, bool* new_decoder),
(override));
MOCK_METHOD(AudioDecoder*, GetActiveDecoder, (), (const, override));
MOCK_METHOD(int, SetActiveCngDecoder, (uint8_t rtp_payload_type), (override));
MOCK_METHOD(ComfortNoiseDecoder*, GetActiveCngDecoder, (), (const, override));
};
} // namespace webrtc