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

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

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, 1 month 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 using ::testing::WithArg; 45 using ::testing::WithArg;
46 using ::testing::Pointee; 46 using ::testing::Pointee;
47 using ::testing::IsNull; 47 using ::testing::IsNull;
48 48
49 namespace webrtc { 49 namespace webrtc {
50 50
51 // This function is called when inserting a packet list into the mock packet 51 // This function is called when inserting a packet list into the mock packet
52 // buffer. The purpose is to delete all inserted packets properly, to avoid 52 // buffer. The purpose is to delete all inserted packets properly, to avoid
53 // memory leaks in the test. 53 // memory leaks in the test.
54 int DeletePacketsAndReturnOk(PacketList* packet_list) { 54 int DeletePacketsAndReturnOk(PacketList* packet_list) {
55 PacketBuffer::DeleteAllPackets(packet_list); 55 packet_list->clear();
56 return PacketBuffer::kOK; 56 return PacketBuffer::kOK;
57 } 57 }
58 58
59 class NetEqImplTest : public ::testing::Test { 59 class NetEqImplTest : public ::testing::Test {
60 protected: 60 protected:
61 NetEqImplTest() { config_.sample_rate_hz = 8000; } 61 NetEqImplTest() { config_.sample_rate_hz = 8000; }
62 62
63 void CreateInstance() { 63 void CreateInstance() {
64 NetEqImpl::Dependencies deps(config_, CreateBuiltinAudioDecoderFactory()); 64 NetEqImpl::Dependencies deps(config_, CreateBuiltinAudioDecoderFactory());
65 65
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) 1462 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _))
1463 .Times(1) 1463 .Times(1)
1464 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); 1464 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2)));
1465 1465
1466 bool muted; 1466 bool muted;
1467 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); 1467 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
1468 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); 1468 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test());
1469 } 1469 }
1470 1470
1471 }// namespace webrtc 1471 }// namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl.cc ('k') | webrtc/modules/audio_coding/neteq/packet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698