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

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

Issue 2719113002: Handle TimeUntilNextProcess in StartupShutdownWithExternalADM (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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) 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 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3500 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); 3500 call.get(), cricket::MediaConfig(), cricket::AudioOptions());
3501 EXPECT_TRUE(channel != nullptr); 3501 EXPECT_TRUE(channel != nullptr);
3502 delete channel; 3502 delete channel;
3503 } 3503 }
3504 3504
3505 // Tests that reference counting on the external ADM is correct. 3505 // Tests that reference counting on the external ADM is correct.
3506 TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) { 3506 TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) {
3507 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm; 3507 testing::NiceMock<webrtc::test::MockAudioDeviceModule> adm;
3508 EXPECT_CALL(adm, AddRef()).Times(3).WillRepeatedly(Return(0)); 3508 EXPECT_CALL(adm, AddRef()).Times(3).WillRepeatedly(Return(0));
3509 EXPECT_CALL(adm, Release()).Times(3).WillRepeatedly(Return(0)); 3509 EXPECT_CALL(adm, Release()).Times(3).WillRepeatedly(Return(0));
3510 // Return 100ms just in case this function gets called. If we don't,
3511 // we could enter a tight loop since the mock would return 0.
3512 EXPECT_CALL(adm, TimeUntilNextProcess()).WillRepeatedly(Return(100));
3510 { 3513 {
3511 cricket::WebRtcVoiceEngine engine( 3514 cricket::WebRtcVoiceEngine engine(
3512 &adm, webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr); 3515 &adm, webrtc::MockAudioDecoderFactory::CreateUnusedFactory(), nullptr);
3513 webrtc::RtcEventLogNullImpl event_log; 3516 webrtc::RtcEventLogNullImpl event_log;
3514 std::unique_ptr<webrtc::Call> call( 3517 std::unique_ptr<webrtc::Call> call(
3515 webrtc::Call::Create(webrtc::Call::Config(&event_log))); 3518 webrtc::Call::Create(webrtc::Call::Config(&event_log)));
3516 cricket::VoiceMediaChannel* channel = engine.CreateChannel( 3519 cricket::VoiceMediaChannel* channel = engine.CreateChannel(
3517 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); 3520 call.get(), cricket::MediaConfig(), cricket::AudioOptions());
3518 EXPECT_TRUE(channel != nullptr); 3521 EXPECT_TRUE(channel != nullptr);
3519 delete channel; 3522 delete channel;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 // Without this cast, the comparison turned unsigned and, thus, failed for -1. 3730 // Without this cast, the comparison turned unsigned and, thus, failed for -1.
3728 const int num_specs = static_cast<int>(specs.size()); 3731 const int num_specs = static_cast<int>(specs.size());
3729 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs); 3732 EXPECT_GE(find_codec({"cn", 8000, 1}), num_specs);
3730 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs); 3733 EXPECT_GE(find_codec({"cn", 16000, 1}), num_specs);
3731 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1); 3734 EXPECT_EQ(find_codec({"cn", 32000, 1}), -1);
3732 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs); 3735 EXPECT_GE(find_codec({"telephone-event", 8000, 1}), num_specs);
3733 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs); 3736 EXPECT_GE(find_codec({"telephone-event", 16000, 1}), num_specs);
3734 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs); 3737 EXPECT_GE(find_codec({"telephone-event", 32000, 1}), num_specs);
3735 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs); 3738 EXPECT_GE(find_codec({"telephone-event", 48000, 1}), num_specs);
3736 } 3739 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698