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

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

Issue 2348233002: AcmReceiver: Ask NetEq to delete all decoders at once instead of one by one (Closed)
Patch Set: unit tests 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 TEST_F(NetEqImplTest, RemovePayloadType) { 224 TEST_F(NetEqImplTest, RemovePayloadType) {
225 CreateInstance(); 225 CreateInstance();
226 uint8_t rtp_payload_type = 0; 226 uint8_t rtp_payload_type = 0;
227 EXPECT_CALL(*mock_decoder_database_, Remove(rtp_payload_type)) 227 EXPECT_CALL(*mock_decoder_database_, Remove(rtp_payload_type))
228 .WillOnce(Return(DecoderDatabase::kDecoderNotFound)); 228 .WillOnce(Return(DecoderDatabase::kDecoderNotFound));
229 // Check that kFail is returned when database returns kDecoderNotFound. 229 // Check that kFail is returned when database returns kDecoderNotFound.
230 EXPECT_EQ(NetEq::kFail, neteq_->RemovePayloadType(rtp_payload_type)); 230 EXPECT_EQ(NetEq::kFail, neteq_->RemovePayloadType(rtp_payload_type));
231 } 231 }
232 232
233 TEST_F(NetEqImplTest, RemoveAllPayloadTypes) {
234 CreateInstance();
235 EXPECT_CALL(*mock_decoder_database_, RemoveAll()).WillOnce(Return());
236 neteq_->RemoveAllPayloadTypes();
237 }
238
233 TEST_F(NetEqImplTest, InsertPacket) { 239 TEST_F(NetEqImplTest, InsertPacket) {
234 CreateInstance(); 240 CreateInstance();
235 const size_t kPayloadLength = 100; 241 const size_t kPayloadLength = 100;
236 const uint8_t kPayloadType = 0; 242 const uint8_t kPayloadType = 0;
237 const uint16_t kFirstSequenceNumber = 0x1234; 243 const uint16_t kFirstSequenceNumber = 0x1234;
238 const uint32_t kFirstTimestamp = 0x12345678; 244 const uint32_t kFirstTimestamp = 0x12345678;
239 const uint32_t kSsrc = 0x87654321; 245 const uint32_t kSsrc = 0x87654321;
240 const uint32_t kFirstReceiveTime = 17; 246 const uint32_t kFirstReceiveTime = 17;
241 uint8_t payload[kPayloadLength] = {0}; 247 uint8_t payload[kPayloadLength] = {0};
242 WebRtcRTPHeader rtp_header; 248 WebRtcRTPHeader rtp_header;
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) 1435 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _))
1430 .Times(1) 1436 .Times(1)
1431 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); 1437 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2)));
1432 1438
1433 bool muted; 1439 bool muted;
1434 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); 1440 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
1435 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); 1441 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test());
1436 } 1442 }
1437 1443
1438 }// namespace webrtc 1444 }// namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698