Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h |
| diff --git a/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h b/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h |
| index ae1ab7a386af613dd7913cdcfc72d9f038a43d14..b8dc0495cb676af4fb1c948d9348a9870b6e01b0 100644 |
| --- a/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h |
| +++ b/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h |
| @@ -27,8 +27,14 @@ class MockPacketBuffer : public PacketBuffer { |
| void()); |
| MOCK_CONST_METHOD0(Empty, |
| bool()); |
| - MOCK_METHOD1(InsertPacket, |
| - int(Packet* packet)); |
| + int InsertPacket(Packet&& packet) { |
| + return InsertPacketWrapped(packet); |
| + } |
| + // Since gtest does not properly support move-only types, InsertPacket is |
| + // implemented as a wrapper. You'll have to implement InsertPacketWrapped |
| + // instead. |
| + MOCK_METHOD1(InsertPacketWrapped, |
| + int(Packet& packet)); |
|
kwiberg-webrtc
2016/10/20 22:39:22
It would be more style guide compliant to pass by
ossu
2016/10/21 12:54:41
Done... I miss references :(
|
| MOCK_METHOD4(InsertPacketList, |
| int(PacketList* packet_list, |
| const DecoderDatabase& decoder_database, |
| @@ -40,8 +46,8 @@ class MockPacketBuffer : public PacketBuffer { |
| int(uint32_t timestamp, uint32_t* next_timestamp)); |
| MOCK_CONST_METHOD0(PeekNextPacket, |
| const Packet*()); |
| - MOCK_METHOD1(GetNextPacket, |
| - Packet*(size_t* discard_count)); |
| + MOCK_METHOD0(GetNextPacket, |
| + rtc::Optional<Packet>()); |
| MOCK_METHOD0(DiscardNextPacket, |
| int()); |
| MOCK_METHOD2(DiscardOldPackets, |