webrtc_m130/voice_engine/voe_base_unittest.cc
Niels Möller 84255bbe3b Add explicit includes of refcountedobject.h where it is used.
This is in preparation for deleting the include in rtc_base/refcount.h,
but that change has to wait for some downstream applications to 
not rely in the indirect include.

Partial reland of "Make rtc_base/refcount.h self contained, not including refcountedobject.h."

This is a reland of b7239a9dc825ddb25dbc800aed3a065163b9a10e
Original change's description:
> Make rtc_base/refcount.h self contained, not including refcountedobject.h.
> 
> The refcount.h file doesn't depend on anything from
> refcountedobject.h. The motivation of this change to make it possible
> to add additional declarations to refcount.h, and include it from
> refcountedobject.h.
> 
> Bug: webrtc:8270
> Change-Id: I24f6131f471e675570968d00065ff9b1f55e3373
> Reviewed-on: https://webrtc-review.googlesource.com/5760
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20106}

Bug: webrtc:8270
Change-Id: I63a42712f6c1ec83823c629d1a954fd1a04d4a6c
Reviewed-on: https://webrtc-review.googlesource.com/7281
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20185}
2017-10-06 13:00:14 +00:00

53 lines
1.5 KiB
C++

/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "voice_engine/include/voe_base.h"
#include "modules/audio_device/include/fake_audio_device.h"
#include "modules/audio_processing/include/mock_audio_processing.h"
#include "rtc_base/refcountedobject.h"
#include "test/gtest.h"
namespace webrtc {
class VoEBaseTest : public ::testing::Test {
protected:
VoEBaseTest()
: voe_(VoiceEngine::Create()),
base_(VoEBase::GetInterface(voe_)) {
EXPECT_NE(nullptr, base_);
apm_ = new rtc::RefCountedObject<test::MockAudioProcessing>();
}
~VoEBaseTest() {
EXPECT_EQ(0, base_->Terminate());
EXPECT_EQ(1, base_->Release());
EXPECT_TRUE(VoiceEngine::Delete(voe_));
}
VoiceEngine* voe_;
VoEBase* base_;
FakeAudioDeviceModule adm_;
rtc::scoped_refptr<AudioProcessing> apm_;
};
TEST_F(VoEBaseTest, InitWithExternalAudioDevice) {
EXPECT_EQ(0, base_->Init(&adm_, apm_.get()));
}
TEST_F(VoEBaseTest, CreateChannelAfterInit) {
EXPECT_EQ(0, base_->Init(&adm_, apm_.get(), nullptr));
int channelID = base_->CreateChannel();
EXPECT_NE(channelID, -1);
EXPECT_EQ(0, base_->DeleteChannel(channelID));
}
} // namespace webrtc