| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |