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

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc

Issue 2290153002: NetEq: Change member variables for current RTP types to rtc::Optionals (Closed)
Patch Set: Updates after review Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer()) 280 EXPECT_CALL(*mock_packet_buffer_, NumPacketsInBuffer())
281 .WillOnce(Return(0)) // First packet. 281 .WillOnce(Return(0)) // First packet.
282 .WillOnce(Return(1)) // Second packet. 282 .WillOnce(Return(1)) // Second packet.
283 .WillOnce(Return(2)); // Second packet, checking after it was inserted. 283 .WillOnce(Return(2)); // Second packet, checking after it was inserted.
284 EXPECT_CALL(*mock_packet_buffer_, Empty()) 284 EXPECT_CALL(*mock_packet_buffer_, Empty())
285 .WillOnce(Return(false)); // Called once after first packet is inserted. 285 .WillOnce(Return(false)); // Called once after first packet is inserted.
286 EXPECT_CALL(*mock_packet_buffer_, Flush()) 286 EXPECT_CALL(*mock_packet_buffer_, Flush())
287 .Times(1); 287 .Times(1);
288 EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _)) 288 EXPECT_CALL(*mock_packet_buffer_, InsertPacketList(_, _, _, _))
289 .Times(2) 289 .Times(2)
290 .WillRepeatedly(DoAll(SetArgPointee<2>(kPayloadType), 290 .WillRepeatedly(
291 WithArg<0>(Invoke(DeletePacketsAndReturnOk)))); 291 DoAll(SetArgPointee<2>(rtc::Optional<uint8_t>(kPayloadType)),
292 WithArg<0>(Invoke(DeletePacketsAndReturnOk))));
292 // SetArgPointee<2>(kPayloadType) means that the third argument (zero-based 293 // SetArgPointee<2>(kPayloadType) means that the third argument (zero-based
293 // index) is a pointer, and the variable pointed to is set to kPayloadType. 294 // index) is a pointer, and the variable pointed to is set to kPayloadType.
294 // Also invoke the function DeletePacketsAndReturnOk to properly delete all 295 // Also invoke the function DeletePacketsAndReturnOk to properly delete all
295 // packets in the list (to avoid memory leaks in the test). 296 // packets in the list (to avoid memory leaks in the test).
296 EXPECT_CALL(*mock_packet_buffer_, NextRtpHeader()) 297 EXPECT_CALL(*mock_packet_buffer_, NextRtpHeader())
297 .Times(1) 298 .Times(1)
298 .WillOnce(Return(&rtp_header.header)); 299 .WillOnce(Return(&rtp_header.header));
299 300
300 // Expectations for DTMF buffer. 301 // Expectations for DTMF buffer.
301 EXPECT_CALL(*mock_dtmf_buffer_, Flush()) 302 EXPECT_CALL(*mock_dtmf_buffer_, Flush())
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) 1429 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _))
1429 .Times(1) 1430 .Times(1)
1430 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); 1431 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2)));
1431 1432
1432 bool muted; 1433 bool muted;
1433 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); 1434 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
1434 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); 1435 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test());
1435 } 1436 }
1436 1437
1437 }// namespace webrtc 1438 }// namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | webrtc/modules/audio_coding/neteq/packet_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698