Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h

Issue 2425223002: NetEq now works with packets as values, rather than pointers. (Closed)
Patch Set: Compare packets better in test. One more const. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5a2f7e11e18c4e4f5a2d6a01a45071d7266ab9d6 100644
--- a/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h
+++ b/webrtc/modules/audio_coding/neteq/mock/mock_packet_buffer.h
@@ -27,7 +27,13 @@ class MockPacketBuffer : public PacketBuffer {
void());
MOCK_CONST_METHOD0(Empty,
bool());
- MOCK_METHOD1(InsertPacket,
+ 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 and move from |*packet|.
+ MOCK_METHOD1(InsertPacketWrapped,
int(Packet* packet));
MOCK_METHOD4(InsertPacketList,
int(PacketList* packet_list,
@@ -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,
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698