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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 2377023002: Now pass ADM as a constructor argument to audio_state. (Closed)
Patch Set: Removed audio_transport() mock calls in tests. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2008 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 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 webrtc::Call::Create(webrtc::Call::Config())); 3350 webrtc::Call::Create(webrtc::Call::Config()));
3351 cricket::VoiceMediaChannel* channel = engine.CreateChannel( 3351 cricket::VoiceMediaChannel* channel = engine.CreateChannel(
3352 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); 3352 call.get(), cricket::MediaConfig(), cricket::AudioOptions());
3353 EXPECT_TRUE(channel != nullptr); 3353 EXPECT_TRUE(channel != nullptr);
3354 delete channel; 3354 delete channel;
3355 } 3355 }
3356 3356
3357 // Tests that reference counting on the external ADM is correct. 3357 // Tests that reference counting on the external ADM is correct.
3358 TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) { 3358 TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) {
3359 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm; 3359 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
3360 EXPECT_CALL(adm, AddRef()).Times(3).WillRepeatedly(Return(0)); 3360 EXPECT_CALL(adm, AddRef()).Times(4).WillRepeatedly(Return(0));
3361 EXPECT_CALL(adm, Release()).Times(3).WillRepeatedly(Return(0)); 3361 EXPECT_CALL(adm, Release()).Times(4).WillRepeatedly(Return(0));
3362 { 3362 {
3363 cricket::WebRtcVoiceEngine engine( 3363 cricket::WebRtcVoiceEngine engine(
3364 &adm, webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); 3364 &adm, webrtc::MockAudioDecoderFactory::CreateUnusedFactory());
3365 std::unique_ptr<webrtc::Call> call( 3365 std::unique_ptr<webrtc::Call> call(
3366 webrtc::Call::Create(webrtc::Call::Config())); 3366 webrtc::Call::Create(webrtc::Call::Config()));
3367 cricket::VoiceMediaChannel* channel = engine.CreateChannel( 3367 cricket::VoiceMediaChannel* channel = engine.CreateChannel(
3368 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); 3368 call.get(), cricket::MediaConfig(), cricket::AudioOptions());
3369 EXPECT_TRUE(channel != nullptr); 3369 EXPECT_TRUE(channel != nullptr);
3370 delete channel; 3370 delete channel;
3371 } 3371 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
3493 cricket::WebRtcVoiceEngine engine( 3493 cricket::WebRtcVoiceEngine engine(
3494 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); 3494 nullptr, webrtc::CreateBuiltinAudioDecoderFactory());
3495 std::unique_ptr<webrtc::Call> call( 3495 std::unique_ptr<webrtc::Call> call(
3496 webrtc::Call::Create(webrtc::Call::Config())); 3496 webrtc::Call::Create(webrtc::Call::Config()));
3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3498 cricket::AudioOptions(), call.get()); 3498 cricket::AudioOptions(), call.get());
3499 cricket::AudioRecvParameters parameters; 3499 cricket::AudioRecvParameters parameters;
3500 parameters.codecs = engine.recv_codecs(); 3500 parameters.codecs = engine.recv_codecs();
3501 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3501 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3502 } 3502 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698